cherry
cherry

Reputation: 137

Run mocha tests parallelly using selenium grid

I have 1000 test files similar to following test file. I would like to setup selenium grid inorder to run these tests parallelly on different machines. After setting up selenium grid and multiple nodes, I ran "mocha test/"..This runs all tests under test folder sequentially. I would like tests to be run parallely. How do I specify to run tests parallelly when I run them as mocha?

var driver = require("selenium-webdriver");
driver = new webdriver.Builder().
    usingServer(server.address()).
    withCapabilities({'browserName': process.env.browserName}).
    build();

it('should append query to title', function() {
        driver.get('http://www.google.com');
        driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
        driver.findElement(webdriver.By.name('btnG')).click();
        driver.wait(function() {
            return driver.getTitle().then(function(title) {
                return 'webdriver - Google Search' === title;
            });
        }, 1000);
    });

Upvotes: 0

Views: 1969

Answers (1)

ssmiech
ssmiech

Reputation: 261

There is a NPM package that enables parallel execution of mocha tests: https://github.com/atsuya/parallel-mocha

Upvotes: 1

Related Questions