|
21 | 21 | import static org.assertj.core.api.InstanceOfAssertFactories.LIST; |
22 | 22 | import static org.assertj.core.api.InstanceOfAssertFactories.MAP; |
23 | 23 | import static org.assertj.core.api.InstanceOfAssertFactories.STRING; |
| 24 | +import static org.openqa.selenium.edge.EdgeOptions.WEBVIEW2_BROWSER_NAME; |
24 | 25 | import static org.openqa.selenium.remote.Browser.EDGE; |
25 | 26 | import static org.openqa.selenium.remote.CapabilityType.ACCEPT_INSECURE_CERTS; |
26 | 27 |
|
@@ -92,12 +93,9 @@ void canAddExtensions() throws IOException { |
92 | 93 | @Test |
93 | 94 | void canMergeWithoutChangingOriginalObject() { |
94 | 95 | EdgeOptions options = new EdgeOptions(); |
95 | | - Map<String, Object> before = options.asMap(); |
96 | 96 | EdgeOptions merged = |
97 | 97 | options.merge( |
98 | 98 | new ImmutableCapabilities(CapabilityType.PAGE_LOAD_STRATEGY, PageLoadStrategy.NONE)); |
99 | | - // TODO: assertThat(merged).isNotSameAs(options); |
100 | | - // TODO: assertThat(options.asMap()).isEqualTo(before); |
101 | 99 | assertThat(merged.getCapability(CapabilityType.PAGE_LOAD_STRATEGY)) |
102 | 100 | .isEqualTo(PageLoadStrategy.NONE); |
103 | 101 | } |
@@ -265,4 +263,14 @@ void mergingOptionsMergesArguments() { |
265 | 263 | .asInstanceOf(LIST) |
266 | 264 | .containsExactly("verbose", "silent"); |
267 | 265 | } |
| 266 | + |
| 267 | + @Test |
| 268 | + void usingWebView2ChangesBrowserName() { |
| 269 | + EdgeOptions options = new EdgeOptions(); |
| 270 | + assertThat(options.getBrowserName()).isEqualTo(EDGE.browserName()); |
| 271 | + options.useWebView(true); |
| 272 | + assertThat(options.getBrowserName()).isEqualTo(WEBVIEW2_BROWSER_NAME); |
| 273 | + options.useWebView(false); |
| 274 | + assertThat(options.getBrowserName()).isEqualTo(EDGE.browserName()); |
| 275 | + } |
268 | 276 | } |
0 commit comments