Skip to content

Commit

Permalink
Adding a system property that allows to run tests in Safari technolog…
Browse files Browse the repository at this point in the history
…y preview
  • Loading branch information
barancev committed Feb 27, 2018
1 parent 6cb70c5 commit 2d7b1c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions java/client/src/org/openqa/selenium/safari/SafariOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public SafariOptions merge(Capabilities extraCapabilities) {
*/
public static SafariOptions fromCapabilities(Capabilities capabilities)
throws WebDriverException {
if (capabilities instanceof SafariOptions) {
return (SafariOptions) capabilities;
}
Object cap = capabilities.getCapability(SafariOptions.CAPABILITY);
if (cap instanceof SafariOptions) {
return (SafariOptions) cap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ public class WebDriverBuilder implements Supplier<WebDriver> {
})
.put(Browser.htmlunit, DesiredCapabilities::htmlUnit)
.put(Browser.operablink, OperaOptions::new)
.put(Browser.safari, SafariOptions::new)
.put(Browser.safari, () -> {
SafariOptions options = new SafariOptions();
if (Boolean.getBoolean("selenium.safari.tp")) {
options.setUseTechnologyPreview(true);
}
return options;
})
.build();

public static Capabilities getStandardCapabilitiesFor(Browser browser) {
Expand Down

0 comments on commit 2d7b1c3

Please sign in to comment.