forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[java] Fixing browser name and browser-specific capability prefix in …
…EdgeFilter
- Loading branch information
Showing
9 changed files
with
138 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
java/client/test/org/openqa/selenium/remote/session/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
load("@rules_jvm_external//:defs.bzl", "artifact") | ||
load("//java:defs.bzl", "java_test_suite") | ||
|
||
java_test_suite( | ||
name = "small-tests", | ||
size = "small", | ||
srcs = glob(["*.java"]), | ||
deps = [ | ||
"//java/client/src/org/openqa/selenium/chrome", | ||
"//java/client/src/org/openqa/selenium/edge", | ||
"//java/client/src/org/openqa/selenium/remote", | ||
"//java/client/test/org/openqa/selenium/testing:annotations", | ||
artifact("junit:junit"), | ||
artifact("org.assertj:assertj-core"), | ||
artifact("org.mockito:mockito-core"), | ||
], | ||
) |
47 changes: 47 additions & 0 deletions
47
java/client/test/org/openqa/selenium/remote/session/ChromeFilterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Licensed to the Software Freedom Conservancy (SFC) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The SFC licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package org.openqa.selenium.remote.session; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
import org.openqa.selenium.chrome.ChromeOptions; | ||
import org.openqa.selenium.edge.EdgeOptions; | ||
import org.openqa.selenium.testing.UnitTests; | ||
|
||
import java.util.Map; | ||
|
||
@Category(UnitTests.class) | ||
public class ChromeFilterTest { | ||
|
||
@Test | ||
public void shouldNotFilterOutChromeCapabilities() { | ||
Map<String, Object> original = new ChromeOptions().asMap(); | ||
Map<String, Object> filtered = new ChromeFilter().apply(original); | ||
assertThat(filtered).isEqualTo(original); | ||
} | ||
|
||
@Test | ||
public void shouldFilterOutNonChromeCapabilities() { | ||
Map<String, Object> original = new EdgeOptions().asMap(); | ||
Map<String, Object> filtered = new ChromeFilter().apply(original); | ||
assertThat(filtered).isNull(); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
java/client/test/org/openqa/selenium/remote/session/EdgeFilterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Licensed to the Software Freedom Conservancy (SFC) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The SFC licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package org.openqa.selenium.remote.session; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
import org.openqa.selenium.chrome.ChromeOptions; | ||
import org.openqa.selenium.edge.EdgeOptions; | ||
import org.openqa.selenium.testing.UnitTests; | ||
|
||
import java.util.Map; | ||
|
||
@Category(UnitTests.class) | ||
public class EdgeFilterTest { | ||
|
||
@Test | ||
public void shouldNotFilterOutEdgeCapabilities() { | ||
Map<String, Object> original = new EdgeOptions().asMap(); | ||
Map<String, Object> filtered = new EdgeFilter().apply(original); | ||
assertThat(filtered).isEqualTo(original); | ||
} | ||
|
||
@Test | ||
public void shouldFilterOutNonEdgeCapabilities() { | ||
Map<String, Object> original = new ChromeOptions().asMap(); | ||
Map<String, Object> filtered = new EdgeFilter().apply(original); | ||
assertThat(filtered).isNull(); | ||
} | ||
|
||
} |