File tree 4 files changed +13
-10
lines changed
4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,8 @@ In another terminal window, execute
19
19
```
20
20
npm test
21
21
```
22
+
23
+ Node Variables:
24
+ ```
25
+ URL=http://www.automationpractice.com
26
+ ```
Original file line number Diff line number Diff line change 1
- import { browser } from "protractor" ;
2
-
3
1
const by = protractor . by ;
4
2
const until = protractor . ExpectedConditions ;
5
3
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ https://github.com/cucumber/cucumber-js/blob/dfbfed94e2cee4fd6b1f91299f7b450b271
17
17
*/
18
18
After ( async function ( scenario ) {
19
19
const world = this ;
20
- const scenarioFailed = scenario . result . status === Status . FAILED ;
21
- if ( scenarioFailed ) {
20
+ const failed = scenario . result . status === Status . FAILED ;
21
+ if ( failed ) {
22
22
return browser . takeScreenshot ( ) . then ( async function ( base64EncodedImage ) {
23
23
return world . attach ( Buffer . from ( base64EncodedImage . toString ( ) , 'base64' ) , 'image/png' ) ;
24
24
} ) ;
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ const date = new Date();
4
4
const day = date . getDate ( ) ;
5
5
const month = date . getMonth ( ) + 1 ;
6
6
const year = date . getFullYear ( ) ;
7
- const generatedName = `test_report_${ day } _${ month } _${ year } ` ;
8
- const directory = `./target/${ generatedName } ` ;
9
- const jsonFile = `${ directory } /${ generatedName } .json` ;
10
- const htmlFile = `${ directory } /${ generatedName } .html` ;
7
+ const reportFileName = `test_report_${ day } _${ month } _${ year } ` ;
8
+ const directory = `./target/${ reportFileName } ` ;
9
+ const jsonFile = `${ directory } /${ reportFileName } .json` ;
10
+ const htmlFile = `${ directory } /${ reportFileName } .html` ;
11
11
12
12
const createDirectory = function ( ) {
13
- const exists = fileSystem . existsSync ( directory ) ;
14
- if ( ! exists ) {
13
+ const directoryDoesNotExist = ! fileSystem . existsSync ( directory ) ;
14
+ if ( directoryDoesNotExist ) {
15
15
fileSystem . mkdirSync ( directory ) ;
16
16
fileSystem . writeFile ( jsonFile ) ;
17
17
}
You can’t perform that action at this time.
0 commit comments