cypress-each
Advanced tools
Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "cypress-each", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Simple implementation for describe.each and it.each", | ||
@@ -11,3 +11,3 @@ "main": "src", | ||
"scripts": { | ||
"lint": "tsc --pretty --allowJs --noEmit src/index.js cypress/integration/*.js", | ||
"lint": "tsc --pretty --allowJs --strict --noEmit src/index.js cypress/integration/*.js", | ||
"test": "cypress-expect run --expect cypress/expected.json", | ||
@@ -14,0 +14,0 @@ "semantic-release": "semantic-release" |
@@ -1,2 +0,2 @@ | ||
# cypress-each ![cypress version](https://img.shields.io/badge/cypress-8.5.0-brightgreen) | ||
# cypress-each ![cypress version](https://img.shields.io/badge/cypress-8.5.0-brightgreen) [![renovate-app badge][renovate-badge]][renovate-app] | ||
> A demo of mocha-each and custom describe.each and it.each implementation for Cypress | ||
@@ -8,2 +8,36 @@ | ||
## Install and use | ||
``` | ||
# install using NPM | ||
$ npm i -D cypress-each | ||
# install using Yarn | ||
# yarn add -D cypress-each | ||
``` | ||
Import `cypress-each` in a single spec or in Cypress support file | ||
```js | ||
import 'cypress-each' | ||
// now can use describe.each and it.each | ||
``` | ||
Let's create a separate test for each selector from a list | ||
```js | ||
import 'cypress-each' | ||
// create a separate test for each selector | ||
const selectors = ['header', 'footer', '.new-todo'] | ||
it.each(selectors)('element %s is visible', (selector) => { | ||
cy.visit('/') | ||
cy.get(selector).should('be.visible') | ||
}) | ||
``` | ||
## Examples | ||
- Watch [Using cypress-each To Create Separate Tests](https://youtu.be/utPKRV_fL1E) | ||
- Read [Dynamic API Tests Using Cypress-Each Plugin](https://glebbahmutov.com/blog/dynamic-api-tests-using-cypress-each/) | ||
## Specs | ||
@@ -33,2 +67,18 @@ | ||
Include this module with other library types, like | ||
```json | ||
{ | ||
"compilerOptions": { | ||
"types": ["cypress", "cypress-each"], | ||
} | ||
} | ||
``` | ||
Or inside an individual spec file add | ||
```js | ||
/// <reference types="cypress-each" /> | ||
``` | ||
## Small print | ||
@@ -74,1 +124,4 @@ | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg | ||
[renovate-app]: https://renovateapp.com/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7109
125