我目前正在使用一个模式,该模式显示正在运行的测试以及使用Nightwatch Programmatic API进行排队的测试,现在我只能获取要运行的测试,而我想要获得的是当前正在运行的测试的名称,但是在我返回了Runner.runTests()之后,在测试结束之前我没有得到任何响应 这是我的代码
router.post('/exec', function (req, res) {
req.setTimeout(21600000);
Nightwatch.cli(function (argv) {
argv.config = 'nightwatch.conf.js';
const runner = Nightwatch.CliRunner(argv);
const testCase = req.body.testCase;
runner
.setup({
src_folders: testCase
})
.startWebDriver()
.then(() => {
res.render('monitoring', {page: 'Suivi tests', menuId: 'monitoring', testCase: testCase})
return runner.runTests()
})
.then(() => {
return runner.stopWebDriver()
.then(() => {
res.send("hello")
})
})
.catch((err) => {
console.error(err)
res.status(500).send('err')
});
});
})