如何运行 nightwatch test cases in sequence/in series?

How to run nightwatch test cases in sequence / in series?

我想 运行 我的 nightwatch 测试用例有几个浏览器,但不是并行的。我不能并行进行,因为每个测试都需要使用相同用户名的登录/会话。我创建了一个批处理文件,如下所示:

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

然而,用chrome(ch)执行测试后,虽然测试成功,但并没有继续到下一行(用IE测试)。

我以为是 nightwatch 的问题,所以我修改了批处理文件,如下所示

testcase-CH.bat
testcase-IE.bat
pause

每个批处理文件都包含一个 nightwatch 行,但它也不起作用。

此时,我不确定这是守夜人问题还是批处理文件问题。但是我之前创建了一些批处理文件(不是用 nightwatch),它执行批处理文件上的每个命令。

我该如何解决这个问题?

当从批处理文件 运行 宁 batch-files 时,您需要使用调用让它 运行 在当前批处理会话中,否则它将打开一个新实例并且永远不会 return到当前的window,因此我们需要call批处理文件:

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