0

I want to run my nightwatch test case with several browsers, but not in parallel. I cannot do in parallel because each test require a login / session with a same username. I have created a batch file which looks like this:

nightwatch testcase.js --reporter html-reporter.js -e ch
nightwatch testcase.js --reporter html-reporter.js -e ie
pause

However, after executing test with chrome (ch) it does not continue to the next line (test with IE) although the test is successful.

I thought it was an issue with nightwatch, so I modified the batch file to look like this

testcase-CH.bat
testcase-IE.bat
pause

with every batch file contains a single nightwatch line, but it did not work too.

At this point, I'm not sure whether this is a nightwatch issue or batch file issue. But I have created some batch file before (not with nightwatch) and it executes every commmand on the batch file.

How do I resolve this?

user2018
  • 310
  • 2
  • 7
  • 21

1 Answers1

1

When running batch-files from a batch file, you need to use call to let it run in the current batch session else it will open a new instance and never return to the current window, therefore we need to call the batch files:

call nightwatch testcase.js --reporter html-reporter.js -e ch
call nightwatch testcase.js --reporter html-reporter.js -e ie
pause
Gerhard
  • 22,678
  • 7
  • 27
  • 43