Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createTestRunner(browser, category, useHttp2) {
function run(url, script) {
return Promise.resolve(script).then(script =>
runner
.loadAndWait(url, 'return window.performance.timing.loadEventEnd>0')
.then(() => runner.runScript(script))
);
}
const runner = new browsertime.SeleniumRunner({
browser: browser,
timeouts: {
browserStart: 60000
}
});
let baseUrl;
return {
start() {
return webserver
.startServer(useHttp2)
.then(address => {
baseUrl = urlParser.format({
protocol: useHttp2 ? 'https' : 'http',
hostname: address.address,
start: function(browser) {
bt.logging.configure({});
runner = new bt.SeleniumRunner({
browser: browser,
'timeouts': {
'browserStart': 20000
}
});
return runner.start();
},
stop: function() {
start: function(browser) {
bt.logging.configure({});
runner = new bt.SeleniumRunner({
browser: browser,
'timeouts': {
'browserStart': 20000
}
});
return runner.start();
},
stop: function() {