agent-js-cypress icon indicating copy to clipboard operation
agent-js-cypress copied to clipboard

Add attributes from cypress-grep tags

Open thomaswinkler opened this issue 2 years ago • 0 comments

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 avatar Jan 20 '23 08:01 thomaswinkler