-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
2,397 additions
and
1,475 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"titleBar.activeBackground": "#38224c", | ||
"titleBar.inactiveBackground": "#38224c99", | ||
"titleBar.activeForeground": "#e7e7e7", | ||
"titleBar.inactiveForeground": "#e7e7e799" | ||
"activityBar.background": "#52326f", | ||
"activityBar.foreground": "#e7e7e7", | ||
"activityBar.inactiveForeground": "#e7e7e799", | ||
"activityBarBadge.background": "#000000", | ||
"activityBarBadge.foreground": "#e7e7e7", | ||
"titleBar.activeBackground": "#38224c", | ||
"titleBar.inactiveBackground": "#38224c99", | ||
"titleBar.activeForeground": "#e7e7e7", | ||
"titleBar.inactiveForeground": "#e7e7e799", | ||
"statusBar.background": "#38224c", | ||
"statusBarItem.hoverBackground": "#52326f", | ||
"statusBar.foreground": "#e7e7e7" | ||
}, | ||
"python.linting.pylintEnabled": true | ||
} | ||
"python.linting.pylintEnabled": true, | ||
"cucumberautocomplete.steps": [ | ||
"e2e/step_definitions/**/*.ts" | ||
], | ||
"cucumberautocomplete.syncfeatures": "e2e/features/**/*.feature", | ||
"cucumberautocomplete.strictGherkinCompletion": true, | ||
"cucumberautocomplete.smartSnippets": true, | ||
"cucumberautocomplete.stepsInvariants": true, | ||
"cucumberautocomplete.onTypeFormat": true, | ||
"cucumberautocomplete.gherkinDefinitionPart": "(Given|When|Then)\\(", | ||
"peacock.color": "#38224c" | ||
} |
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,8 @@ | ||
var common = [ | ||
'--require ./e2e/step_definitions/**/*.steps.js', | ||
'--format json:./reports/cucumber-report.json', | ||
].join(' '); | ||
|
||
module.exports = { | ||
default: common, | ||
}; |
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,52 @@ | ||
Ability: View report summary | ||
|
||
As a user | ||
I would like to see the summary of features and scenarios in my project | ||
So that I can gauge my project's health and progress. | ||
|
||
The status of a Scenario behaves like a hierarchy that rolls up. | ||
The scenario status will be the 'worst' status of its child steps as follows: | ||
ambiguous, failed, undefined, pending, passed | ||
Although a step can be skipped, a scneario cannot. | ||
|
||
Ambiguous is the worst because it is similar to a compile erorr. There are | ||
two or more implementations that match one step, and the test simply can't be run. | ||
|
||
Failed is next because a step has been implemented, and failed, which is unexpected. | ||
|
||
Undefined is then next, because no implementation has been put together. | ||
|
||
Pending is where the implementation exists, but returns the string pending. | ||
|
||
Finally, if all steps pass, then the scenario passes. | ||
|
||
Scenario: All passing | ||
Given a passing scenario | ||
| Feature | Scenario | Step | Step Status | | ||
| Feature One | Scenario One | Step 1 | passed | | ||
| Feature One | Scenario One | Step 2 | passed | | ||
| Feature One | Scenario One | Step 3 | passed | | ||
When I run yachr against it | ||
Then a summary showing one passing feature and one passing scenario | ||
|
||
Scenario: Handle mixed states | ||
Given the following scenarios | ||
| Feature | Scenario | Step | Step Status | | ||
| Feature One | Scenario One | Step 1 | passed | | ||
| Feature One | Scenario One | Step 2 | ambiguous | | ||
|
||
| Feature Two | Scenario One | Step 1 | passed | | ||
| Feature Two | Scenario One | Step 2 | failed | | ||
|
||
| Feature Three | Scenario One | Step 1 | passed | | ||
| Feature Three | Scenario One | Step 2 | pending | | ||
|
||
| Feature Four | Scenario One | Step 1 | undefined | | ||
|
||
When I run yachr against it | ||
Then I will see the following in the summary | ||
| Feature | Status | | ||
| Feature One | ambiguous | | ||
| Feature Two | failed | | ||
| Feature three | pending | | ||
| Feature four | undefined | |
Empty file.
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,72 @@ | ||
[ | ||
{ | ||
"description": "Feature One", | ||
"keyword": "Ability", | ||
"name": "View report summary", | ||
"id": "view-report-summary", | ||
"tags": [], | ||
"elements": [ | ||
{ | ||
"id": "view-report-summary;feature-summary", | ||
"keyword": "Scenario", | ||
"line": 7, | ||
"name": "Feature summary", | ||
"tags": [], | ||
"type": "scenario", | ||
"steps": [ | ||
{ | ||
"arguments": [], | ||
"keyword": "Given ", | ||
"result": { | ||
"status": "passed", | ||
"duration": 1000000 | ||
} | ||
}, | ||
{ | ||
"arguments": [], | ||
"keyword": "Then", | ||
"result": { | ||
"status": "ambigious", | ||
"duration": 1000000 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "Feature Two", | ||
"keyword": "Ability", | ||
"name": "View report summary", | ||
"id": "view-report-summary", | ||
"tags": [], | ||
"elements": [ | ||
{ | ||
"id": "view-report-summary;feature-summary", | ||
"keyword": "Scenario", | ||
"line": 7, | ||
"name": "Feature summary", | ||
"tags": [], | ||
"type": "scenario", | ||
"steps": [ | ||
{ | ||
"arguments": [], | ||
"keyword": "Given ", | ||
"result": { | ||
"status": "passed", | ||
"duration": 1000000 | ||
} | ||
}, | ||
{ | ||
"arguments": [], | ||
"keyword": "Then", | ||
"result": { | ||
"status": "failed", | ||
"duration": 1000000 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
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,98 @@ | ||
[ | ||
{ | ||
"description": " As a user\n I would like to see the summary of features and scenarios in my project\n So that I can gauge my project's health and progress.", | ||
"keyword": "Ability", | ||
"name": "View report summary", | ||
"line": 1, | ||
"id": "view-report-summary", | ||
"tags": [], | ||
"uri": "e2e\\features\\abilities\\user\\view-report-summary.feature", | ||
"elements": [ | ||
{ | ||
"id": "view-report-summary;feature-summary", | ||
"keyword": "Scenario", | ||
"line": 7, | ||
"name": "Feature summary", | ||
"tags": [], | ||
"type": "scenario", | ||
"steps": [ | ||
{ | ||
"arguments": [ | ||
{ | ||
"rows": [ | ||
{ | ||
"cells": [ | ||
"Feature", | ||
"Scenario", | ||
"Step", | ||
"Step Status" | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
"Feature One", | ||
"Scenario One", | ||
"Step 1", | ||
"passed" | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
"Feature One", | ||
"Scenario One", | ||
"Step 2", | ||
"passed" | ||
] | ||
}, | ||
{ | ||
"cells": [ | ||
"Feature One", | ||
"Scenario One", | ||
"Step 3", | ||
"passed" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"keyword": "Given ", | ||
"line": 8, | ||
"name": "a passing step", | ||
"match": { | ||
"location": "e2e\\step_definitions\\view-report-summary.steps.js:4" | ||
}, | ||
"result": { | ||
"status": "passed", | ||
"duration": 1000000 | ||
} | ||
}, | ||
{ | ||
"arguments": [], | ||
"keyword": "When ", | ||
"line": 13, | ||
"name": "I run yachr against it", | ||
"match": { | ||
"location": "e2e\\step_definitions\\view-report-summary.steps.js:7" | ||
}, | ||
"result": { | ||
"status": "passed", | ||
"duration": 1000000 | ||
} | ||
}, | ||
{ | ||
"arguments": [], | ||
"keyword": "Then ", | ||
"line": 14, | ||
"name": "a summary showing one passing feature and one passing scenario", | ||
"match": { | ||
"location": "e2e\\step_definitions\\view-report-summary.steps.js:10" | ||
}, | ||
"result": { | ||
"status": "passed" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
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,41 @@ | ||
import { expect } from 'chai'; | ||
import { Given, Then, When } from 'cucumber'; | ||
import * as fs from 'fs'; | ||
import { IReportOptions } from '../../dist/src/models/reportOptions'; | ||
|
||
import { Reporter } from '../../dist/src/reporter'; | ||
import * as passingScenario from '../resources/onePassingScenario.json'; | ||
|
||
import * as cherrio from 'cheerio'; | ||
const reportLocation = 'e2e/reportOutput/report.html'; | ||
const jsonOutput = 'e2e/resources/onePassingScenario.json'; | ||
|
||
let reporter: Reporter; | ||
let reportOptions: IReportOptions; | ||
|
||
Given('a passing scenario', table => { | ||
reportOptions = <IReportOptions> { | ||
jsonFile: jsonOutput, | ||
output: reportLocation, | ||
}; | ||
}); | ||
|
||
Given('the following scenarios', table => | ||
'pending'); | ||
|
||
When('I run yachr against it', () => { | ||
reporter = new Reporter(); | ||
reporter.generate(reportOptions); | ||
}); | ||
|
||
Then('a summary showing one passing feature and one passing scenario', async () => { | ||
const $ = cherrio.load(fs.readFileSync(reportLocation, 'utf8')); | ||
const pageText = $('html').text(); | ||
|
||
// ([.\n\s]*)1/ Match all spaces and new line chars | ||
const passedFeatures = /Ability: View report summary([.\n\s]*)done1/; | ||
expect(passedFeatures.test(pageText)).eql(true); | ||
}); | ||
|
||
Then('I will see the following in the summary', () => | ||
'pending'); |
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,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["es2015"], | ||
"target": "es5", | ||
"moduleResolution": "node", | ||
"strict": true, | ||
"typeRoots": [ | ||
"/node_modules/@types" | ||
], | ||
"resolveJsonModule": true, | ||
"types": [ | ||
"node", // Added to allow the use of nodes fs | ||
], | ||
}, | ||
"include": [ | ||
"./step_definitions/**/*.steps.ts" | ||
], | ||
} |
Oops, something went wrong.