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

Viewed 7734

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

Tech: Angular 8 with cypress versions:

  • "cypress": "^3.4.1"
  • "cypress-cucumber-preprocessor": "^1.16.2"
  • "cypress-pipe": "^1.4.0"

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

1 Answers

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

Related