javascriptautomationautomated-testscodeceptjs

ShellJS start script but don't stop the current flow


I'm using codeceptjs with shelljs.

In one of tests I'm invoking go application like this :

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)
})

So first step in test is invoked and the go application is started with shell command.

Then next one step is codeceptjs wait for element but it never happens. And in console I see only the 'go program'

When application is started its blocking my other JS to be executed (Its codeceptjs tests).

Does someone has idea how not to interrupt further JS execution?

https://github.com/shelljs/shelljs


Solution

  • enter image description here

    You should use async option. Please check the docs by "async" keyword