
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@telus/nightwatch-visual
Advanced tools
Screenshot comparison assertion for Nightwatch.js
This custom assertion allows you to easily integrate visual regression testing into a Nightwatch test suite.
It uses resemble.js to compare your code change against your approved baseline screenshots of your application.
# using npm
npm install --global @telus/build-essential
npm install --only-production --save @telus/nightwatch-visual
Update your nightwatch config:
{
custom_assertions_path: [
'./node_modules/@telus/nightwatch-visual/assertions',
'./node_modules/@telus/nightwatch-visual/commands'
]
}
...
"test_settings": {
"nightwatch_visual": {
"visualTesting": "enabled"
"defaultSelector": "html",
"defaultTolerance": 3,
"defaultPath": "./nightwatch-visual"
},
Mount your screenshot folder in your Dockerfile
RUN chmod -R g+w /app/tests/nightwatch-visual \
Use in your tests:
module.exports = {
Test: function(browser) {
browser.assert.compareScreenshot(fileName, selector, tolerance, path)
}
}
Parameter | Default | Description |
---|---|---|
fileName | browserName_browserVersion_testName.png | Customized output when multiple screenshots on the same test: browserName_browserVersion_fileName.png |
selector | 'html' | CSS selector of the targeted component the assertion is ran against |
tolerance | 3 | % of difference between the baseline and result images from which the assertion will fail |
path | 'path.join(__dirname, '../nightwatch-visual'' | Folder where to save screenshots. Usefull especially when running with Docker |
Screenshots will be saved in the \nightwatch-visual\your-test-name\
folders
.
├── nightwatch-visual
│ └── testName
│ ├── baseline
│ │ └── browserName_browserVersion_testName.png
│ ├── diffs
│ │ └── browserName_browserVersion_testName.png
│ └── results
│ └── browserName_browserVersion_testName.png
├── test
│ └── specs
│ └── testName.js
└── ...
:copyright: TELUS digital • License: ISC • Github: @telus • Twitter: @telusdigital
FAQs
Nightwatch.js utility assertion for visual testing
We found that @telus/nightwatch-visual demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 18 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.