forked from Klaveness-Digital/cypress-cucumber-preprocessor
-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'badeball:master' into master
- Loading branch information
Showing
29 changed files
with
1,180 additions
and
311 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
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 was deleted.
Oops, something went wrong.
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,68 @@ | ||
Feature: attachments | ||
|
||
Background: | ||
Given additional preprocessor configuration | ||
""" | ||
{ | ||
"json": { | ||
"enabled": true | ||
} | ||
} | ||
""" | ||
|
||
Rule: it should support a variety of options | ||
|
||
Scenario: string identity | ||
Given a file named "cypress/e2e/a.feature" with: | ||
""" | ||
Feature: a feature | ||
Scenario: a scenario | ||
Given a step | ||
""" | ||
And a file named "cypress/support/step_definitions/steps.js" with: | ||
""" | ||
const { Given, attach } = require("@badeball/cypress-cucumber-preprocessor"); | ||
Given("a step", function() { | ||
attach("foobar") | ||
}) | ||
""" | ||
When I run cypress | ||
Then it passes | ||
And there should be a JSON output similar to "fixtures/attachments/string.json" | ||
|
||
Scenario: array buffer | ||
Given a file named "cypress/e2e/a.feature" with: | ||
""" | ||
Feature: a feature | ||
Scenario: a scenario | ||
Given a step | ||
""" | ||
And a file named "cypress/support/step_definitions/steps.js" with: | ||
""" | ||
const { Given, attach } = require("@badeball/cypress-cucumber-preprocessor"); | ||
Given("a step", function() { | ||
attach(new TextEncoder().encode("foobar").buffer, "text/plain") | ||
}) | ||
""" | ||
When I run cypress | ||
Then it passes | ||
And there should be a JSON output similar to "fixtures/attachments/string.json" | ||
|
||
Scenario: string encoded | ||
Given a file named "cypress/e2e/a.feature" with: | ||
""" | ||
Feature: a feature | ||
Scenario: a scenario | ||
Given a step | ||
""" | ||
And a file named "cypress/support/step_definitions/steps.js" with: | ||
""" | ||
const { fromByteArray } = require("base64-js"); | ||
const { Given, attach } = require("@badeball/cypress-cucumber-preprocessor"); | ||
Given("a step", function() { | ||
attach(fromByteArray(new TextEncoder().encode("foobar")), "base64:text/plain") | ||
}) | ||
""" | ||
When I run cypress | ||
Then it passes | ||
And there should be a JSON output similar to "fixtures/attachments/string.json" |
Oops, something went wrong.