Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@chromaui/wdio-screenshot
Advanced tools
A WebdriverIO plugin. Additional commands for taking screenshots with WebdriverIO.
Install wdio-screenshot via NPM as usual:
$ npm install wdio-screenshot --save-dev
Instructions on how to install WebdriverIO
can be found here.
Note: If you want to improve performance, you can install GraphicsMagick.
Setup wdio-screenshot by adding a wdio-screenshot
key to the plugins section of your WebdriverIO config.
// wdio.conf.js
exports.config = {
// ...
plugins: {
'wdio-screenshot': {}
},
// ...
};
wdio-screenshot enhances an WebdriverIO instance with the following commands:
browser.saveViewportScreenshot([fileName], [{options}]);
browser.saveDocumentScreenshot([fileName], [{options}]);
browser.saveElementScreenshot([fileName], elementSelector, [{options}]);
All of these provide options that will help you to exclude unrelevant parts (e.g. content). The following options are available:
exclude String[]|Object[]
(not yet implemented)
exclude frequently changing parts of your screenshot, you can either pass all kinds of different WebdriverIO selector strategies
that queries one or multiple elements or you can define x and y values which stretch a rectangle or polygon
hide String[]
hides all elements queried by all kinds of different WebdriverIO selector strategies (via opacity: 0
)
remove String[]
removes all elements queried by all kinds of different WebdriverIO selector strategies (via display: none
)
wdio-screenshot uses GraphicsMagick for image processing when available. Without GraphicsMagick installed, wdio-screenshot fallbacks to Jimp - a image processing library written in JS.
If you want to install GraphicsMagick, follow the instructions below.
$ brew install graphicsmagick
$ sudo apt-get install graphicsmagick
Download and install executables for GraphicsMagick. Please make sure you install the right binaries desired for your system (32bit vs 64bit).
MIT
1 Scaling of iOS Simulator has to be 100% for properly recorded screenshots (see here)
2 iOS scales the zoom level to fit the website into the viewport when the width of your page is bigger than the viewport. Capturing screenshots of such scaled websites with iOS is experimental and error-prone. If you notice any errors, adjust your viewport settings in your meta tag to disable scaling with <meta name="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
FAQs
Screenshot commands for WebdriverIO
The npm package @chromaui/wdio-screenshot receives a total of 1 weekly downloads. As such, @chromaui/wdio-screenshot popularity was classified as not popular.
We found that @chromaui/wdio-screenshot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.