Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support attachments, also known as embeddings #189

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
591 changes: 591 additions & 0 deletions features/attachments.feature

Large diffs are not rendered by default.

69 changes: 52 additions & 17 deletions features/cli.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ Feature: Command line interface
module.exports = cucumberSteps;
"""
When I run `cucumber.js features/a.feature`
Then it should pass with:
Then it outputs this text:
"""
.

1 scenario (1 passed)
1 step (1 passed)

"""
And the exit status should be 0

Scenario: run a single scenario within feature
Given a file named "features/a.feature" with:
Expand All @@ -45,15 +46,15 @@ Feature: Command line interface
module.exports = cucumberSteps;
"""
When I run `cucumber.js features/a.feature:2`
Then it should pass with:
Then it outputs this text:
"""
.

1 scenario (1 passed)
1 step (1 passed)

"""

And the exit status should be 0

Scenario: run a single feature without step definitions
Given a file named "features/a.feature" with:
Expand All @@ -63,14 +64,21 @@ Feature: Command line interface
When a step is undefined
"""
When I run `cucumber.js features/a.feature`
Then it should pass with:
Then it outputs this text:
"""
U

1 scenario (1 undefined)
1 step (1 undefined)

You can implement step definitions for undefined steps with these snippets:

this.When(/^a step is undefined$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback.pending();
});
"""
And the exit status should be 0

Scenario: run feature with non-default step definitions file location specified (-r option)
Given a file named "features/a.feature" with:
Expand All @@ -87,14 +95,15 @@ Feature: Command line interface
module.exports = cucumberSteps;
"""
When I run `cucumber.js features/a.feature -r step_definitions/cucumber_steps.js`
Then it should pass with:
Then it outputs this text:
"""
.

1 scenario (1 passed)
1 step (1 passed)

"""
And the exit status should be 0

Scenario: run feature with step definitions in required directory (-r option)
Given a file named "features/a.feature" with:
Expand All @@ -111,26 +120,30 @@ Feature: Command line interface
module.exports = cucumberSteps;
"""
When I run `cucumber.js features/a.feature -r step_definitions`
Then it should pass with:
Then it outputs this text:
"""
.

1 scenario (1 passed)
1 step (1 passed)

"""
And the exit status should be 0

Scenario: display Cucumber version
When I run `cucumber.js --version`
Then I see the version of Cucumber
And the exit status should be 0

Scenario: display help
When I run `cucumber.js --help`
Then I see the help of Cucumber
And the exit status should be 0

Scenario: display help (short flag)
When I run `cucumber.js -h`
Then I see the help of Cucumber
And the exit status should be 0

Scenario: run a single failing feature
Given a file named "features/a.feature" with:
Expand All @@ -147,14 +160,21 @@ Scenario: run a single failing feature
module.exports = cucumberSteps;
"""
When I run `cucumber.js features/a.feature`
Then it should fail with:
Then it outputs this text:
"""
F

(::) failed steps (::)

forced error

Failing scenarios:
<current-directory>/features/a.feature:2 # Scenario:

1 scenario (1 failed)
1 step (1 failed)

"""
And it should exit with code "1"

And the exit status should be 1

Scenario: run a single failing feature with an empty hooks file
Given a file named "features/a.feature" with:
Expand All @@ -174,14 +194,21 @@ Scenario: run a single failing feature
"""
"""
When I run `cucumber.js features/a.feature`
Then it should fail with:
Then it outputs this text:
"""
F

(::) failed steps (::)

forced error

Failing scenarios:
<current-directory>/features/a.feature:2 # Scenario:

1 scenario (1 failed)
1 step (1 failed)

"""
And it should exit with code "1"

And the exit status should be 1

Scenario: run a single failing feature with an AfterFeatures hook
Given a file named "features/a.feature" with:
Expand All @@ -207,10 +234,18 @@ Scenario: run a single failing feature
module.exports = hooks;
"""
When I run `cucumber.js features/a.feature`
Then it should fail with:
Then it outputs this text:
"""
F

(::) failed steps (::)

forced error

Failing scenarios:
<current-directory>/features/a.feature:2 # Scenario:

1 scenario (1 failed)
1 step (1 failed)

"""
And it should exit with code "1"
And the exit status should be 1
Loading