sap1ens
sap1ens

Reputation: 2957

Intern creates one BrowserStack session for all tests

In Intern framework, when I specify multiple tests using functionalSuites config field and run tests using BrowserStack tunnel, only one session is created in BrowserStack (everything is treated as a single test). As a result we have a few issues:

The question: how to force Intern framework to create a new session for every single test? It seems like it's impossible at the moment after looking at the codebase.

PS: I would assume that this behaviour is applied to other tunnels as well.

Upvotes: 0

Views: 702

Answers (1)

Vibhaj
Vibhaj

Reputation: 189

Use the following Gist

intern-parallel.js

Just put this file alongside intern.js and replace "intern!object" in your functional test files with "tests/intern-parallel"

Example functional test

define([
  //'intern!object',
  'tests/intern-parallel',
  'intern/chai!assert',
  'require'
], function (registerSuite, assert, require, registry) {
  registerSuite({
    name: 'automate first test',

    'google search': function () {
      return this.remote
        .get(require.toUrl('https://www.google.com'))
        .findByName("q")
          .type("Browserstack\n")
          .end()
        .sleep(5000)
        .takeScreenshot();
    }
  });
});

Upvotes: 3

Related Questions