Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add readme for running tests based on tags #50

Merged
merged 1 commit into from
May 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,13 @@ You then can add the token to `cypress.env.json` as an environment variable:
{
"MAGENTO2_ADMIN_TOKEN": "token_goes_here"
}

```

Or you can set it in your CI/CD variables by prefixing the environment variable name with `CYPRESS_`: `CYPRESS_MAGENTO2_ADMIN_TOKEN: <token_goes_here>`.

### Tags

We use [tags](https://github.com/annaet/cypress-tags).to discern between hot tests and cold tests. You need to install the 3rd party tag support package. Following the [setup](https://github.com/annaet/cypress-tags#setup) for that package, you need to add it to the `plugins/index.js` and `support/index.d.ts`.
We use [tags](https://github.com/annaet/cypress-tags) to discern between hot tests and cold tests. You need to install the 3rd party tag support package. Following the [setup](https://github.com/annaet/cypress-tags#setup) for that package, you need to add it to the `plugins/index.js` and `support/index.d.ts`.

```bash
npm install cypress-tags typescript --save-dev
Expand All @@ -213,12 +212,18 @@ npx cypress run
# npx cypress open # if you want to use the GUI
```

Individual specs can be run using the following [command](https://docs.cypress.io/guides/guides/command-line#Commands)
Individual specs can be run using the following [command](https://docs.cypress.io/guides/guides/command-line#Commands):

```bash
npx cypress run --spec ./cypress/integration/path/to/some.spec.js
```

Hot and cold tests based on tags can be run using the following command:

```bash
CYPRESS_INCLUDE_TAGS=hot npx cypress run
```

### Running against local environment

Set up your local URL in `cypress/plugins/index.js`. Then run Cypress with `NODE_ENV=develop; npx cypress run`.
Expand Down