-
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
7 changed files
with
42 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
// tslint:disable-next-line: file-name-casing | ||
import { expect } from 'chai'; | ||
import * as cherrio from 'cheerio'; | ||
import { Given, Then, When } from 'cucumber'; | ||
import * as fs from 'fs'; | ||
import { IReportOptions } from '../../dist/src/models/reportOptions'; | ||
|
||
import { Reporter } from '../../dist/src/reporter'; | ||
const reportLocation = 'e2e/reportOutput/report-summary-tags.html'; | ||
const jsonOutput = 'e2e/resources/tagsOnScenariosAndFunctions.json'; | ||
|
||
let reporter: Reporter; | ||
let reportOptions: IReportOptions; | ||
// tslint:disable-next-line: max-line-length | ||
Given(`Jon has results from a cucumber test containing the tag '@GH-30' against the scenario 'View scenario tag'`, () => 'pending'); | ||
Given(`Jon has results from a cucumber test containing the tag '@GH-30' against the scenario 'View scenario tag'`, () => { | ||
reportOptions = <IReportOptions>{ | ||
jsonFile: jsonOutput, | ||
output: reportLocation, | ||
}; | ||
}); | ||
|
||
When(`Jon runs yachr against the result`, () => { | ||
reporter = new Reporter(); | ||
reporter.generate(reportOptions); | ||
}); | ||
|
||
When(`Jon runs yachr against the result`, () => 'pending'); | ||
// tslint:disable-next-line: max-line-length | ||
Then(`Jon will see the tag '@GH-30' in the title bar of the scenario 'View Scenario tag' in the generated report`, () => { | ||
const $ = cherrio.load(fs.readFileSync(reportLocation, 'utf8')); | ||
const pageText = $('html').text(); | ||
|
||
Then(`Jon will see the tag '@GH-30' in the title bar of the scenario 'View Scenario tag' in the generated report`, () => | ||
'pending'); | ||
// ([.\n\s]*)1/ Match all spaces and new line chars | ||
const passedFeatures = /@GH-30([.\n\s]*)Scenario: View Feature tag/; | ||
expect(passedFeatures.test(pageText)).eql(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
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 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