-
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
Maria
committed
Mar 30, 2020
1 parent
f2dc6fe
commit c805da1
Showing
20 changed files
with
4,892 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
../../Desktop/e2e/.idea | ||
node_modules | ||
tests_output | ||
chromedriver.log | ||
debug.log | ||
vrt | ||
vrt/baseline | ||
vrt/diff | ||
vrt/latest |
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 +1,38 @@ | ||
# nightwatch-example | ||
# E2E with Nightwatch.js | ||
|
||
Project template and simple test examples | ||
|
||
## Installation | ||
|
||
Install required dependencies | ||
including Selenium Server and `chromedriver`: | ||
``` | ||
npm install | ||
``` | ||
|
||
## Execution | ||
|
||
E2E: | ||
``` | ||
npm run test | ||
``` | ||
|
||
VRT: | ||
``` | ||
npm run test:vrt | ||
``` | ||
|
||
## Organizing | ||
|
||
Tags: | ||
``` | ||
'@tags': ['example'], | ||
``` | ||
|
||
Ignore: | ||
``` | ||
'@disabled': 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
|
||
"src_folders" : ["src/tests/e2e"], | ||
"page_objects_path": ["src/page-objects"], | ||
"globals_path": "globals.js", | ||
|
||
|
||
"webdriver" : { | ||
"start_process": false, | ||
"host": "localhost", | ||
"server_path": "/node_modules/chromedriver/bin/chromedriver", | ||
"port": 9515 | ||
}, | ||
|
||
"test_settings" : { | ||
"default" : { | ||
"desiredCapabilities": { | ||
"browserName": "chrome" | ||
} | ||
}, | ||
|
||
"local" : { | ||
"desiredCapabilities": { | ||
"browserName": "chrome", | ||
"chromeOptions" : { | ||
"args" : ["start-maximized"] | ||
} | ||
} | ||
} | ||
} | ||
} |
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,38 @@ | ||
const path = require('path'); | ||
const baseConfig = require('./nightwatch.conf.js'); | ||
|
||
const config = { | ||
...baseConfig, | ||
src_folders: ['src/tests/vrt-tests'], | ||
custom_commands_path: [ | ||
'node_modules/nightwatch-vrt/commands' | ||
], | ||
custom_assertions_path: [ | ||
'node_modules/nightwatch-vrt/assertions' | ||
] | ||
}; | ||
|
||
|
||
function generateScreenshotFilePath(nightwatchClient, basePath, fileName) { | ||
const moduleName = nightwatchClient.currentTest.module, | ||
testName = nightwatchClient.currentTest.name; | ||
|
||
return path.join(process.cwd(), basePath, moduleName, testName, fileName); | ||
} | ||
|
||
config.test_settings.default.globals = { | ||
'visual_regression_settings': { | ||
'generate_screenshot_path': generateScreenshotFilePath, | ||
'latest_screenshots_path': 'vrt/latest', | ||
'latest_suffix': '', | ||
'baseline_screenshots_path': 'vrt/baseline', | ||
'baseline_suffix': '', | ||
'diff_screenshots_path': 'vrt/diff', | ||
'diff_suffix': '', | ||
'threshold': 0, | ||
'prompt': false, | ||
'always_save_diff_screenshot': true // false == run comparing tests, true == collect a base screenshots | ||
} | ||
}; | ||
|
||
module.exports = config; |
Oops, something went wrong.