【问题标题】:ShellJS start script but don't stop the current flowShellJS 启动脚本但不停止当前流程
【发布时间】:2021-10-08 18:54:39
【问题描述】:

我正在使用 codeceptjsshelljs

在一项测试中,我正在像这样调用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 执行吗?

https://github.com/shelljs/shelljs

【问题讨论】:

  • 你能粘贴更多代码来看看它是怎么回事吗?
  • @Sohan 添加了更多代码
  • 以下解决方案对您有用吗?如果您当前的代码已通过true 标志
  • @Sohan 只有在我通过 {async: true} 时才有效
  • 对,问题解决了:0

标签: javascript automation automated-tests codeceptjs


【解决方案1】:

您应该使用异步选项。请通过“async”关键字查看文档

【讨论】:

猜你喜欢
  • 2020-05-05
  • 1970-01-01
  • 2012-09-05
  • 1970-01-01
  • 1970-01-01
  • 2023-03-12
  • 2016-03-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多