Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java]: add docs for casting in java for chrome and edge #2077

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.regex.Pattern;
import org.junit.jupiter.api.AfterEach;
Expand All @@ -31,7 +32,6 @@ public void clearProperties() {
System.clearProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY);
System.clearProperty(ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY);
}

@Test
public void basicOptions() {
ChromeOptions options = new ChromeOptions();
Expand Down Expand Up @@ -222,4 +222,18 @@ public void setNetworkConditions() {
((ChromeDriver) driver).deleteNetworkConditions();
driver.quit();
}

@Test
public void castFeatures() {
ChromeDriver driver = new ChromeDriver();

List<Map<String, String>> sinks = driver.getCastSinks();
if (!sinks.isEmpty()) {
String sinkName = sinks.get(0).get("name");
driver.startTabMirroring(sinkName);
driver.stopCasting(sinkName);
}

driver.quit();
}
}
16 changes: 15 additions & 1 deletion examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.regex.Pattern;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chromium.ChromiumDriverLogLevel;
import org.openqa.selenium.chromium.ChromiumNetworkConditions;
import org.openqa.selenium.edge.EdgeDriver;
Expand Down Expand Up @@ -217,4 +217,18 @@ public void setNetworkConditions() {
((EdgeDriver) driver).deleteNetworkConditions();
driver.quit();
}

@Test
public void castFeatures() {
EdgeDriver driver = new EdgeDriver();

List<Map<String, String>> sinks = driver.getCastSinks();
if (!sinks.isEmpty()) {
String sinkName = sinks.get(0).get("name");
driver.startTabMirroring(sinkName);
driver.stopCasting(sinkName);
}

driver.quit();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ You can drive Chrome Cast devices, including sharing tabs

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L230-L235" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L170-L174" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Chrome Castデバイスを操作することができ、タブの共有も含ま

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L230-L235" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L170-L174" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Pode comandar dispositivos Chrome Cast, incluindo partilhar abas

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L230-L235" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L170-L174" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L230-L235" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L170-L174" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ You can drive Chrome Cast devices with Edge, including sharing tabs

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L225-L230" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L170-L174" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ Edge を使用して Chrome Cast デバイスを操作し、タブを共有す

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L225-L230" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L170-L174" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ You can drive Chrome Cast devices with Edge, including sharing tabs

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L225-L230" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L170-L174" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ You can drive Chrome Cast devices with Edge, including sharing tabs

{{< tabpane text=true >}}
{{< tab header="Java" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L225-L230" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L170-L174" >}}
Expand Down
Loading