File tree 2 files changed +16
-2
lines changed
src/org/openqa/selenium/ie
test/org/openqa/selenium/ie
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,7 @@ public InternetExplorerOptions() {
92
92
93
93
public InternetExplorerOptions (Capabilities source ) {
94
94
this ();
95
-
96
- merge (source );
95
+ source .getCapabilityNames ().forEach (name -> setCapability (name , source .getCapability (name )));
97
96
}
98
97
99
98
@ Override
Original file line number Diff line number Diff line change 18
18
package org .openqa .selenium .ie ;
19
19
20
20
import static org .assertj .core .api .Assertions .assertThat ;
21
+ import static org .assertj .core .api .InstanceOfAssertFactories .LIST ;
21
22
import static org .assertj .core .api .InstanceOfAssertFactories .MAP ;
23
+ import static org .openqa .selenium .ie .InternetExplorerDriver .FORCE_CREATE_PROCESS ;
24
+ import static org .openqa .selenium .ie .InternetExplorerDriver .IE_SWITCHES ;
22
25
import static org .openqa .selenium .ie .InternetExplorerDriver .INITIAL_BROWSER_URL ;
23
26
import static org .openqa .selenium .ie .InternetExplorerDriver .INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS ;
24
27
import static org .openqa .selenium .ie .InternetExplorerOptions .IE_OPTIONS ;
@@ -111,4 +114,16 @@ public void shouldSetIeOptionsCapabilityWhenConstructedFromExistingCapabilities(
111
114
112
115
assertThat (seen .getCapability (IE_OPTIONS )).isEqualTo (expected .getCapability (IE_OPTIONS ));
113
116
}
117
+
118
+ @ Test
119
+ public void mergingOptionsMergesArguments () {
120
+ InternetExplorerOptions one = new InternetExplorerOptions ().useCreateProcessApiToLaunchIe ().addCommandSwitches ("-private" );
121
+ InternetExplorerOptions two = new InternetExplorerOptions ();
122
+ InternetExplorerOptions merged = one .merge (two );
123
+
124
+ assertThat (merged .asMap ()).asInstanceOf (MAP )
125
+ .containsEntry (FORCE_CREATE_PROCESS , true )
126
+ .extractingByKey (IE_SWITCHES ).asInstanceOf (LIST )
127
+ .containsExactly ("-private" );
128
+ }
114
129
}
You can’t perform that action at this time.
0 commit comments