-
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
4 changed files
with
47 additions
and
2 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
9 changes: 9 additions & 0 deletions
9
e2e/features/abilities/report-consumer/understand-rankings.feature
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,9 @@ | ||
Ability: Understand how features and scenarios are given a status | ||
|
||
As a report reader | ||
I wan't to understand how a scenario or feature gets assigned its status | ||
So I can better understand the stats on the report | ||
|
||
Scenario: View description of statuses | ||
Given Lina is viewing a cucumber report | ||
Then Lina should be able to see a legend explaining the status |
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,32 @@ | ||
// tslint:disable-next-line: file-name-casing | ||
import { expect } from 'chai'; | ||
import { Given, Then } from 'cucumber'; | ||
import * as fs from 'fs'; | ||
import { IReportOptions } from '../../dist/src/models/reportOptions'; | ||
|
||
import { Reporter } from '../../dist/src/reporter'; | ||
const reportLocation = 'e2e/reportOutput/understand-rankings.html'; | ||
const jsonOutput = 'e2e/resources/onePassingScenario.json'; | ||
|
||
let reporter: Reporter; | ||
let reportOptions: IReportOptions; | ||
|
||
// tslint:disable-next-line: max-line-length | ||
Given(`Lina is viewing a cucumber report`, () => { | ||
reportOptions = <IReportOptions> { | ||
jsonFile: jsonOutput, | ||
output: reportLocation, | ||
}; | ||
|
||
reporter = new Reporter(); | ||
reporter.generate(reportOptions); | ||
}); | ||
|
||
Then(`Lina should be able to see a legend explaining the status`, () => { | ||
const report = fs.readFileSync(reportLocation, 'utf8'); | ||
|
||
const expectedText = 'The status of a scenario or feature is based on the ' + | ||
'worst status of its steps, in order: ambiguous -> failed -> undefined -> pending -> passed'; | ||
|
||
expect(report.includes(expectedText)).to.equal(true); | ||
}); |
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