-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
There are several ways you can add tags to Cypress tests via plugins or custom code.
In the Open Data projects, we see code like:
// index.js
beforeEach(function() {
let testSuite = Cypress.env('SUITE');
if (!testSuite) {
return;
}
const testName = Cypress.mocha.getRunner().test.fullTitle();
testSuite = "<"+testSuite+">"
if (!testName.includes(testSuite)) {
this.skip();
}
})
// test file.
it('User Journey: Filtering PI Reports <pi> <pi-report-filtering>', () => {
Then you can run the suite from the CLI like:
SUITE=pi yarn cypress run
We also have many plugins, but the most popular/official seems to be https://github.com/cypress-io/cypress/tree/develop/npm/grep
There is also https://github.com/infosum/cypress-tags to use for tagging.
There could be more recommended options to check out.
Tasks:
- Look through options and add any missing ones to this issue
- Choose the best-recommended option that will be easiest to use and maintain
- Create an example for tagging in this repo
- Add some kind of note about the example in the docs
Metadata
Metadata
Assignees
Labels
No labels