我在shelljs中使用codeceptjs。
在其中一个测试中,我像这样调用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)
})因此,调用test中的第一步,并使用shell命令启动go应用程序。
然后下一步是codeceptjs等待元素,但它永远不会发生。在控制台中,我只看到“go程序”。
当应用程序启动时,它会阻塞我要执行的其他JS (它的codeceptjs测试)。
有人知道如何不中断JS的进一步执行吗?
发布于 2021-08-03 14:52:18

您应该使用异步选项。请按async关键字检查单据
https://stackoverflow.com/questions/68638210
复制相似问题