admin管理员组

文章数量:1287579

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

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

Share Improve this question edited Oct 15, 2019 at 13:58 AngularM asked Oct 15, 2019 at 13:49 AngularMAngularM 16.6k29 gold badges102 silver badges175 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

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' mand, see:cypress-tags.js)

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

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

本文标签: javascriptHow to skip a feature in cypress so that its not tested for end to end testsStack Overflow