Skip to content

Commit

Permalink
Addressing PR feedback from Tom.
Browse files Browse the repository at this point in the history
Also a test of the travis.dev domain for local.
  • Loading branch information
itsjamie committed Aug 28, 2019
1 parent b734013 commit 5a7410d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ jobs:
env: TRAVIS_MODE=funcTests UA=safari OS="OS X 10.11" UA_VERSION="9.0"
addons:
sauce_connect:
direct_domains: test-streams.mux.dev,playertest.longtailvideo.com,player.webvideocore.net,pl.streamingvideoprovider.com,storage.googleapis.com,*.akamaihd.net,s3.amazonaws.com
tunnel_domains: travis.dev
jwt:
secure: TxJT041jqRf4raCwtNJRb0rz2gGvEaADZjWO41UQND2+YIZ//S9qB2C4YyrL1BBsn8/ebdHr0cd18PwCzoBSEmoCdoAWXmqBaaLvM1DOeQkKJbU3+pFmWtv1qGqRXJLEAysNvzhG0sLdvBc0M7a/CWxqRfx1O3lGhLnTlAW33LlQndjJ8vh3SGQm8HxFR1503ujPd7V1jGwduVwaQp4zbAKTnQ4MLugmJf6UKiTc+YILMrVWOwipOIyYHh2GqbChd/v1PXff26XCNJXcaRZKJ8JosWyBpq5t4zlPO0qDfHpqbEuYK44xm4vzbZS94P/KF8BYzdtxQYLrxoS1UlnUYU7RmzqgL3y3AM7nzX/cXvJcoNXfUK2BpsB754XNyQfRmXOdRiHoC8+wwPqGkH/KCrmS4UIOqv4THfmDbrtewfcDTgKOzHxGcT1IsUq9BTxMNtxSwpHTHUXTXrzpS/UBDvrlc+9qPTqf+e6QL1aG+JT5sOg5REm2hMy0j18/Kr+HLXkehxEgJ6JrybyHUkkJrfcuWgVDu7Lv3cxlrtSMXi7TIwSB75NMoM8AE71GEVjXwpOw/0giwnmGsJNNi01ztod0UFe2V2rS+yPI1WNZIJ7Fw66U0oOKJ1rb4Iksl86n5Y2snHsxK8q5jhKaAaiWgGK5kVTAgF89t/GXYyNH6cI=
42 changes: 21 additions & 21 deletions tests/functional/auto/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ if (browserConfig.platform) {
browserDescription += `, ${browserConfig.platform}`;
}

let hostname = (onTravis) ? 'travis.dev' : '127.0.0.1';

// Launch static server
HttpServer.createServer({
showDir: false,
autoIndex: false,
root: './'
}).listen(8000, '127.0.0.1');
}).listen(8000, hostname);

const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
async function retry (attempt, numAttempts = 5, interval = 2000) {
Expand All @@ -68,11 +70,8 @@ async function retry (attempt, numAttempts = 5, interval = 2000) {
// reject with the last error
throw e;
}
return wait(interval)
.then(retry.bind(null, attempt, numAttempts, interval))
.catch(e => {
throw e;
});
await wait(interval);
return retry(attempt, numAttempts, interval);
}
}

Expand Down Expand Up @@ -241,25 +240,26 @@ describe(`testing hls.js playback in the browser on "${browserDescription}"`, fu
}

browser = browser.withCapabilities(capabilities).build();
try {
console.log('Retrieving web driver session...');
const [timeouts, session] = await Promise.all([
browser.manage().setTimeouts({ script: 75000 }),
browser.getSession()
]);
console.log(`Web driver session id: ${session.getId()}`);
if (onTravis) {
console.log(`Job URL: https://saucelabs.com/jobs/${session.getId()}`);
}
} catch (err) {
console.log(`failed setting up session: ${err}`);
}

try {
await retry(async () => {
console.log('Retrieving web driver session...');
try {
const [timeouts, session] = await Promise.all([
browser.manage().setTimeouts({ script: 75000 }),
browser.getSession()
]);
if (onTravis) {
console.log(`Job URL: https://saucelabs.com/jobs/${session.getId()}`);
} else {
console.log(`WebDriver SessionID: ${session.getId()}`);
}
} catch (err) {
throw new Error(`failed setting up session: ${err}`);
}

console.log('Loading test page...');
try {
await browser.get('http://127.0.0.1:8000/tests/functional/auto/index.html');
await browser.get(`http://${hostname}:8000/tests/functional/auto/index.html`);
} catch (e) {
throw new Error('failed to open test page');
}
Expand Down

0 comments on commit 5a7410d

Please sign in to comment.