简体   繁体   中英

What's the right way to call nightwatch.js directly for tests that needs to be run in parallel

I have tried this way, but no success:

    try {
        Nightwatch.cli(function(argv) {
            argv = {
                test: 'tests/index.js',
                config: 'confs/nightwatch.conf.js',
                e: 'chrome,chrome',                     
                env: 'chrome,chrome'
            }

            Nightwatch.runner(argv);
        });
    } catch (ex) {
        Utils.showStackTraceWithHeadline('There was an error while starting the test runner:\n', ex.stack + '\n', true);
        process.exit(2);
    }

It shows that it has started child process, but no browser is opened.

Thank you

If you are looking for how to run the suite in parallel (all the test cases you have run, say, using a variety of browsers), it's just removing the "--serial" a command line argument:

./node_modules/.bin/magellan --browsers=chrome,chrome

or

./node_modules/.bin/magellan --browsers=chrome,firefox,safari

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM