@@ -18,7 +18,7 @@ public class OptionsTest extends BaseTest {
18
18
19
19
@ Test
20
20
public void setPageLoadStrategyNormal () {
21
- ChromeOptions chromeOptions = new ChromeOptions ();
21
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
22
22
chromeOptions .setPageLoadStrategy (PageLoadStrategy .NORMAL );
23
23
WebDriver driver = new ChromeDriver (chromeOptions );
24
24
try {
@@ -31,7 +31,7 @@ public void setPageLoadStrategyNormal() {
31
31
32
32
@ Test
33
33
public void setPageLoadStrategyEager () {
34
- ChromeOptions chromeOptions = new ChromeOptions ();
34
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
35
35
chromeOptions .setPageLoadStrategy (PageLoadStrategy .EAGER );
36
36
WebDriver driver = new ChromeDriver (chromeOptions );
37
37
try {
@@ -44,7 +44,7 @@ public void setPageLoadStrategyEager() {
44
44
45
45
@ Test
46
46
public void setPageLoadStrategyNone () {
47
- ChromeOptions chromeOptions = new ChromeOptions ();
47
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
48
48
chromeOptions .setPageLoadStrategy (PageLoadStrategy .NONE );
49
49
WebDriver driver = new ChromeDriver (chromeOptions );
50
50
try {
@@ -57,7 +57,7 @@ public void setPageLoadStrategyNone() {
57
57
58
58
@ Test
59
59
public void setAcceptInsecureCerts () {
60
- ChromeOptions chromeOptions = new ChromeOptions ();
60
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
61
61
chromeOptions .setAcceptInsecureCerts (true );
62
62
WebDriver driver = new ChromeDriver (chromeOptions );
63
63
try {
@@ -70,30 +70,30 @@ public void setAcceptInsecureCerts() {
70
70
71
71
@ Test
72
72
public void getBrowserName () {
73
- ChromeOptions chromeOptions = new ChromeOptions ();
73
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
74
74
String name = chromeOptions .getBrowserName ();
75
75
Assertions .assertFalse (name .isEmpty (), "Browser name should not be empty" );
76
76
}
77
77
78
78
@ Test
79
79
public void setBrowserVersion () {
80
- ChromeOptions chromeOptions = new ChromeOptions ();
80
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
81
81
String version = "latest" ;
82
82
chromeOptions .setBrowserVersion (version );
83
83
Assertions .assertEquals (version , chromeOptions .getBrowserVersion ());
84
84
}
85
85
86
86
@ Test
87
87
public void setPlatformName () {
88
- ChromeOptions chromeOptions = new ChromeOptions ();
88
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
89
89
String platform = "OS X 10.6" ;
90
90
chromeOptions .setPlatformName (platform );
91
91
Assertions .assertEquals (platform , chromeOptions .getPlatformName ().toString ());
92
92
}
93
93
94
94
@ Test
95
95
public void setScriptTimeout () {
96
- ChromeOptions chromeOptions = new ChromeOptions ();
96
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
97
97
Duration duration = Duration .of (5 , ChronoUnit .SECONDS );
98
98
chromeOptions .setScriptTimeout (duration );
99
99
@@ -108,7 +108,7 @@ public void setScriptTimeout() {
108
108
109
109
@ Test
110
110
public void setPageLoadTimeout () {
111
- ChromeOptions chromeOptions = new ChromeOptions ();
111
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
112
112
Duration duration = Duration .of (5 , ChronoUnit .SECONDS );
113
113
chromeOptions .setPageLoadTimeout (duration );
114
114
@@ -123,7 +123,7 @@ public void setPageLoadTimeout() {
123
123
124
124
@ Test
125
125
public void setImplicitWaitTimeout () {
126
- ChromeOptions chromeOptions = new ChromeOptions ();
126
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
127
127
Duration duration = Duration .of (5 , ChronoUnit .SECONDS );
128
128
chromeOptions .setImplicitWaitTimeout (duration );
129
129
@@ -138,7 +138,7 @@ public void setImplicitWaitTimeout() {
138
138
139
139
@ Test
140
140
public void setUnhandledPromptBehaviour () {
141
- ChromeOptions chromeOptions = new ChromeOptions ();
141
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
142
142
chromeOptions .setUnhandledPromptBehaviour (UnexpectedAlertBehaviour .DISMISS_AND_NOTIFY );
143
143
//verify the capability object is not null
144
144
Object capabilityObject = chromeOptions .getCapability (CapabilityType .UNHANDLED_PROMPT_BEHAVIOUR );
@@ -148,7 +148,7 @@ public void setUnhandledPromptBehaviour() {
148
148
149
149
@ Test
150
150
public void setWindowRect () {
151
- ChromeOptions chromeOptions = new ChromeOptions ();
151
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
152
152
chromeOptions .setCapability (CapabilityType .SET_WINDOW_RECT , true );
153
153
//verify the capability object is not null
154
154
Object capabilityObject = chromeOptions .getCapability (CapabilityType .SET_WINDOW_RECT );
@@ -160,7 +160,7 @@ public void setWindowRect() {
160
160
161
161
@ Test
162
162
public void setStrictFileInteractability () {
163
- ChromeOptions chromeOptions = new ChromeOptions ();
163
+ ChromeOptions chromeOptions = getDefaultChromeOptions ();
164
164
chromeOptions .setCapability (CapabilityType .STRICT_FILE_INTERACTABILITY , true );
165
165
//verify the capability object is not null
166
166
Object capabilityObject = chromeOptions .getCapability (CapabilityType .STRICT_FILE_INTERACTABILITY );
0 commit comments