Skip to content

Commit

Permalink
Travis CI: Workaround for bug introduced in chrome (around v64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris-van-der-Wel committed Feb 26, 2018
1 parent 65213af commit c57f244
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -56,8 +56,9 @@ jobs:
- /usr/lib/chromium-browser/chromedriver --version
- chmod +x .travis/start_vfb.sh && .travis/start_vfb.sh
- npm run test:server &
# work around for https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1718885
- LD_LIBRARY_PATH=/usr/lib/chromium-browser /usr/lib/chromium-browser/chromedriver --verbose --port=9515 "--log-path=$HOME/chromedriver.log" &
# # work around for https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1718885
# - LD_LIBRARY_PATH=/usr/lib/chromium-browser /usr/lib/chromium-browser/chromedriver --verbose --port=9515 "--log-path=$HOME/chromedriver.log" &
- /usr/lib/chromium-browser/chromedriver --verbose --port=9515 "--log-path=$HOME/chromedriver.log" &
script: npm run test:integration:webdriver
after_script:
- echo 'travis_fold:start:chromedriver.log'; cat ~/chromedriver.log; echo travis_fold:end:chromedriver.log
12 changes: 11 additions & 1 deletion test/integration/environments/webdriver.js
@@ -1,6 +1,6 @@
'use strict';
/* eslint-env node */

const Promise = require('bluebird');
const wd = require('wd');

const bluefoxStringified = require('../../../standalone.string.js');
Expand Down Expand Up @@ -63,6 +63,16 @@ global.BLUEFOX_TEST_ENV = {
browserActive = true;
await browser.setAsyncScriptTimeout(30000);
await browser.get(`http://127.0.0.1:8123/${path}`);
for (let delay = 0; delay <= 250; delay += 10) {
// workaround for chrome bug introduced in recent versions (somewhere around v64)
// in old versions of chrome pageLoadStrategy:'none' would still wait for the actual navigation
// but now browser.get() resolves too early sometimes
const location = await browser.url();
if (!/^data:/.test(location)) {
break;
}
await Promise.delay(delay);
}
await browser.execute(bluefoxStringified);
await browser.execute(`
(() => {
Expand Down

0 comments on commit c57f244

Please sign in to comment.