nightwatchjs / nightwatch-docs

Source for https://nightwatchjs.org website
https://nightwatchjs.org
MIT License
94 stars 190 forks source link

Mocha From Nightwatch assert.containsText fails #77

Open enuggetry opened 7 years ago

enuggetry commented 7 years ago

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

> jbserver@0.0.101 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.

clockworked247 commented 5 years ago

@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...