tacoss / grunt-nightwatch

Run your Nightwatch.js tests with Grunt
50 stars 22 forks source link

No test command-line output, no xml output #10

Closed traviscosgrave closed 10 years ago

traviscosgrave commented 10 years ago

This one leaves me a little lost. The selenium actions are running, but neither asserts nor verifies are outputting anything. And, they are not reporting whether they pass or fail. Finally. The output Xml is empty. The reports/examples folder exists. Below are my files. Has something changed with the way that nightwatch reports results since the version grunt-nightwatch was last built?

Gruntfile.coffee

module.exports = (grunt) ->
  grunt.initConfig
    nightwatch:
      options:
        settings:
          src_folders: ["tests/examples"]
          output_folder: "reports/examples"
          test_settings:
            default:
              launch_url: "http://getbootstrap.com"
              selenium_host: "selenium.ci.local"
              silent: false
              desiredCapabilities:
                version: "win7"
                browserName: "chrome"

  grunt.loadNpmTasks "grunt-nightwatch"

configFileExamples.coffee

module.exports =
  'Demo test Google': (browser) ->
    browser
      .url('http://www.aol.com') # changed to fail the test
      .waitForElementVisible('body', 1000)
      .setValue('input[type=text]', 'nodejs')
      .waitForElementVisible('button[name=btnG]', 1000)
      .click('button[name=btnG]').pause(1000)
      .assert.containsText('#ires', 'joy654654ent/node')
      .end()
pateketrueke commented 10 years ago

I'm not sure but currently Nightwatch cannot execute any .coffee file for testing.

cc: @beatfactor

traviscosgrave commented 10 years ago

All of my coffee is transpiled to js.

pateketrueke commented 10 years ago

Could you run grunt nightwatch --verbose and paste your output?

BTW; I've updated the develop branch, If I missing something please tell me.

beatfactor commented 10 years ago

@traviscosgrave which version of Nightwatch are you using?

manolakis commented 10 years ago

I'm suffering the same bug. I'm using nightwatch version 0.4.13.

traviscosgrave commented 10 years ago

Sorry for the delay. Here is the requested output.

travis.cosgrave@tcdevubuntu:~/bbsrc/automatedTesting$ nightwatch -version
nightwatch v0.4.13
travis.cosgrave@tcdevubuntu:~/bbsrc/automatedTesting$ grunt nightwatch --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.coffee" Gruntfile...OK

Registering Gruntfile tasks.
Initializing config...OK

Registering "grunt-nightwatch" local Npm module tasks.
Reading /home/travis.cosgrave/bbsrc/automatedTesting/node_modules/grunt-nightwatch/package.json...OK
Parsing /home/travis.cosgrave/bbsrc/automatedTesting/node_modules/grunt-nightwatch/package.json...OK
Loading "nightwatch.js" tasks...OK
+ nightwatch
Loading "Gruntfile.coffee" tasks...OK
>> No tasks were registered or unregistered.

Running tasks: nightwatch

Running "nightwatch" task
Options: jar_url="http://selenium-release.storage.googleapis.com/2.40/selenium-server-standalone-2.40.0.jar", jar_path="/opt/selenium/server-standalone.2.40.0.jar", standalone=false, settings={"src_folders":["tests/examples"],"output_folder":"reports/examples","test_settings":{"default":{"launch_url":"http://getbootstrap.com","selenium_host":"selenium.ci.lan","silent":true,"desiredCapabilities":{"version":"win7","browserName":"chrome"}}}}
>> Task options
{"jar_url":"http://selenium-release.storage.googleapis.com/2.40/selenium-server-standalone-2.40.0.jar","jar_path":"/opt/selenium/server-standalone.2.40.0.jar","standalone":false,"settings":{"src_folders":["tests/examples"],"output_folder":"reports/examples","test_settings":{"default":{"launch_url":"http://getbootstrap.com","selenium_host":"selenium.ci.lan","silent":true,"desiredCapabilities":{"version":"win7","browserName":"chrome"}}}}}
>> Target settings
{"launch_url":"http://getbootstrap.com","selenium_host":"selenium.ci.lan","silent":true,"desiredCapabilities":{"version":"win7","browserName":"chrome"},"screenshots":{}}
>> Executing "default" tests

Done, without errors.

If I change the test, to have something fail I do see errors from selenium. If I log to the console in my tests, I see that out put as well.

pateketrueke commented 10 years ago

About outputting

By default the output option was set as false and actually is configurable, the next release will set output: true as default.

About reporting

It seems that writeFile() is not working as expected within junit-reporter, using its sync-version should fix this issue (?)

PR: https://github.com/beatfactor/nightwatch/pull/16

beatfactor commented 10 years ago

I would rather use the async version unless we know for sure what the issue is. Seems rather unlikely that writeFile would cause any problems.

pateketrueke commented 10 years ago

Solved, the patch will come on a next release!