{"id":24244425,"url":"https://github.com/zinserjan/wdio-screenshot","last_synced_at":"2025-04-06T22:10:38.563Z","repository":{"id":52656256,"uuid":"59510275","full_name":"zinserjan/wdio-screenshot","owner":"zinserjan","description":" A WebdriverIO plugin. Additional commands for taking screenshots with WebdriverIO.","archived":false,"fork":false,"pushed_at":"2021-04-22T03:51:38.000Z","size":2281,"stargazers_count":108,"open_issues_count":24,"forks_count":43,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-05-02T23:24:36.754Z","etag":null,"topics":["automation","screenshot","selenium","webdriverio","webdriverio-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zinserjan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-23T18:57:05.000Z","updated_at":"2023-06-15T12:53:12.000Z","dependencies_parsed_at":"2022-08-20T21:40:41.894Z","dependency_job_id":null,"html_url":"https://github.com/zinserjan/wdio-screenshot","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zinserjan%2Fwdio-screenshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zinserjan%2Fwdio-screenshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zinserjan%2Fwdio-screenshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zinserjan%2Fwdio-screenshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zinserjan","download_url":"https://codeload.github.com/zinserjan/wdio-screenshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","screenshot","selenium","webdriverio","webdriverio-plugin"],"created_at":"2025-01-14T22:19:22.320Z","updated_at":"2025-04-06T22:10:38.527Z","avatar_url":"https://github.com/zinserjan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wdio-screenshot\n\u003e A WebdriverIO plugin. Additional commands for taking screenshots with WebdriverIO.\n\n[![Build Status][build-badge]][build] [![Build Status Windows][build-windows-badge]][build-windows] [![npm package][npm-badge]][npm]\n\n\n## Browser Support\n[![Build Status](https://saucelabs.com/open_sauce/build_matrix/zinserjan.svg)](https://saucelabs.com/u/zinserjan)\n- Firefox\n- Chrome\n- Internet Explorer\n- Safari\n- iOS\u003csup\u003e[1](#footnote1)\u003c/sup\u003e \u003csup\u003e[2](#footnote2)\u003c/sup\u003e\n\n## Installation\n\n\nInstall wdio-screenshot via NPM as usual:\n\n```sh\n$ npm install wdio-screenshot --save-dev\n```\n\n\nInstructions on how to install `WebdriverIO` can be found [here.](http://webdriver.io/guide/getstarted/install.html)\n\nNote: If you want to improve performance, you can [install GraphicsMagick](#use-graphicsmagick).\n\n## Configuration\nSetup wdio-screenshot by adding a `wdio-screenshot` key to the plugins section of your WebdriverIO config.\n\n```js\n// wdio.conf.js\nexports.config = {\n  // ...\n  plugins: {\n    'wdio-screenshot': {}\n  },\n  // ...\n};\n```\n\n\n## Usage\nwdio-screenshot enhances an WebdriverIO instance with the following commands:\n\n* `browser.saveViewportScreenshot([fileName], [{options}]);`\n* `browser.saveDocumentScreenshot([fileName], [{options}]);`\n* `browser.saveElementScreenshot([fileName], elementSelector, [{options}]);`\n\n\nAll of these provide options that will help you to exclude unrelevant parts (e.g. content). The following options are\navailable:\n\n\n* **exclude** `String[]|Object[]` (**not yet implemented**)\u003cbr\u003e\n  exclude frequently changing parts of your screenshot, you can either pass all kinds of different [WebdriverIO selector strategies](http://webdriver.io/guide/usage/selectors.html)\n  that queries one or multiple elements or you can define x and y values which stretch a rectangle or polygon\n\n* **hide** `String[]`\u003cbr\u003e\n  hides all elements queried by all kinds of different [WebdriverIO selector strategies](http://webdriver.io/guide/usage/selectors.html) (via `opacity: 0`)\n\n* **remove** `String[]`\u003cbr\u003e\n  removes all elements queried by all kinds of different [WebdriverIO selector strategies](http://webdriver.io/guide/usage/selectors.html) (via `display: none`)\n\n## Use GraphicsMagick\nwdio-screenshot uses [GraphicsMagick](http://www.graphicsmagick.org/) for image processing when available. Without GraphicsMagick installed, wdio-screenshot fallbacks to [Jimp](https://github.com/oliver-moran/jimp) - a image processing library written in JS.\n\nIf you want to install GraphicsMagick, follow the instructions below.\n\n#### Mac OS X using [Homebrew](http://mxcl.github.io/homebrew/)\n```sh\n$ brew install graphicsmagick\n```\n\n#### Ubuntu using apt-get\n```sh\n$ sudo apt-get install graphicsmagick\n```\n\n#### Windows\n\nDownload and install executables for [GraphicsMagick](http://www.graphicsmagick.org/download.html).\nPlease make sure you install the right binaries desired for your system (32bit vs 64bit).\n\n\n### License\n\nMIT\n\n---\n\n\u003csup\u003e\u003ca name=\"footnote1\"\u003e1\u003c/a\u003e\u003c/sup\u003e Scaling of iOS Simulator has to be 100% for properly recorded screenshots (see [here](https://discuss.appium.io/t/ios-screenshot-not-complete-with-appium-1-4-13/7126))\n\n\u003csup\u003e\u003ca name=\"footnote2\"\u003e2\u003c/a\u003e\u003c/sup\u003e 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 `\u003cmeta name=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\"\u003e`\n\n\n[build-badge]: https://travis-ci.org/zinserjan/wdio-screenshot.svg?branch=master\n[build]: https://travis-ci.org/zinserjan/wdio-screenshot\n[build-windows-badge]: https://ci.appveyor.com/api/projects/status/ef8r3rjiydld171i/branch/master?svg=true\n[build-windows]: https://ci.appveyor.com/project/zinserjan/wdio-screenshot\n[npm-badge]: https://img.shields.io/npm/v/wdio-screenshot.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/wdio-screenshot\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzinserjan%2Fwdio-screenshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzinserjan%2Fwdio-screenshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzinserjan%2Fwdio-screenshot/lists"}