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 attributes from cypress-grep tags #152

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

thomaswinkler
Copy link
Contributor

cypress-grep allows tagging and filtering tests. This is an attempt to automatically add tags as attributes for suites and tests. For this to work #141 is required as tests not executed by cypress-grep will be skipped.

When automatically adding attributes from tags, it helps organizing large suites without duplicating tags and attributes. Could potentially also help adding attributes without writing a lot of code to explicitly add via cy.addAttributes.

Added an optional config option addCypressGrepAttributes to disable adding attributes automatically. Name is just a suggestion, could be changed if needed. See test cases as reference.

Sample usage from tags-in-the-test-config-object

it('works as an array', { tags: ['config', 'some-other-tag'] }, () => {
  expect(true).to.be.true
})

it('works as a string', { tags: 'config' }, () => {
  expect(true).to.be.true
})

@thomaswinkler thomaswinkler changed the title Add attributes from cypres-grep tags Add attributes from cypress-grep tags Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant