Lars February 2016

Nightwatch XML output file is empty

When I run my test, I get all the output I would expect from the test such as

 ✔ Element <body> was visible after 12 milliseconds.
 ✔ Testing if element <input[id="usernameID"]> is visible.
 ✔ Testing if element <#usernameID> is visible.
 ✔ Testing if element <#passwordID> is visible.
 ✔ Testing if value of <#usernameID> contains: "".

But when I open the XML file that is generated there is nothing there, just the header, footer and a bunch of blank lines.

<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="0"
            failures="0"
            tests="2">

  <testsuite name="loginTests"
    errors="0" failures="0" hostname="" id="" package="login" skipped="0"
    tests="2" time="15.87" timestamp="Mon, 08 Feb 2016 21:01:16 GMT">

    <testcase name="Login Page Load Test" time="10.68" assertions="1">


    </testcase>

    <testcase name="Login/Logout Test" time="5.195" assertions="23">







    </testcase>


  </testsuite>
</testsuites>

Here is a snippet of the code.

'Login/Logout Test' : function(client) {
  client
   .waitForElementVisible("body", client.globals.waitForConditionTimeout)
   .assert.visible('input[id="usernameID"]')
   .assert.visible('#usernameID')
   .assert.visible('#passwordID')
   .end

I must be missing something simple.

Answers


Lars February 2016

Apparently this is the way it is... does not make a lot of sense but...

To get this information out of the test run a custom reporter is used.

I have done this, now I can write the information anywhere I want I chose to write it to a DB table.

Post Status

Asked in February 2016
Viewed 2,323 times
Voted 12
Answered 1 times

Search




Leave an answer