File tree Expand file tree Collapse file tree
src/org/openqa/selenium/ie
test/org/openqa/selenium/ie Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,8 +92,7 @@ public InternetExplorerOptions() {
9292
9393 public InternetExplorerOptions (Capabilities source ) {
9494 this ();
95-
96- merge (source );
95+ source .getCapabilityNames ().forEach (name -> setCapability (name , source .getCapability (name )));
9796 }
9897
9998 @ Override
Original file line number Diff line number Diff line change 1818package org .openqa .selenium .ie ;
1919
2020import static org .assertj .core .api .Assertions .assertThat ;
21+ import static org .assertj .core .api .InstanceOfAssertFactories .LIST ;
2122import 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 ;
2225import static org .openqa .selenium .ie .InternetExplorerDriver .INITIAL_BROWSER_URL ;
2326import static org .openqa .selenium .ie .InternetExplorerDriver .INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS ;
2427import static org .openqa .selenium .ie .InternetExplorerOptions .IE_OPTIONS ;
@@ -111,4 +114,16 @@ public void shouldSetIeOptionsCapabilityWhenConstructedFromExistingCapabilities(
111114
112115 assertThat (seen .getCapability (IE_OPTIONS )).isEqualTo (expected .getCapability (IE_OPTIONS ));
113116 }
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+ }
114129}
You can’t perform that action at this time.
0 commit comments