nightwatch-docs
nightwatch-docs copied to clipboard
Mocha From Nightwatch assert.containsText fails
Pretty new at this. Running the Using Mocha From Nightwatch example http://nightwatchjs.org/guide#using-mocha, verbatim test -- it's failing. Can't figure out why.
The browser launches and "nightwatch" is entered into google search....
$ npm test
> [email protected] test /var/www/html/3jbserver
> node ./node_modules/nightwatch/bin/nightwatch -c ./test/nightwatch.json ./test/google.test.js
1) Google demo test for Mocha with Nightwatch uses BDD to run the Google simple test
0 passing (8s)
1 failing
1) Google demo test for Mocha with Nightwatch uses BDD to run the Google simple test:
Testing if element <#main> contains text: "Night Watch". - Expected "Night Watch" but got: ""
at Context.<anonymous> (test/google.test.js:30:17)
at Context.<anonymous> (test/google.test.js:20:7)
npm ERR! Test failed. See above for more details.
In nightwatch.json...
...
"test_runner" : {
"type" : "mocha",
"options" : {
"ui" : "bdd",
"reporter" : "list"
}
}
...
google.test.js is exactly the given example
package.json
"scripts": {
"test": "node ./node_modules/nightwatch/bin/nightwatch -c ./test/nightwatch.json ./test/google.test.js"
...
running with (npm) selenium-standalone.
@enuggetry ever figure out what caused the failure? I am facing the same issue, except it works in local dev, but not in my pipeline. Clearly something is up with the config...