Closed OliverCulleyDeLange closed 7 years ago
Interesting... Offhand I'm not sure why the order of environments (and correspondingly session creation) would matter, but stranger things have happened.
Do you still have issues if you don't include chromedriver and selenium-webdriver as dependencies?
Yeah same problem - It is an interesting one!
Indeed.
Ok, I was finally able to reproduce a similar issue. The key setting seems to be maxConcurrency
. With that set to 1, and when chrome is before firefox, I consistently get a hang (not an error, but maybe I just haven't waited long enough) just after Intern finishes the chrome session. With firefox before chrome, both sessions finish. When maxConcurrency
is 2, both sessions always finish (at least in all my test runs).
This appears to be an incompatibility between Selenium 2.53.1 (which Dig Dug 1.5 uses) and geckodriver. Dig Dug 1.6 uses Selenium 3.0.1 and doesn't display this problem.
For me the error was immediate - no hanging. Yes sorry i forgot to mention that I had only just added the maxConcurrency flag, because I was seeing issues running tests in parallel (tests would pass on firefox and chrome when run individually but not when together concurrently).
How would I test using DigDug 1.6? I tried installing "digdug": "^1.6.1"
and running but seeing the same issue. npm list shows digdug 1.5 as a dependency of Intern 3.3.2.
Sorry I'm not familiar with the Javascript package management world - I'm a Java guy really who's somehow been sucked into the front end world temporarily.
Using Intern 3.4.2 should resolve this as it uses Dig Dug 1.6+.
For future reference, to force an updated dependency for testing purposes, after installing a new package version (e.g., digdug 1.6.1), you'll have to remove the package from the node_modules
directories of packages that depend on it. For example, when you install digdug 1.6.1 in a project with intern 3.3.2, npm will put digdug 1.6.1 in the project's node_modules
directory, then give intern its own copy of digdug 1.5.x in node_modules/intern/node_modules/digdug
.
Just checking up -- is this resolved now?
Yes, upgrading to Intern 3.4.2 fixed the issue - Sorry I should've said!
No problem, glad to hear things are working!
Somehow the ordering of the 'environments' config objects affects the creation of the firefox session.
To reproduce:
With the below files in place, run
./node_modules/.bin/intern-runner config=functionaltests/intern-web
. Tests should fail withThen reverse the order of the environment objects in the config (see below file) and run again. Tests should pass.
functionaltests/intern-web.js
【 code javascript 】 define({ capabilities: { fixSessionCapabilities: false }, environments: [ // Doesn't work { browserName: 'chrome' }, { browserName: 'firefox', marionette: true }
// Works // { browserName: 'firefox', marionette: true }, // { browserName: 'chrome' } ], tunnel: 'SeleniumTunnel', tunnelOptions: { drivers: [ 'chrome', 'firefox' ] }, proxyOnly: false, functionalSuites: [ 'functionaltests/functional' ], excludeInstrumentation: true, maxConcurrency: 1 }); 【 end code 】
functionaltests/functional.js
【 code 】 define(function (require) { var bdd = require('intern!bdd'); var expect = require('intern/chai!expect');
bdd.describe('home screen', function () {
bdd.it('should search for a postcode', function () { return this.remote .get(require.toUrl('src/index.html')) .findAllByCssSelector('#thing') .getVisibleText() .then(function (text) { expect(text).to.contain("hello") }) }); }); }); 【 end code 】
src/index.html
【 code 】 <!DOCTYPE html>
【 end code 】
devDependencies:
【 code 】 "devDependencies": { "chai": "^3.5.0", "chromedriver": "^2.25.1", "intern": "^3.3.2", "selenium-webdriver": "^3.0.0-beta-3" } 【 end code 】