24
24
import org .junit .After ;
25
25
import org .junit .Test ;
26
26
import org .openqa .selenium .By ;
27
+ import org .openqa .selenium .HasCapabilities ;
28
+ import org .openqa .selenium .JavascriptExecutor ;
27
29
import org .openqa .selenium .Keys ;
30
+ import org .openqa .selenium .WebDriver ;
28
31
import org .openqa .selenium .build .InProject ;
29
32
import org .openqa .selenium .support .ui .WebDriverWait ;
30
33
import org .openqa .selenium .testing .JUnit4TestBase ;
34
+ import org .openqa .selenium .testing .NotYetImplemented ;
35
+ import org .openqa .selenium .testing .drivers .WebDriverBuilder ;
31
36
32
37
import java .io .IOException ;
33
38
import java .nio .file .Files ;
@@ -38,7 +43,7 @@ public class EdgeOptionsFunctionalTest extends JUnit4TestBase {
38
43
39
44
private static final String EXT_PATH = "third_party/chrome_ext/backspace.crx" ;
40
45
41
- private EdgeDriver edgeDriver = null ;
46
+ private WebDriver edgeDriver = null ;
42
47
43
48
@ After
44
49
public void tearDown () {
@@ -51,10 +56,10 @@ public void tearDown() {
51
56
public void canStartChromeWithCustomOptions () {
52
57
EdgeOptions options = new EdgeOptions ();
53
58
options .addArguments ("user-agent=foo;bar" );
54
- edgeDriver = new EdgeDriver (options );
59
+ edgeDriver = new WebDriverBuilder (). get (options );
55
60
56
61
edgeDriver .get (pages .clickJacker );
57
- Object userAgent = edgeDriver .executeScript ("return window.navigator.userAgent" );
62
+ Object userAgent = (( JavascriptExecutor ) edgeDriver ) .executeScript ("return window.navigator.userAgent" );
58
63
assertThat (userAgent ).isEqualTo ("foo;bar" );
59
64
}
60
65
@@ -71,17 +76,18 @@ public void optionsStayEqualAfterSerialization() {
71
76
public void canSetAcceptInsecureCerts () {
72
77
EdgeOptions options = new EdgeOptions ();
73
78
options .setAcceptInsecureCerts (true );
74
- edgeDriver = new EdgeDriver (options );
75
- System .out .println (edgeDriver .getCapabilities ());
79
+ edgeDriver = new WebDriverBuilder (). get (options );
80
+ System .out .println ((( HasCapabilities ) edgeDriver ) .getCapabilities ());
76
81
77
- assertThat (edgeDriver .getCapabilities ().getCapability (ACCEPT_INSECURE_CERTS )).isEqualTo (true );
82
+ assertThat ((( HasCapabilities ) edgeDriver ) .getCapabilities ().getCapability (ACCEPT_INSECURE_CERTS )).isEqualTo (true );
78
83
}
79
84
80
85
@ Test
86
+ @ NotYetImplemented
81
87
public void canAddExtensionFromFile () {
82
88
EdgeOptions options = new EdgeOptions ();
83
89
options .addExtensions (InProject .locate (EXT_PATH ).toFile ());
84
- edgeDriver = new EdgeDriver (options );
90
+ edgeDriver = new WebDriverBuilder (). get (options );
85
91
86
92
edgeDriver .get (pages .clicksPage );
87
93
@@ -93,11 +99,12 @@ public void canAddExtensionFromFile() {
93
99
}
94
100
95
101
@ Test
102
+ @ NotYetImplemented
96
103
public void canAddExtensionFromStringEncodedInBase64 () throws IOException {
97
104
EdgeOptions options = new EdgeOptions ();
98
105
options .addEncodedExtensions (Base64 .getEncoder ().encodeToString (
99
106
Files .readAllBytes (InProject .locate (EXT_PATH ))));
100
- edgeDriver = new EdgeDriver (options );
107
+ edgeDriver = new WebDriverBuilder (). get (options );
101
108
102
109
edgeDriver .get (pages .clicksPage );
103
110
0 commit comments