{"id":24304825,"url":"https://github.com/abramenal/cypress-shadow-dom","last_synced_at":"2025-09-26T09:30:40.029Z","repository":{"id":57211254,"uuid":"188428326","full_name":"abramenal/cypress-shadow-dom","owner":"abramenal","description":"Extend Cypress commands with shadow DOM support","archived":false,"fork":false,"pushed_at":"2021-01-17T19:12:20.000Z","size":184,"stargazers_count":49,"open_issues_count":8,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-29T19:08:02.993Z","etag":null,"topics":["cypress","cypress-io","cypress-plugin","cypress-shadow-dom","cypressio","cypressjs","shadow-dom"],"latest_commit_sha":null,"homepage":"https://npm.im/cypress-shadow-dom","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/abramenal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.paypal.me/abramenal"]}},"created_at":"2019-05-24T13:40:44.000Z","updated_at":"2023-11-02T03:08:27.000Z","dependencies_parsed_at":"2022-09-01T08:21:17.281Z","dependency_job_id":null,"html_url":"https://github.com/abramenal/cypress-shadow-dom","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abramenal%2Fcypress-shadow-dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abramenal%2Fcypress-shadow-dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abramenal%2Fcypress-shadow-dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abramenal%2Fcypress-shadow-dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abramenal","download_url":"https://codeload.github.com/abramenal/cypress-shadow-dom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234300376,"owners_count":18810608,"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":["cypress","cypress-io","cypress-plugin","cypress-shadow-dom","cypressio","cypressjs","shadow-dom"],"created_at":"2025-01-17T01:51:45.996Z","updated_at":"2025-09-26T09:30:34.715Z","avatar_url":"https://github.com/abramenal.png","language":"JavaScript","funding_links":["https://www.paypal.me/abramenal"],"categories":[],"sub_categories":[],"readme":"# (deprecated) cypress-shadow-dom\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/abramenal/cypress-shadow-dom/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/cypress-shadow-dom.svg?style=flat\u0026color=important)](https://www.npmjs.com/package/cypress-shadow-dom) [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors)\n\nExtend Cypress commands with shadow DOM support\n\nThis package adds a custom [Cypress][cypress] command that allows you to make an abstraction on how exactly you upload files through you HTML controls and focus on testing the functionality.\n\nProject reached its dead end because of [recent feature introduced by @43081j](https://github.com/cypress-io/cypress/pull/7469)\n(and reference issue [cypress/issues/144](https://github.com/cypress-io/cypress/issues/144)).\n\nPlease consider using this experimental built-in feature as well as submitting issues and code contributions there.\n\nWarmest thanks for all the contributors that helped this project evolve!\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n  - [shadowGet](#shadowGet)\n  - [shadowFind](#shadowFind)\n  - [shadowEq](#shadowEq)\n  - [shadowFirst](#shadowFirst)\n  - [shadowLast](#shadowLast)\n  - [shadowContains](#shadowContains)\n  - [shadowTrigger](#shadowTrigger)\n  - [shadowClick](#shadowTrigger)\n  - [shadowType](#shadowType)\n- [Contributors](#contributors)\n- [License](#license)\n\n## Installation\n\nThe package is distributed via [npm][npm] should be installed as one of your project's `devDependencies`:\n\n```bash\nnpm install --save-dev cypress-shadow-dom\n```\n\n## Usage\n\n`cypress-shadow-dom` extends Cypress' `cy` command.\nAdd this line to your project's `cypress/support/commands.js`:\n\n```javascript\nimport 'cypress-shadow-dom';\n```\n\nHere is a basic example:\n\n```javascript\ncy.shadowGet('todo-list')\n  .shadowFind('todo-list-item')\n  .its('length')\n  .should('eq', 4);\n```\n\nSee more usage guidelines in [example](./example). It also contains all the available commands in their natural use case.\n\n## API\n\nHere's a set of available commands:\n\n### shadowGet\n\nQuerying shadow DOM elements is made with:\n\n```javascript\ncy.shadowGet(selector, options);\n```\n\n- `{String} selector` – a single selector which usually represents root shadow DOM elements you want to start with\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Number?} timeout` – (optional) time, in milliseconds, to wait until most DOM based commands are considered timed out (defaults to 4000)\n\nThis command returns `shadowSubject` that is a valid subject to execute any command below.\n\n### shadowFind\n\nAdditional querying within found shadow DOM elements:\n\n```javascript\nshadowSubject.shadowFind(selector, options);\n```\n\n- `{String} selector` – a single selector which helps to get nested shadow DOM element under the root element\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Number?} timeout` – (optional) time, in milliseconds, to wait until most DOM based commands are considered timed out (defaults to 4000)\n\nExample:\n\n```javascript\ncy.shadowGet('todo-list').shadowFind('todo-form');\n```\n\nThis command returns `shadowSubject` that is a valid subject to execute any command below.\n\nIn order to set a custom timeout for dynamically loaded elements that appear later than 4 seconds after render, use custom timeout:\n\n```javascript\ncy.shadowGet('todo-list').shadowFind('todo-form', { timeout: 8500 });\n```\n\n### shadowEq\n\nTo take the nth element from found shadow DOM collection:\n\n```javascript\nshadowSubject.shadowEq(index, options);\n```\n\n- `{Number} index` – a positive or negative number within given collection range\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Number?} timeout` – (optional) time, in milliseconds, to wait until most DOM based commands are considered timed out (defaults to 4000)\n\n### shadowFirst\n\nTo take the first element from found shadow DOM collection:\n\n```javascript\nshadowSubject.shadowFirst(options);\n```\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Number?} timeout` – (optional) time, in milliseconds, to wait until most DOM based commands are considered timed out (defaults to 4000)\n\nSo, simply:\n\n```javascript\ncy.shadowGet('todo-list')\n  .shadowFind('todo-form')\n  .shadowFirst();\n```\n\n### shadowLast\n\nTo take the last element from found shadow DOM collection:\n\n```javascript\nshadowSubject.shadowLast(options);\n```\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Number?} timeout` – (optional) time, in milliseconds, to wait until most DOM based commands are considered timed out (defaults to 4000)\n\n### shadowContains\n\nTo validate some element's text content:\n\n```javascript\nshadowSubject.shadowContains(content, options);\n```\n\n- `{String} content` – a string containing any text for lookup\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Number?} timeout` – (optional) time, in milliseconds, to wait until most DOM based commands are considered timed out (defaults to 4000)\n\n### shadowTrigger\n\nTo trigger any event:\n\n```javascript\nshadowSubject.shadowTrigger(eventName, options);\n```\n\n- `{String} eventName` – a string containing any text for lookup\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Boolean?} force`\n  - `{Boolean?} bubbles`\n  - `{Boolean?} cancelable`\n  - `{Boolean?} composed`\n\n### shadowClick\n\nA shorthand to trigger a click event:\n\n```javascript\nshadowSubject.shadowClick(options);\n```\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Boolean?} force`\n  - `{Boolean?} bubbles`\n  - `{Boolean?} cancelable`\n  - `{Boolean?} composed`\n\n### shadowType\n\nTypes some text content inside given shadow DOM input control:\n\n```javascript\nshadowSubject.shadowType(content, options);\n```\n\n- `{String} content` – a string containing any text\n\n- `{Object?} options` – (optional) contains following properties:\n\n  - `{Number?} delay` – (optional) time, in milliseconds, between adding each letter/char (defaults to 10)\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://tstechnologies.com.vn/\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/37669424?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003etst\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/abramenal/cypress-shadow-dom/issues?q=author%3Asangmai350\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://joshuadelange.com\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/525349?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJoshua de Lange\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/abramenal/cypress-shadow-dom/issues?q=author%3Ajoshuadelange\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/culas\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/8446762?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLucas Schnüriger\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/abramenal/cypress-shadow-dom/commits?author=culas\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/mandric\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/25641?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMilan Andric\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/abramenal/cypress-shadow-dom/commits?author=mandric\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#ideas-mandric\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/DesignByOnyx\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/514040?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRyan Wheale\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-DesignByOnyx\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/abramenal/cypress-shadow-dom/commits?author=DesignByOnyx\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## License\n\n[MIT][mit]\n\n[cypress]: https://cypress.io/\n[npm]: https://www.npmjs.com/\n[mit]: https://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabramenal%2Fcypress-shadow-dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabramenal%2Fcypress-shadow-dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabramenal%2Fcypress-shadow-dom/lists"}