Skip to content

Commit

Permalink
Merge branch 'trunk' into sadik-feature-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sadik312 authored Nov 12, 2024
2 parents ac1cf3d + 188a509 commit f16bf24
Show file tree
Hide file tree
Showing 30 changed files with 190 additions and 116 deletions.
11 changes: 10 additions & 1 deletion examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ public void TestShrinkToFit()
printOptions.ShrinkToFit = true;
bool currentShrinkToFit = printOptions.ShrinkToFit;
}
}

[TestMethod]
public void PrintWithPrintsPageTest()
{
WebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.selenium.dev/");
PrintOptions printOptions = new PrintOptions();
PrintDocument printedPage = driver.Print(printOptions);
Assert.IsTrue(printedPage.AsBase64EncodedString.StartsWith("JVBER"));
}
}
}
2 changes: 1 addition & 1 deletion examples/java/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
19 changes: 19 additions & 0 deletions examples/python/tests/browsers/test_chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,22 @@ def test_build_checks(capfd):
assert expected in err

driver.quit()


def test_set_network_conditions():
driver = webdriver.Chrome()

network_conditions = {
"offline": False,
"latency": 20, # 20 ms of latency
"download_throughput": 2000 * 1024 / 8, # 2000 kbps
"upload_throughput": 2000 * 1024 / 8, # 2000 kbps
}
driver.set_network_conditions(**network_conditions)

driver.get("https://www.selenium.dev")

# check whether the network conditions are set
assert driver.get_network_conditions() == network_conditions

driver.quit()
18 changes: 18 additions & 0 deletions examples/python/tests/browsers/test_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,21 @@ def test_build_checks(log_path):

driver.quit()


def test_set_network_conditions():
driver = webdriver.Edge()

network_conditions = {
"offline": False,
"latency": 20, # 20 ms of latency
"download_throughput": 2000 * 1024 / 8, # 2000 kbps
"upload_throughput": 2000 * 1024 / 8, # 2000 kbps
}
driver.set_network_conditions(**network_conditions)

driver.get("https://www.selenium.dev")

# check whether the network conditions are set
assert driver.get_network_conditions() == network_conditions

driver.quit()
2 changes: 0 additions & 2 deletions website_and_docs/assets/scss/_links.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.selenium-link {
color: $primary;
border-bottom: 2px solid;
transition: 0.3s;
}

Expand All @@ -10,7 +9,6 @@

p > a, main a, div > a {
color: $primary !important;
border-bottom: 2px solid;
transition: 0.3s;
}

Expand Down
13 changes: 7 additions & 6 deletions website_and_docs/content/documentation/selenium_manager.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,21 @@ sudo apt-get install libatk-bridge2.0-0
It's possible to use an environment variable to specify the driver path without using Selenium Manager.
The following environment variables are supported:

* SE_CHROMEDRIVER
* SE_EDGEDRIVER
* SE_GECKODRIVER
* SE_IEDRIVER
* SE_SAFARIDRIVER
* `SE_CHROMEDRIVER`
* `SE_EDGEDRIVER`
* `SE_GECKODRIVER`
* `SE_IEDRIVER`
* `SE_SAFARIDRIVER`

For example, to specify the path to the chromedriver,
you can set the `SE_CHROMEDRIVER` environment variable to the path of the chromedriver executable.
The following bindings allow you to specify the driver path using an environment variable:

* Ruby
* Java
* Python

This feature is available in the Selenium Ruby binding starting from version 4.25.0.
This feature is available in the Selenium Ruby binding starting from version 4.25.0 and in the Python binding from version 4.26.0.

## Building a Custom Selenium Manager
In order to build your own custom Selenium Manager that works in an architecture we don't currently support, you can
Expand Down
13 changes: 7 additions & 6 deletions website_and_docs/content/documentation/selenium_manager.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,21 @@ sudo apt-get install libatk-bridge2.0-0
It's possible to use an environment variable to specify the driver path without using Selenium Manager.
The following environment variables are supported:

* SE_CHROMEDRIVER
* SE_EDGEDRIVER
* SE_GECKODRIVER
* SE_IEDRIVER
* SE_SAFARIDRIVER
* `SE_CHROMEDRIVER`
* `SE_EDGEDRIVER`
* `SE_GECKODRIVER`
* `SE_IEDRIVER`
* `SE_SAFARIDRIVER`

For example, to specify the path to the chromedriver,
you can set the `SE_CHROMEDRIVER` environment variable to the path of the chromedriver executable.
The following bindings allow you to specify the driver path using an environment variable:

* Ruby
* Java
* Python

This feature is available in the Selenium Ruby binding starting from version 4.25.0.
This feature is available in the Selenium Ruby binding starting from version 4.25.0 and in the Python binding from version 4.26.0.

## Building a Custom Selenium Manager
In order to build your own custom Selenium Manager that works in an architecture we don't currently support, you can
Expand Down
13 changes: 7 additions & 6 deletions website_and_docs/content/documentation/selenium_manager.pt-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,21 @@ sudo apt-get install libatk-bridge2.0-0
It's possible to use an environment variable to specify the driver path without using Selenium Manager.
The following environment variables are supported:

* SE_CHROMEDRIVER
* SE_EDGEDRIVER
* SE_GECKODRIVER
* SE_IEDRIVER
* SE_SAFARIDRIVER
* `SE_CHROMEDRIVER`
* `SE_EDGEDRIVER`
* `SE_GECKODRIVER`
* `SE_IEDRIVER`
* `SE_SAFARIDRIVER`

For example, to specify the path to the chromedriver,
you can set the `SE_CHROMEDRIVER` environment variable to the path of the chromedriver executable.
The following bindings allow you to specify the driver path using an environment variable:

* Ruby
* Java
* Python

This feature is available in the Selenium Ruby binding starting from version 4.25.0.
This feature is available in the Selenium Ruby binding starting from version 4.25.0 and in the Python binding from version 4.26.0.

## Building a Custom Selenium Manager
In order to build your own custom Selenium Manager that works in an architecture we don't currently support, you can
Expand Down
13 changes: 7 additions & 6 deletions website_and_docs/content/documentation/selenium_manager.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,21 @@ sudo apt-get install libatk-bridge2.0-0
It's possible to use an environment variable to specify the driver path without using Selenium Manager.
The following environment variables are supported:

* SE_CHROMEDRIVER
* SE_EDGEDRIVER
* SE_GECKODRIVER
* SE_IEDRIVER
* SE_SAFARIDRIVER
* `SE_CHROMEDRIVER`
* `SE_EDGEDRIVER`
* `SE_GECKODRIVER`
* `SE_IEDRIVER`
* `SE_SAFARIDRIVER`

For example, to specify the path to the chromedriver,
you can set the `SE_CHROMEDRIVER` environment variable to the path of the chromedriver executable.
The following bindings allow you to specify the driver path using an environment variable:

* Ruby
* Java
* Python

This feature is available in the Selenium Ruby binding starting from version 4.25.0.
This feature is available in the Selenium Ruby binding starting from version 4.25.0 and in the Python binding from version 4.26.0.

## Building a Custom Selenium Manager
In order to build your own custom Selenium Manager that works in an architecture we don't currently support, you can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ You can simulate various network conditions.
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L129-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ Chrome Castデバイスを操作することができ、タブの共有も含ま
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L129-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ please refer to the
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L129-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L129-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ You can simulate various network conditions.
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L129-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ Edge を使用して Chrome Cast デバイスを操作し、タブを共有す
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L129-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ You can simulate various network conditions.
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L129-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ You can simulate various network conditions.
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L129-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b
{{< /tabpane >}}

### ShrinkToFit
Using `getBackground()` and `setBackground()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
Using `getShrinkToFit()` and `setShrinkToFit()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.

{{< tabpane text=true >}}
{{< tab header="Java" >}}
Expand Down Expand Up @@ -205,7 +205,7 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L35-L42" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b
{{< /tabpane >}}

### ShrinkToFit
Using `getBackground()` and `setBackground()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
Using `getShrinkToFit()` and `setShrinkToFit()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.

{{< tabpane text=true >}}
{{< tab header="Java" >}}
Expand Down Expand Up @@ -205,7 +205,7 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L35-L42" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b
{{< /tabpane >}}

### ShrinkToFit
Using `getBackground()` and `setBackground()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
Using `getShrinkToFit()` and `setShrinkToFit()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.

{{< tabpane text=true >}}
{{< tab header="Java" >}}
Expand Down Expand Up @@ -205,7 +205,7 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L35-L42" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
Expand Down
Loading

0 comments on commit f16bf24

Please sign in to comment.