Nightwatch XML report file is empty

272 views
Skip to first unread message

Walter

unread,
Aug 4, 2017, 10:34:00 AM8/4/17
to NightwatchJs
I'm currently trying / struggling to get my Nightwatch tests to run on my Jenkins server (installed locally on a Mac). This prompted me to examine my Junit / XML reports only to discover they are missing all of my test steps and assertions. My Nightwatch tests run great and I have dozens of e2e tests built using the POM. I located a thread on stackoverflow where a user was having the same issue. I couldn't find anything regarding this in the group so I figured I would post it here. Below you will find an example test, terminal output, and report. Please let me know if this is expected behavior or how I might be able to resolve this issue and finally have complete xml reports. 

Thanks


Test output in the Terminal:
Header] Test Suite
=======================
Running:  Resources Page > Sample Data Sets
 ✔ Expected element <#select-advertiser> text to equal: "Link User" - condition was met in 2490ms
 ✔ Expected element <#select-your-advertiser> text to equal: "Your Advertisers" - condition was met in 51ms
 ✔ Expected element <li.margin-r15:nth-child(2)> text to equal: "Tom" - condition was met in 206ms
 ✔ Expected element <#user_settings> text to equal: "Your Settings" - condition was met in55ms
OK. 4 assertions passed. (10.294s)
{ passed: 4,
  failed: 0,
  errors: 0,
  skipped: 0,
  tests: 4,
  errmessages: [],
  modules:
   { header:
      { completed: [Object],
        skipped: [],
        time: '10.29',
        timestamp: 'Fri, 04 Aug 2017 13:31:22 GMT',
        group: '',
        tests: 1,
        errmessages: [],
        failures: 0,
        errors: 0 } },
  assertions: 4 }


Report output - XML: 
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="0"
failures="0"
tests="1">

<testsuite name="header"
errors="0" failures="0" hostname="" id="" package="header" skipped="0"
tests="1" time="10.29" timestamp="Fri, 04 Aug 2017 13:31:22 GMT">
<testcase name="Resources Page &gt; Sample Data Sets" classname="header" time="10.29" assertions="4">




</testcase>


</testsuite>
</testsuites>



Test .JS file (header.js): 
module.exports = {
'Resources Page > Sample Data Sets' : function (client) {
client
.page.site().url()
.page.sign_in().login()
.page.header().logo()
.page.header().homeBtn()
.page.header().username()
.page.header().hamburgerBtn()
.page.header().resourcesBtn()
.page.header().hamburgerBtn()
.page.header().settingsBtn()
.end();
}
}; 

 

Eric Mumford

unread,
Aug 18, 2017, 1:05:35 AM8/18/17
to NightwatchJs
Where is your test code? You are trying to be too clever and grouping your test code up and away somewhere. We can't debug what we don't see.

There is separation of functions, and there is OCD. Err toward too much code on one page - its easier to debug LOL 

client.page.header().username() looks nice but doesn't tell us what the username() method does inside header() inside .page 
Reply all
Reply to author
Forward
0 new messages