1717
1818package org .openqa .selenium .ie ;
1919
20- import static org .assertj .core .api .Assertions .assertThat ;
21- import static org .assertj .core .api .InstanceOfAssertFactories .LIST ;
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 ;
25- import static org .openqa .selenium .ie .InternetExplorerDriver .INITIAL_BROWSER_URL ;
26- import static org .openqa .selenium .ie .InternetExplorerDriver .INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS ;
27- import static org .openqa .selenium .ie .InternetExplorerOptions .IE_OPTIONS ;
28-
29- import org .junit .jupiter .api .Test ;
3020import org .junit .jupiter .api .Tag ;
21+ import org .junit .jupiter .api .Test ;
3122import org .openqa .selenium .Capabilities ;
3223import org .openqa .selenium .ImmutableCapabilities ;
3324import org .openqa .selenium .Platform ;
3627
3728import java .util .Map ;
3829
30+ import static org .assertj .core .api .Assertions .assertThat ;
31+ import static org .assertj .core .api .InstanceOfAssertFactories .MAP ;
32+ import static org .openqa .selenium .ie .InternetExplorerDriver .FORCE_CREATE_PROCESS ;
33+ import static org .openqa .selenium .ie .InternetExplorerDriver .IE_SWITCHES ;
34+ import static org .openqa .selenium .ie .InternetExplorerDriver .INITIAL_BROWSER_URL ;
35+ import static org .openqa .selenium .ie .InternetExplorerDriver .INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS ;
36+ import static org .openqa .selenium .ie .InternetExplorerOptions .IE_OPTIONS ;
37+
3938@ Tag ("UnitTests" )
4039public class InternetExplorerOptionsTest {
4140
@@ -51,26 +50,27 @@ public void shouldAllowACapabilityToBeSet() {
5150 public void shouldMirrorCapabilitiesForIeProperly () {
5251 String expected = "http://cheese.example.com" ;
5352 InternetExplorerOptions options = new InternetExplorerOptions ()
54- .withInitialBrowserUrl (expected );
53+ .withInitialBrowserUrl (expected );
5554
5655 Map <String , Object > map = options .asMap ();
5756
58- assertThat (map ).containsEntry (INITIAL_BROWSER_URL , expected );
59- assertThat (map ).containsKey ("se:ieOptions" );
60- assertThat (map .get ("se:ieOptions" )).asInstanceOf (MAP )
61- .containsEntry (INITIAL_BROWSER_URL , expected );
57+ assertThat (map ).containsKey (IE_OPTIONS );
58+ assertThat (map .get (IE_OPTIONS )).asInstanceOf (MAP )
59+ .containsEntry (INITIAL_BROWSER_URL , expected );
6260 }
6361
6462 @ Test
6563 public void shouldMirrorCapabilitiesFromPassedInIeOptions () {
6664 InternetExplorerOptions toMirror = new InternetExplorerOptions ()
67- .introduceFlakinessByIgnoringSecurityDomains ();
65+ .introduceFlakinessByIgnoringSecurityDomains ();
6866
6967 // This is damn weird.
7068 InternetExplorerOptions options = new InternetExplorerOptions ();
71- options .setCapability ("se:ieOptions" , toMirror );
69+ options .setCapability (IE_OPTIONS , toMirror );
7270
73- assertThat (options .is (INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS )).isTrue ();
71+ Map <String , Object > map = options .asMap ();
72+ assertThat (map .get (IE_OPTIONS )).asInstanceOf (MAP )
73+ .containsEntry (INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS , true );
7474 }
7575
7676 @ Test
@@ -80,8 +80,7 @@ public void shouldPopulateIeOptionsFromExistingCapabilitiesWhichLackThem() {
8080
8181 InternetExplorerOptions options = new InternetExplorerOptions (caps );
8282
83- assertThat (options .is (INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS )).isTrue ();
84- assertThat (options .getCapability ("se:ieOptions" )).asInstanceOf (MAP )
83+ assertThat (options .getCapability (IE_OPTIONS )).asInstanceOf (MAP )
8584 .containsEntry (INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS , true );
8685 }
8786
@@ -116,15 +115,13 @@ public void shouldSetIeOptionsCapabilityWhenConstructedFromExistingCapabilities(
116115
117116 @ Test
118117 public void mergingOptionsMergesArguments () {
119- InternetExplorerOptions one = new InternetExplorerOptions ().useCreateProcessApiToLaunchIe ().addCommandSwitches ("-private" );
118+ InternetExplorerOptions one = new InternetExplorerOptions ()
119+ .useCreateProcessApiToLaunchIe ()
120+ .addCommandSwitches ("-private" );
120121 InternetExplorerOptions two = new InternetExplorerOptions ();
121- InternetExplorerOptions merged = one .merge (two );
122+ InternetExplorerOptions merged = two .merge (one );
122123
123124 Map <String , Object > asMap = merged .asMap ();
124- assertThat (asMap )
125- .containsEntry (FORCE_CREATE_PROCESS , true )
126- .extractingByKey (IE_SWITCHES ).asInstanceOf (LIST )
127- .containsExactly ("-private" );
128125 assertThat (asMap )
129126 .extractingByKey (IE_OPTIONS ).asInstanceOf (MAP )
130127 .containsEntry (FORCE_CREATE_PROCESS , true )
0 commit comments