
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@csssr/nightwatch-image-comparison
Advanced tools
Nightwatch assertions to compare screenshots in your tests. Currently under development and contains a bunch of hardcoded options. Do not use yet, but please let me know if you want too.
The module is now based on webdriver-image-comparison module. Thanks a lot Wim Selles for creating and open sourcing it!
npm install --save-dev @csssr/nightwatch-image-comparisonnightwatch.conf.jsconst path = require('path')
const nightwatchImageComparison = require('@csssr/nightwatch-image-comparison')
module.exports = {
globals: {
screenshots: {
testsRootDir: path.join(__dirname, 'tests'), // required
screenshotsRootDir: path.join(__dirname, 'screenshots'), // required
skipScreenshotAssertions: false, // default: false
},
},
custom_assertions_path: [nightwatchImageComparison.assertionsPath],
}
Making screenshot of all page
browser.assert.screenshotPage('full authorization page')
Make a screenshot of element with selector [data-test-id="auth-form"]
browser.assert.screenshotElement(
'[data-test-id="auth-form"]',
'Authorization form before filling: every field is empty'
)
Specifing allowed mismatch percentage. Try not to use it because it can lead to missing unexpected changes.
browser.assert.screenshotElement(
'[data-test-id="confirm-registration-form"]',
'Confirmation form: fields are empty, submit button is disabled',
{
// Rendering in IE is slightly different every time
allowedMisMatchPercentage: 0.5, // 0,5%
}
)
Hide some selectors before taking screenshot
browser.assert.screenshotElement(
'[data-test-id="confirm-registration-form"]',
'форма подтверждения регистрации: поля не заполнены, кнопка отправки задизейблена',
{
hideSelectors: [
// Email is different every test run (created randomly)
'[data-test-id="auth-form-email-field"]',
],
}
)
FAQs
Screenshot assertions for Nightwatch
We found that @csssr/nightwatch-image-comparison demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.