AngularM
AngularM

Reputation: 16648

How to skip a feature in cypress so that its not tested for end to end tests

How to skip a feature in cypress so that its not tested for end to end tests

Tech: Angular 8 with cypress versions:

I'm using cypress with its test runner (./node_modules/.bin/cypress open).

I'm having trouble skipping a test. I understand how to @focus on a feature like so:

Feature: App is alive
  checking data

  @focus
  Scenario: Read list of data
    Given I open up the page
    Then I see more than one row of data

I've tried changing @focus to @skip and @skipped but didnt work

Upvotes: 7

Views: 14926

Answers (1)

ReturnEnd
ReturnEnd

Reputation: 81

Sure you can use tags :

Feature: My very feature

  @ignore-this
  Scenario: I don't want to run
    Given I open up the page
    Then I see more than one row of data

  Scenario: I want to run
    Given I open up the page
    Then I see more than one row of data

Then run Cypress and setting env TAGS accordingly:

./node_modules/.bin/cypress open -e "TAGS=not @ignore-this"

If you want an entire feature to be ignored when using cypress run, you can use cucumber tags wrapper (it won't work with 'open' command, see:cypress-tags.js)

./node_modules/.bin/cypress-tags run -e TAGS='not @ignore'

References: - https://github.com/TheBrainFamily/cypress-cucumber-example#tags-usage

Upvotes: 8

Related Questions