Skip to content

Commit

Permalink
Add temp fix for Safari 12+ (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwalton authored and Matt Gaunt committed Feb 4, 2019
1 parent bb49000 commit 554796a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/local-browsers/safari.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

const fs = require('fs');
const webdriver = require('selenium-webdriver');
const safari = require('selenium-webdriver/safari');

const LocalBrowser = require('../browser-models/local-browser.js');
const SafariConfig = require('../webdriver-config/safari.js');
Expand Down Expand Up @@ -54,12 +55,19 @@ class LocalSafariBrowser extends LocalBrowser {
const seleniumOptions = this.getSeleniumOptions();
seleniumOptions.setTechnologyPreview((this._release === 'beta'));

const builder = new webdriver
let builder = new webdriver
.Builder()
.withCapabilities(this._capabilities)
.forBrowser(this.getId())
.setSafariOptions(seleniumOptions);

// Run safari 12+ in legacy mode until this is resolved:
// https://github.com/SeleniumHQ/selenium/issues/6026
if (this.getVersionNumber() >= 12) {
builder = builder.usingServer(
new safari.ServiceBuilder().addArguments('--legacy').build().start());
}

return builder;
}

Expand Down

0 comments on commit 554796a

Please sign in to comment.