Ok -- I don't think I'm understanding this correctly then, because I believe that I had been doing that correctly.
I've broken down the tests that I'm running into its simplest possible version, and its available here:
As you can see there is correctly a .afterEach that is calling both client.end(); and done();
For the test, we are launching two different chrome instances (each with different environments), and running it in parallel (see launch.sh for how the tests are launched).
Are the remaining test steps supposed to be skipped? After the first failure, we get this:
chrome2_2 FAILED: 1 assertions failed and 2 passed (9.626s)
chrome2_2
chrome2_2 ----------------------------------------------------
chrome2_2 TEST FAILURE: 1 assertions failed, 2 passed (9.658s)
chrome2_2 ✖ ua
chrome2_2 - chrome2_2 -- 0
chrome2_2 Testing if element <body> contains text: "not present text". - Expected "not present text" but got: "ip_addr: 8.8.8.8
remote_host:
user_agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36
port: 56990
lang: en-US,en;q=0.8
connection: keep-alive
keep_alive:
encoding: gzip, deflate, sdch
mime: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
charset:
via:
forwarded: "
chrome2_2 SKIPPED:
chrome2_2 - chrome2_2 -- 1
- chrome2_2 -- 2
chrome2_2 - chrome2_2 -- 3
- chrome2_2 -- 4
chrome2_2 - chrome2_2 -- 5
chrome2_2 - chrome2_2 -- 6
- chrome2_2 -- 7
- chrome2_2 -- 8
chrome2_2 - chrome2_2 -- 9
Note that all the remaining tests are skipped. Is this the expected behavior? Again, my apologies in advance if I'm not understanding the behavior correctly here. My experience with other unit testing suites is that other tests within that "test" would continue after a failure, when configured to do so.
If this is not the right way to go about doing this (ie, breaking up test steps) within Nightwatch tests?