-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
format: add support for gherkin rule/example syntax #1273
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
Merged
Merged
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
98144db
add basic feature for gherkin rule/example support
davidjgoss abf231a
use require instead of import
davidjgoss 0667c1c
assert on formatter output for passing example
davidjgoss 6b6e358
add formatters.feature scenario for rejected pickle from rule
davidjgoss 71b9f9c
add formatters.feature scenario for passed from rule
davidjgoss 9d95da3
add editorconfig for indentation control
davidjgoss f16beb8
formatting
davidjgoss 3fd434d
make `getGherkinStepMap` rule-aware
davidjgoss 6803785
restructure tests a bit
davidjgoss e792139
refactor tests a bit more, add some to cover getGherkinScenarioMap
davidjgoss 76dc3dd
account for Rule in getGherkinScenarioMap
davidjgoss b409242
rework getGherkinScenarioLocationMap to handle Rule
davidjgoss df5478c
add unit test for Rule/Example in json formatter
davidjgoss 46ecf05
report keyword as Scenario or Example correctly from scenario map
davidjgoss 3a654fe
include rule name in concatenated scenario id for json formatter
davidjgoss 79c1de7
make sure we work with a background within a rule
davidjgoss 587af39
readability
davidjgoss 1cbe83d
add background usage to rule feature, assert on failure output
davidjgoss 8428a77
add acceptance test for message and json format on failure from rule
davidjgoss b8fd4eb
add a bit of coverage for the progress bar formatter
davidjgoss 431d883
more on progress far - numbers/time reporting at end
davidjgoss b18d1a5
work rule usage into progress formatter spec
davidjgoss 7e578bd
work rule usage into rerun formatter spec
davidjgoss de762ea
work rule usage into summary formatter spec
davidjgoss 4e70e74
add coverage for pickle filtering on name
davidjgoss 38dcdd6
changelog update
davidjgoss 733b2a0
rework progress formatter spec to have a seperate case for rule/example
davidjgoss c66d7c3
remove negative test for rule/example in json formatter
davidjgoss d486330
rework gherkin document parser spec to avoid replication of structure
davidjgoss 7ab8a0f
merge from master
davidjgoss c5a08fd
fix some lint
davidjgoss 672647b
fix line numbers in formatter unit tests
davidjgoss b3f5afa
Merge branch 'master' into rule-example-support
davidjgoss 9279c86
fix dodgy import
davidjgoss a161eba
fix overqualified references to messages interfaces
davidjgoss 733f8f9
remove unnecessary tags
davidjgoss 3bdc7d7
for progress bar formatter, break out new test for rule/example, reta…
davidjgoss beb1d57
split out new test for rule/example in rerun formatter spec
davidjgoss 9f7f7c4
remove superfluous formatter tests
davidjgoss 61e6c31
fix up changelog
davidjgoss cea78fc
fix whitespace
davidjgoss d8c3723
restore original names where qualifiers no longer needed
davidjgoss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,9 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# 4 space indentation | ||
[*] | ||
indent_style = space | ||
indent_size = 2 |
This file contains hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
This file contains hidden or 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,37 @@ | ||
module.exports = [ | ||
{ | ||
description: '', | ||
elements: [ | ||
{ | ||
description: '', | ||
id: 'a-feature;a-rule;an-example', | ||
keyword: 'Example', | ||
line: 3, | ||
name: 'an example', | ||
steps: [ | ||
{ | ||
arguments: [], | ||
keyword: 'Given ', | ||
line: 4, | ||
match: { | ||
location: 'features/step_definitions/steps.js:3', | ||
}, | ||
name: 'a step', | ||
result: { | ||
duration: 0, | ||
status: 'passed', | ||
}, | ||
}, | ||
], | ||
tags: [], | ||
type: 'scenario', | ||
}, | ||
], | ||
id: 'a-feature', | ||
keyword: 'Feature', | ||
line: 1, | ||
name: 'a feature', | ||
tags: [], | ||
uri: 'features/a.feature', | ||
}, | ||
] |
143 changes: 143 additions & 0 deletions
143
features/fixtures/formatters/passed-rule.message.json.ts
This file contains hidden or 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,143 @@ | ||
module.exports = [ | ||
{ | ||
source: { | ||
uri: 'features/a.feature', | ||
data: | ||
'Feature: a feature\n Rule: a rule\n Example: an example\n Given a step', | ||
media: { | ||
encoding: 'UTF8', | ||
contentType: 'text/x.cucumber.gherkin+plain', | ||
}, | ||
}, | ||
}, | ||
{ | ||
gherkinDocument: { | ||
uri: 'features/a.feature', | ||
feature: { | ||
location: { | ||
line: 1, | ||
column: 1, | ||
}, | ||
language: 'en', | ||
keyword: 'Feature', | ||
name: 'a feature', | ||
children: [ | ||
{ | ||
rule: { | ||
location: { | ||
line: 2, | ||
column: 3, | ||
}, | ||
keyword: 'Rule', | ||
name: 'a rule', | ||
children: [ | ||
{ | ||
scenario: { | ||
location: { | ||
line: 3, | ||
column: 5, | ||
}, | ||
keyword: 'Example', | ||
name: 'an example', | ||
steps: [ | ||
{ | ||
location: { | ||
line: 4, | ||
column: 7, | ||
}, | ||
keyword: 'Given ', | ||
text: 'a step', | ||
id: '1', | ||
}, | ||
], | ||
id: '2', | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
{ | ||
pickle: { | ||
id: '4', | ||
uri: 'features/a.feature', | ||
name: 'an example', | ||
language: 'en', | ||
steps: [ | ||
{ | ||
text: 'a step', | ||
id: '3', | ||
astNodeIds: ['1'], | ||
}, | ||
], | ||
astNodeIds: ['2'], | ||
}, | ||
}, | ||
{ | ||
pickleAccepted: { | ||
pickleId: '4', | ||
}, | ||
}, | ||
{ | ||
testRunStarted: {}, | ||
}, | ||
{ | ||
testCase: { | ||
id: '5', | ||
pickleId: '4', | ||
testSteps: [ | ||
{ | ||
id: '6', | ||
pickleStepId: '3', | ||
stepDefinitionIds: ['0'], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
testCaseStarted: { | ||
attempt: 0, | ||
testCaseId: '5', | ||
id: '7', | ||
}, | ||
}, | ||
{ | ||
testStepStarted: { | ||
testStepId: '6', | ||
testCaseStartedId: '7', | ||
}, | ||
}, | ||
{ | ||
testStepFinished: { | ||
testResult: { | ||
status: 'PASSED', | ||
duration: { | ||
seconds: '0', | ||
nanos: 0, | ||
}, | ||
}, | ||
testStepId: '6', | ||
testCaseStartedId: '7', | ||
}, | ||
}, | ||
{ | ||
testCaseFinished: { | ||
testResult: { | ||
status: 'PASSED', | ||
duration: { | ||
seconds: '0', | ||
nanos: 0, | ||
}, | ||
}, | ||
testCaseStartedId: '7', | ||
}, | ||
}, | ||
{ | ||
testRunFinished: { | ||
success: true, | ||
}, | ||
}, | ||
] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.