Skip to content

Commit

Permalink
Reproduce bug nightwatchjs/nightwatch#1205 with v1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
aberonni committed Jul 11, 2018
0 parents commit 7ec16bf
Show file tree
Hide file tree
Showing 10 changed files with 1,227 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
*.log
reports
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\node_modules\\nightwatch\\bin\\runner.js"
}
]
}
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Reproduce
```
yarn install
npx webdriver-manager start
yarn test
```
14 changes: 14 additions & 0 deletions globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fs = require('fs');

module.exports = {
abortOnAssertionFailure : true,
waitForConditionPollInterval : 300,
waitForConditionTimeout : 5000,
throwOnMultipleElementsReturned : false,
asyncHookTimeout : 10000,

reporter : function(results, cb) {
fs.writeFileSync('output.json', JSON.stringify(results, null, 4), 'utf8');
cb();
}
};
39 changes: 39 additions & 0 deletions nightwatch.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
"src_folders": ["tests"],
"output_folder": "reports",
"globals_path": "./globals.js",

"test_workers": {
"enabled": true,
"workers": "auto"
},

"selenium": {
"start_process": false,
"server_path": "",
"log_path": "",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": "",
"webdriver.gecko.driver": "",
"webdriver.edge.driver": ""
}
},

"test_settings": {
"default": {
"launch_url": "http://localhost",
"selenium_port": 4444,
"selenium_host": "localhost",
"silent": true,
"screenshots": {
"enabled": false,
"path": ""
},
"desiredCapabilities": {
"browserName": "chrome"
}
},

}
}
69 changes: 69 additions & 0 deletions output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"passed": 1,
"failed": 0,
"errors": 0,
"skipped": 0,
"tests": 0,
"assertions": 1,
"errmessages": [],
"modules": {
"test1": {
"reportPrefix": "CHROME_67.0.3396.99_Windows_NT_",
"assertionsCount": 1,
"skipped": [],
"time": "5.051",
"completed": {
"Demo test 1": {
"time": "5.051",
"assertions": [
{
"message": "Element <body> was visible after 144 milliseconds.",
"stackTrace": "",
"fullMsg": "Element <body> was visible after 144 milliseconds.",
"failure": false
}
],
"passed": 1,
"errors": 0,
"failed": 0,
"skipped": 0,
"tests": 1,
"steps": [],
"stackTrace": "",
"testcases": {
"Demo test 1": {
"time": "5.051",
"assertions": [
{
"message": "Element <body> was visible after 144 milliseconds.",
"stackTrace": "",
"fullMsg": "Element <body> was visible after 144 milliseconds.",
"failure": false
}
],
"tests": 1,
"passed": 1,
"errors": 0,
"failed": 0,
"skipped": 0,
"steps": [],
"stackTrace": "",
"timeMs": 5051
}
},
"timeMs": 5051
}
},
"errmessages": [],
"testsCount": 1,
"skippedCount": 0,
"failedCount": 0,
"errorsCount": 0,
"passedCount": 1,
"group": "",
"tests": 1,
"failures": 0,
"errors": 0
}
}
}
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "nightwatch-reporter-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"postinstall": "npx webdriver-manager update",
"test": "nightwatch"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"nightwatch": "^1.0.6",
"webdriver-manager": "^12.0.6"
}
}
8 changes: 8 additions & 0 deletions tests/test1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
'Demo test 1': function (browser) {
browser
.url('http://domenicogemoli.com')
.waitForElementVisible('body')
.end()
}
};
8 changes: 8 additions & 0 deletions tests/test2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
'Demo test 2': function (browser) {
browser
.url('http://domenicogemoli.com')
.waitForElementVisible('body')
.end()
}
};

0 comments on commit 7ec16bf

Please sign in to comment.