Reputation: 1149
Is there a possibility to run .bat file (script) using WebdriverIO, preferable into before hook, located into WDIO.conf file?
before: function () {
console.log("this is before");
},
Upvotes: 0
Views: 592
Reputation: 8682
Yeah, it's possible you just need to import execFileSync
and join
methods and then you can run it like that:
const { execFileSync } = require('child_process');
const { join } = require('path');
before: function () {
execFileSync(join(__dirname, './script.bat'));
}
Read more about execFileSync
method here
Upvotes: 1