File tree Expand file tree Collapse file tree 2 files changed +28
-11
lines changed
java/src/org/openqa/selenium/safari Expand file tree Collapse file tree 2 files changed +28
-11
lines changed Original file line number Diff line number Diff line change 2424import java .util .Optional ;
2525import org .openqa .selenium .Capabilities ;
2626import org .openqa .selenium .ImmutableCapabilities ;
27+ import org .openqa .selenium .Platform ;
2728import org .openqa .selenium .SessionNotCreatedException ;
2829import org .openqa .selenium .WebDriver ;
2930import org .openqa .selenium .WebDriverException ;
@@ -65,8 +66,12 @@ public boolean isSupportingBiDi() {
6566 @ Override
6667 public boolean isAvailable () {
6768 try {
68- DriverFinder .getPath (SafariDriverService .createDefaultService (), getCanonicalCapabilities ());
69- return true ;
69+ if (Platform .getCurrent ().is (Platform .MAC )) {
70+ DriverFinder .getPath (
71+ SafariDriverService .createDefaultService (), getCanonicalCapabilities ());
72+ return true ;
73+ }
74+ return false ;
7075 } catch (IllegalStateException | WebDriverException e ) {
7176 return false ;
7277 }
@@ -75,9 +80,12 @@ public boolean isAvailable() {
7580 @ Override
7681 public boolean isPresent () {
7782 try {
78- DriverFinder .getPath (
79- SafariDriverService .createDefaultService (), getCanonicalCapabilities (), true );
80- return true ;
83+ if (Platform .getCurrent ().is (Platform .MAC )) {
84+ DriverFinder .getPath (
85+ SafariDriverService .createDefaultService (), getCanonicalCapabilities (), true );
86+ return true ;
87+ }
88+ return false ;
8189 } catch (IllegalStateException | WebDriverException e ) {
8290 return false ;
8391 }
Original file line number Diff line number Diff line change 2424import java .util .Optional ;
2525import org .openqa .selenium .Capabilities ;
2626import org .openqa .selenium .ImmutableCapabilities ;
27+ import org .openqa .selenium .Platform ;
2728import org .openqa .selenium .SessionNotCreatedException ;
2829import org .openqa .selenium .WebDriver ;
2930import org .openqa .selenium .WebDriverException ;
@@ -66,9 +67,12 @@ public boolean isSupportingBiDi() {
6667 @ Override
6768 public boolean isAvailable () {
6869 try {
69- DriverFinder .getPath (
70- SafariTechPreviewDriverService .createDefaultService (), getCanonicalCapabilities ());
71- return true ;
70+ if (Platform .getCurrent ().is (Platform .MAC )) {
71+ DriverFinder .getPath (
72+ SafariTechPreviewDriverService .createDefaultService (), getCanonicalCapabilities ());
73+ return true ;
74+ }
75+ return false ;
7276 } catch (IllegalStateException | WebDriverException e ) {
7377 return false ;
7478 }
@@ -77,9 +81,14 @@ public boolean isAvailable() {
7781 @ Override
7882 public boolean isPresent () {
7983 try {
80- DriverFinder .getPath (
81- SafariTechPreviewDriverService .createDefaultService (), getCanonicalCapabilities (), true );
82- return true ;
84+ if (Platform .getCurrent ().is (Platform .MAC )) {
85+ DriverFinder .getPath (
86+ SafariTechPreviewDriverService .createDefaultService (),
87+ getCanonicalCapabilities (),
88+ true );
89+ return true ;
90+ }
91+ return false ;
8392 } catch (IllegalStateException | WebDriverException e ) {
8493 return false ;
8594 }
You can’t perform that action at this time.
0 commit comments