How to use the webdriverio.Launcher function in webdriverio

To help you get started, we’ve selected a few webdriverio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerner / terra-toolkit / scripts / wdio / wdio-runner.js View on Github external
let envValues = `LOCALE=${locale} `;
        let exitProcess = false;
        process.on('SIGINT', () => {
          exitProcess = true;
        });

        const form = factors[factor];
        if (form) {
          process.env.FORM_FACTOR = form;
          envValues += `FORM_FACTOR=${form}`;
        }
        envValues = Logger.emphasis(envValues);
        Logger.log(`Running tests for: ${envValues}`, { context });

        // eslint-disable-next-line no-await-in-loop
        await new Launcher(configPath, testSetup)
          .run()
          .then(
            (code) => {
              // If we receive a test failure, exit with a status of 1.  exitProcess is a special case
              // where the user hit Ctrl-C and will be handled in the else block.
              if (code === 1 && !continueOnFail && !exitProcess) {
                Logger.error(`Running tests for: ${envValues} failed.`, { context });
                process.exit(1);
              } else {
                onReturnSuccess(exitProcess, envValues);
              }
            },
            (error) => {
              Logger.error(`Launcher failed to start the test ${error.stacktrace}`, { context });
              process.exit(1);
            },
github cerner / terra-toolkit / packages / terra-wdio / scripts / wdio-runner.js View on Github external
const locale = locales[localeI];
    process.env.LOCALE = locale;

    for (let factor = 0; factor < factors.length; factor += 1) {
      let envValues = `LOCALE=${locale} `;

      const form = factors[factor];
      if (form) {
        process.env.FORM_FACTOR = form;
        envValues += `FORM_FACTOR=${form}`;
      }
      envValues = Logger.emphasis(envValues);
      Logger.log(`Running tests for: ${envValues}`, { context });

      // eslint-disable-next-line no-await-in-loop
      await new Launcher(configPath, testSetup)
        .run()
        .then(
          (code) => {
            if (code === 1 && !continueOnFail) {
              Logger.error(`Running tests for: ${envValues} failed.`, { context });
              process.exit(1);
            } else {
              Logger.log(`Finished tests for: ${envValues}\n\n---------------------------------------\n`, { context });
            }
          },
          (error) => {
            Logger.error(`Launcher failed to start the test ${error.stacktrace}`, { context });
            process.exit(1);
          },
        );
    }
github Blazemeter / taurus / bzt / resources / wdio-taurus-plugin.js View on Github external
function runWDIO() {
    var config = parseCmdline(process.argv);
    reportStream = fs.createWriteStream(config.reportFile);

    var configFile = config.wdioConfig;
    var opts = {
        reporters: [TaurusReporter],
    };

    var wdio = new Launcher(configFile, opts);

    function done(code) {
        if (reportStream) {
            reportStream.end();
        }
        process.exit(code);
    }

    function handleError(error) {
        console.error("Launcher failed to start the test", error);
        done(1);
    }

    var startTime = epoch();

    function loopWDIO(code) {

webdriverio

Next-gen browser and mobile automation test framework for Node.js

MIT
Latest version published 4 days ago

Package Health Score

100 / 100
Full package analysis