【发布时间】:2021-10-08 18:54:39
【问题描述】:
我正在使用 codeceptjs 和 shelljs。
在一项测试中,我正在像这样调用go 应用程序:
const shell = require('shelljs')
Given('Member starts call', () => {
shell.exec('./myGoApplication -cc call', true)
});
Then('I wait for {}', async (element) => {
await I.waitForElement("~" + element, 20)
})
因此调用了测试的第一步,并使用 shell 命令启动了 go 应用程序。
然后下一步是 codeceptjs 等待元素,但它永远不会发生。在控制台中,我只看到“go 程序”
当应用程序启动时,它会阻止我的其他 JS 被执行(它的 codeceptjs 测试)。
有人知道如何不中断进一步的 JS 执行吗?
【问题讨论】:
-
你能粘贴更多代码来看看它是怎么回事吗?
-
@Sohan 添加了更多代码
-
以下解决方案对您有用吗?如果您当前的代码已通过
true标志 -
@Sohan 只有在我通过
{async: true}时才有效 -
对,问题解决了:0
标签: javascript automation automated-tests codeceptjs