forked from Klaveness-Digital/cypress-cucumber-preprocessor
-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'suite-level-test-configuration-mallison'
- Loading branch information
Showing
6 changed files
with
259 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
@cypress>=12 | ||
Feature: suite only options | ||
Scenario: Configuring testIsolation on a Feature | ||
Given additional Cypress configuration | ||
""" | ||
{ | ||
"e2e": { | ||
"testIsolation": true | ||
} | ||
} | ||
""" | ||
And a file named "cypress/e2e/a.feature" with: | ||
""" | ||
@testIsolation(false) | ||
Feature: a feature | ||
Scenario: a scenario | ||
Given a step | ||
Scenario: another scenario | ||
Then another step | ||
""" | ||
And a file named "cypress/support/step_definitions/steps.js" with: | ||
""" | ||
const { Given, Then } = require("@badeball/cypress-cucumber-preprocessor"); | ||
Given("a step", () => { | ||
cy.get("body").invoke('html', 'Hello world') | ||
}); | ||
Given("another step", () => { | ||
cy.contains("Hello world").should("exist"); | ||
}); | ||
""" | ||
When I run cypress | ||
Then it passes | ||
|
||
Scenario: Configuring testIsolation on a Rule | ||
Given additional Cypress configuration | ||
""" | ||
{ | ||
"e2e": { | ||
"testIsolation": true | ||
} | ||
} | ||
""" | ||
And a file named "cypress/e2e/a.feature" with: | ||
""" | ||
Feature: a feature | ||
@testIsolation(false) | ||
Rule: a rule | ||
Scenario: a scenario | ||
Given a step | ||
Scenario: another scenario | ||
Then another step | ||
""" | ||
And a file named "cypress/support/step_definitions/steps.js" with: | ||
""" | ||
const { Given, Then } = require("@badeball/cypress-cucumber-preprocessor"); | ||
Given("a step", () => { | ||
cy.get("body").invoke('html', 'Hello world') | ||
}); | ||
Given("another step", () => { | ||
cy.contains("Hello world").should("exist"); | ||
}); | ||
""" | ||
When I run cypress | ||
Then it passes | ||
|
||
Scenario: Configuring testIsolation on a Scenario fails | ||
Given additional Cypress configuration | ||
""" | ||
{ | ||
"e2e": { | ||
"testIsolation": true | ||
} | ||
} | ||
""" | ||
And a file named "cypress/e2e/a.feature" with: | ||
""" | ||
Feature: a feature | ||
@testIsolation(false) | ||
Scenario: a scenario | ||
Given a step | ||
""" | ||
And a file named "cypress/support/step_definitions/steps.js" with: | ||
""" | ||
const { Given, Then } = require("@badeball/cypress-cucumber-preprocessor"); | ||
Given("a step", () => { | ||
cy.get("body").invoke('html', 'Hello world') | ||
}); | ||
""" | ||
When I run cypress | ||
Then it fails | ||
And the output should contain | ||
""" | ||
Tag @testIsolation(false) can only be used on a Feature or a Rule | ||
""" | ||
|
||
Scenario: Configuring testIsolation on a Scenario Outline fails | ||
Given additional Cypress configuration | ||
""" | ||
{ | ||
"e2e": { | ||
"testIsolation": true | ||
} | ||
} | ||
""" | ||
And a file named "cypress/e2e/a.feature" with: | ||
""" | ||
Feature: a feature | ||
@testIsolation(false) | ||
Scenario Outline: a scenario | ||
Given a step | ||
Examples: | ||
| foo | | ||
| bar | | ||
""" | ||
And a file named "cypress/support/step_definitions/steps.js" with: | ||
""" | ||
const { Given, Then } = require("@badeball/cypress-cucumber-preprocessor"); | ||
Given("a step", () => { | ||
cy.get("body").invoke('html', 'Hello world') | ||
}); | ||
""" | ||
When I run cypress | ||
Then it fails | ||
And the output should contain | ||
""" | ||
Tag @testIsolation(false) can only be used on a Feature or a Rule | ||
""" | ||
|
||
Scenario: Configuring testIsolation on Examples fails | ||
Given additional Cypress configuration | ||
""" | ||
{ | ||
"e2e": { | ||
"testIsolation": true | ||
} | ||
} | ||
""" | ||
And a file named "cypress/e2e/a.feature" with: | ||
""" | ||
Feature: a feature | ||
Scenario Outline: a scenario | ||
Given a step | ||
@testIsolation(false) | ||
Examples: | ||
| foo | | ||
| bar | | ||
""" | ||
And a file named "cypress/support/step_definitions/steps.js" with: | ||
""" | ||
const { Given, Then } = require("@badeball/cypress-cucumber-preprocessor"); | ||
Given("a step", () => { | ||
cy.get("body").invoke('html', 'Hello world') | ||
}); | ||
""" | ||
When I run cypress | ||
Then it fails | ||
And the output should contain | ||
""" | ||
Tag @testIsolation(false) can only be used on a Feature or a Rule | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters