From f23e80a0abc7ee38a5cad39181e61180b79440d6 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 13 Nov 2024 10:14:21 +0100 Subject: [PATCH 01/18] Showing OpenCollective sponsors (#2061) [deploy site] --- website_and_docs/content/sponsors/_index.html | 4 ++-- .../layouts/partials/open-collective-level-sponsors.html | 7 +++++++ website_and_docs/layouts/sponsors/list.html | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 website_and_docs/layouts/partials/open-collective-level-sponsors.html diff --git a/website_and_docs/content/sponsors/_index.html b/website_and_docs/content/sponsors/_index.html index 2fcc33ca15ce..a19ec3257e97 100644 --- a/website_and_docs/content/sponsors/_index.html +++ b/website_and_docs/content/sponsors/_index.html @@ -15,7 +15,7 @@

Sponsors

The following companies have sponsored the Selenium project. We thank - each and every one of them for their generous support. + each one of them for their generous support.

-{{< /blocks/section >}} \ No newline at end of file +{{< /blocks/section >}} diff --git a/website_and_docs/layouts/partials/open-collective-level-sponsors.html b/website_and_docs/layouts/partials/open-collective-level-sponsors.html new file mode 100644 index 000000000000..dbfee02a4636 --- /dev/null +++ b/website_and_docs/layouts/partials/open-collective-level-sponsors.html @@ -0,0 +1,7 @@ +
+

OpenCollective Sponsors

+
+ +
+ +
diff --git a/website_and_docs/layouts/sponsors/list.html b/website_and_docs/layouts/sponsors/list.html index 3aa700711bc5..022c25074770 100644 --- a/website_and_docs/layouts/sponsors/list.html +++ b/website_and_docs/layouts/sponsors/list.html @@ -11,6 +11,7 @@ {{ partial "gold-level-sponsors.html" (dict "Data" $.Site.Data) }} {{ partial "silver-level-sponsors.html" (dict "Data" $.Site.Data) }} {{ partial "bronze-level-sponsors.html" (dict "Data" $.Site.Data) }} +{{ partial "open-collective-level-sponsors.html" }}
@@ -24,4 +25,5 @@

Sponsoring

+ {{ end }} From 98499edc102daa650437b0eecae1a0990c58b114 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 13 Nov 2024 10:29:38 +0100 Subject: [PATCH 02/18] Adding IDs to all levels [deploy site] --- website_and_docs/layouts/partials/bronze-level-sponsors.html | 2 +- .../layouts/partials/development-level-sponsors.html | 2 +- website_and_docs/layouts/partials/gold-level-sponsors.html | 2 +- .../layouts/partials/open-collective-level-sponsors.html | 2 +- website_and_docs/layouts/partials/platinum-level-sponsors.html | 2 +- website_and_docs/layouts/partials/selenium-level-sponsors.html | 2 +- website_and_docs/layouts/partials/silver-level-sponsors.html | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/website_and_docs/layouts/partials/bronze-level-sponsors.html b/website_and_docs/layouts/partials/bronze-level-sponsors.html index 3b6d3ddbbf19..3b0b924c5811 100644 --- a/website_and_docs/layouts/partials/bronze-level-sponsors.html +++ b/website_and_docs/layouts/partials/bronze-level-sponsors.html @@ -1,6 +1,6 @@ {{ if .Data.sponsors.bronze.enable }}
-

Bronze Level Sponsors

+

Bronze Level Sponsors

{{ range .Data.sponsors.bronze.item }} diff --git a/website_and_docs/layouts/partials/development-level-sponsors.html b/website_and_docs/layouts/partials/development-level-sponsors.html index b30c73e60ebe..cb411082497f 100644 --- a/website_and_docs/layouts/partials/development-level-sponsors.html +++ b/website_and_docs/layouts/partials/development-level-sponsors.html @@ -1,6 +1,6 @@ {{ if .Data.sponsors.selenium.enable }}
-

Development Partners

+

Development Partners

{{ range .Data.sponsors.development.item }} diff --git a/website_and_docs/layouts/partials/gold-level-sponsors.html b/website_and_docs/layouts/partials/gold-level-sponsors.html index 968347f544d7..327308ed4d26 100644 --- a/website_and_docs/layouts/partials/gold-level-sponsors.html +++ b/website_and_docs/layouts/partials/gold-level-sponsors.html @@ -1,6 +1,6 @@ {{ if .Data.sponsors.gold.enable }}
-

Gold Level Sponsors

+

Gold Level Sponsors

{{ range .Data.sponsors.gold.item }} diff --git a/website_and_docs/layouts/partials/open-collective-level-sponsors.html b/website_and_docs/layouts/partials/open-collective-level-sponsors.html index dbfee02a4636..ae0b7078916f 100644 --- a/website_and_docs/layouts/partials/open-collective-level-sponsors.html +++ b/website_and_docs/layouts/partials/open-collective-level-sponsors.html @@ -1,5 +1,5 @@
-

OpenCollective Sponsors

+

OpenCollective Sponsors

diff --git a/website_and_docs/layouts/partials/platinum-level-sponsors.html b/website_and_docs/layouts/partials/platinum-level-sponsors.html index 076f80473ab3..5ae5cf1f3c67 100644 --- a/website_and_docs/layouts/partials/platinum-level-sponsors.html +++ b/website_and_docs/layouts/partials/platinum-level-sponsors.html @@ -1,6 +1,6 @@ {{ if .Data.sponsors.platinum.enable }}
-

Platinum Level Sponsors

+

Platinum Level Sponsors

{{ range .Data.sponsors.platinum.item }} diff --git a/website_and_docs/layouts/partials/selenium-level-sponsors.html b/website_and_docs/layouts/partials/selenium-level-sponsors.html index 599d1a02acfa..25b71c321787 100644 --- a/website_and_docs/layouts/partials/selenium-level-sponsors.html +++ b/website_and_docs/layouts/partials/selenium-level-sponsors.html @@ -1,6 +1,6 @@ {{ if .Data.sponsors.selenium.enable }}
-

Selenium Level Sponsors

+

Selenium Level Sponsors

{{ range .Data.sponsors.selenium.item }} diff --git a/website_and_docs/layouts/partials/silver-level-sponsors.html b/website_and_docs/layouts/partials/silver-level-sponsors.html index 37bb402237de..011397353227 100644 --- a/website_and_docs/layouts/partials/silver-level-sponsors.html +++ b/website_and_docs/layouts/partials/silver-level-sponsors.html @@ -1,6 +1,6 @@ {{ if .Data.sponsors.silver.enable }}
-

Silver Level Sponsors

+

Silver Level Sponsors

{{ range .Data.sponsors.silver.item }} From c358fe82f834cc9202c9afea8bed4bdc2d3440a0 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 13 Nov 2024 12:18:36 +0100 Subject: [PATCH 03/18] Adding Boni to the TLC (#2062) [deploy site] --- website_and_docs/content/project/structure/_index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/website_and_docs/content/project/structure/_index.html b/website_and_docs/content/project/structure/_index.html index f14d9ef9a940..0f97c7254178 100644 --- a/website_and_docs/content/project/structure/_index.html +++ b/website_and_docs/content/project/structure/_index.html @@ -41,6 +41,7 @@

Technical Leadership Committee

{{< gh-user "https://api.github.com/users/p0deje" >}} {{< gh-user "https://api.github.com/users/pujagani" >}} {{< gh-user "https://api.github.com/users/Harsha509" >}} + {{< gh-user "https://api.github.com/users/bonigarcia" >}}
From 25f35c043db86caa3fd764de633ed5c64e2435bf Mon Sep 17 00:00:00 2001 From: Swastik Baranwal Date: Thu, 14 Nov 2024 22:02:27 +0530 Subject: [PATCH 04/18] [java] add safari technlogy preview code snippet (#2059) * initial commit * remove test attr --- .../src/test/java/dev/selenium/browsers/SafariTest.java | 6 ++++++ .../content/documentation/webdriver/browsers/safari.en.md | 2 +- .../content/documentation/webdriver/browsers/safari.ja.md | 2 +- .../documentation/webdriver/browsers/safari.pt-br.md | 2 +- .../documentation/webdriver/browsers/safari.zh-cn.md | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/java/src/test/java/dev/selenium/browsers/SafariTest.java b/examples/java/src/test/java/dev/selenium/browsers/SafariTest.java index 7e12aa362699..a579b2170e44 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/SafariTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/SafariTest.java @@ -33,4 +33,10 @@ public void enableLogs() { driver = new SafariDriver(service); } + + public void safariTechnologyPreview() { + SafariOptions options = new SafariOptions(); + options.setUseTechnologyPreview(true); + driver = new SafariDriver(options); + } } diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md index d54f928d2580..51941f5102f5 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md @@ -93,7 +93,7 @@ Apple provides a development version of their browser — [Safari Technology Pre {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/SafariTest.java#L39-L40" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/browsers/test_safari.py#L25-L30" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md index 86a427ecbff6..d02e944514b4 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md @@ -93,7 +93,7 @@ To use this version in your code: {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/SafariTest.java#L39-L40" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/browsers/test_safari.py#L25-L30" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md index 7def4aa1c493..f2cf26866aff 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md @@ -93,7 +93,7 @@ To use this version in your code: {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/SafariTest.java#L39-L40" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/browsers/test_safari.py#L25-L30" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md index 07b63b1543b4..ad9945439a0b 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md @@ -97,7 +97,7 @@ Apple 提供了其浏览器的开发版本 — [Safari Technology Preview](https {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/SafariTest.java#L39-L40" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/browsers/test_safari.py#L25-L30" >}} From 9d66c2213761156091d7e7b8d1e08bafb5217d58 Mon Sep 17 00:00:00 2001 From: Navin Chandra <98466550+navin772@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:03:39 +0530 Subject: [PATCH 05/18] [py]: add chrome and edge set_permissions docs (#2058)[deploy site] add chrome and edge set_permissions docs Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com> --- examples/python/tests/browsers/test_chrome.py | 21 +++++++++++++++++++ examples/python/tests/browsers/test_edge.py | 21 +++++++++++++++++++ .../webdriver/browsers/chrome.en.md | 6 +++--- .../webdriver/browsers/chrome.ja.md | 6 +++--- .../webdriver/browsers/chrome.pt-br.md | 6 +++--- .../webdriver/browsers/chrome.zh-cn.md | 6 +++--- .../webdriver/browsers/edge.en.md | 6 +++--- .../webdriver/browsers/edge.ja.md | 6 +++--- .../webdriver/browsers/edge.pt-br.md | 6 +++--- .../webdriver/browsers/edge.zh-cn.md | 6 +++--- 10 files changed, 66 insertions(+), 24 deletions(-) diff --git a/examples/python/tests/browsers/test_chrome.py b/examples/python/tests/browsers/test_chrome.py index 2fd6b653af79..e68daf326504 100644 --- a/examples/python/tests/browsers/test_chrome.py +++ b/examples/python/tests/browsers/test_chrome.py @@ -140,3 +140,24 @@ def test_set_network_conditions(): assert driver.get_network_conditions() == network_conditions driver.quit() + + +def test_set_permissions(): + driver = webdriver.Chrome() + driver.get('https://www.selenium.dev') + + driver.set_permissions('camera', 'denied') + + assert get_permission_state(driver, 'camera') == 'denied' + driver.quit() + + +def get_permission_state(driver, name): + """Helper function to query the permission state.""" + script = """ + const callback = arguments[arguments.length - 1]; + navigator.permissions.query({name: arguments[0]}).then(permissionStatus => { + callback(permissionStatus.state); + }); + """ + return driver.execute_async_script(script, name) diff --git a/examples/python/tests/browsers/test_edge.py b/examples/python/tests/browsers/test_edge.py index ff9018b0e903..d478f511166b 100644 --- a/examples/python/tests/browsers/test_edge.py +++ b/examples/python/tests/browsers/test_edge.py @@ -140,3 +140,24 @@ def test_set_network_conditions(): assert driver.get_network_conditions() == network_conditions driver.quit() + + +def test_set_permissions(): + driver = webdriver.Edge() + driver.get('https://www.selenium.dev') + + driver.set_permissions('camera', 'denied') + + assert get_permission_state(driver, 'camera') == 'denied' + driver.quit() + + +def get_permission_state(driver, name): + """Helper function to query the permission state.""" + script = """ + const callback = arguments[arguments.length - 1]; + navigator.permissions.query({name: arguments[0]}).then(permissionStatus => { + callback(permissionStatus.state); + }); + """ + return driver.execute_async_script(script, name) diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index cbdcda02391f..64ca84f8bb84 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -444,9 +444,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#L149" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index 8bceff728508..4bb00f9601d2 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -438,9 +438,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#L149" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index 3350a07d5d26..0fc6df4a34dc 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -447,9 +447,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#L149" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index 943a971b4f30..ca9b273ed67b 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -448,9 +448,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#L149" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index 5e9c71781fbb..cb2a9cd63bcb 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -444,9 +444,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#L149" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index 712e3c2ec8c8..857d2052449f 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -430,9 +430,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#L149" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index 9f6b27b7c733..058ed2a451eb 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -446,9 +446,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#L149" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index 94db1a3ccb32..f2a2d6cc1b54 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -446,9 +446,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#L149" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} From 2023e73500361912c555221dfcb8c49d7f7e4583 Mon Sep 17 00:00:00 2001 From: Sri Harsha Date: Thu, 14 Nov 2024 11:35:10 -0500 Subject: [PATCH 06/18] chore(deps): update post-css npm to latest --- website_and_docs/package-lock.json | 14 +++++++------- website_and_docs/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/website_and_docs/package-lock.json b/website_and_docs/package-lock.json index 18a7da75d1b4..08529751ff8d 100644 --- a/website_and_docs/package-lock.json +++ b/website_and_docs/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "autoprefixer": "^10.4.20", - "postcss": "^8.4.48", + "postcss": "^8.4.49", "postcss-cli": "^11.0.0" } }, @@ -577,9 +577,9 @@ } }, "node_modules/postcss": { - "version": "8.4.48", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.48.tgz", - "integrity": "sha512-GCRK8F6+Dl7xYniR5a4FYbpBzU8XnZVeowqsQFYdcXuSbChgiks7qybSkbvnaeqv0G0B+dd9/jJgH8kkLDQeEA==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "funding": [ { "type": "opencollective", @@ -1285,9 +1285,9 @@ "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" }, "postcss": { - "version": "8.4.48", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.48.tgz", - "integrity": "sha512-GCRK8F6+Dl7xYniR5a4FYbpBzU8XnZVeowqsQFYdcXuSbChgiks7qybSkbvnaeqv0G0B+dd9/jJgH8kkLDQeEA==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "requires": { "nanoid": "^3.3.7", "picocolors": "^1.1.1", diff --git a/website_and_docs/package.json b/website_and_docs/package.json index 0bae5f8b4fbb..aa478f4859f3 100644 --- a/website_and_docs/package.json +++ b/website_and_docs/package.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "autoprefixer": "^10.4.20", - "postcss": "^8.4.48", + "postcss": "^8.4.49", "postcss-cli": "^11.0.0" } } From 9f6970674cc81aed815e48b56fa9a477840b06ce Mon Sep 17 00:00:00 2001 From: Sri Harsha Date: Fri, 15 Nov 2024 13:08:04 -0500 Subject: [PATCH 07/18] chore(java): enable tests in FF and bump java version to 11 in examples --- examples/java/pom.xml | 4 ++-- .../java/src/test/java/dev/selenium/browsers/FirefoxTest.java | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/java/pom.xml b/examples/java/pom.xml index 5483e72d16f8..25f69e090a8a 100644 --- a/examples/java/pom.xml +++ b/examples/java/pom.xml @@ -10,8 +10,8 @@ 1 - 11 - 11 + 17 + 17 UTF-8 4.26.0 diff --git a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java index e763cd7824e1..649dae542d38 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java @@ -125,7 +125,6 @@ public void setProfileLocation() { } @Test - @Disabled("Skipping tests until Firefox 127 is released") public void installAddon() { driver = startFirefoxDriver(); Path xpiPath = Paths.get("src/test/resources/extensions/selenium-example.xpi"); @@ -139,7 +138,6 @@ public void installAddon() { } @Test - @Disabled("Skipping tests until Firefox 127 is released") public void uninstallAddon() { driver = startFirefoxDriver(); Path xpiPath = Paths.get("src/test/resources/extensions/selenium-example.xpi"); @@ -152,7 +150,6 @@ public void uninstallAddon() { } @Test - @Disabled("Skipping tests until Firefox 127 is released") public void installUnsignedAddonPath() { driver = startFirefoxDriver(); Path path = Paths.get("src/test/resources/extensions/selenium-example"); From 0ec7656387a792fb1137020c60ed33109cc5a9e6 Mon Sep 17 00:00:00 2001 From: Navin Chandra <98466550+navin772@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:49:03 +0530 Subject: [PATCH 08/18] [java]: add java docs for setPermission for chrome and edge browsers (#2063) * add java docs for setPermission in chrome and edge * remove text blocks to support Java 11 --- .../java/dev/selenium/browsers/ChromeTest.java | 16 ++++++++++++++++ .../java/dev/selenium/browsers/EdgeTest.java | 16 ++++++++++++++++ .../webdriver/browsers/chrome.en.md | 2 +- .../webdriver/browsers/chrome.ja.md | 2 +- .../webdriver/browsers/chrome.pt-br.md | 2 +- .../webdriver/browsers/chrome.zh-cn.md | 2 +- .../documentation/webdriver/browsers/edge.en.md | 2 +- .../documentation/webdriver/browsers/edge.ja.md | 2 +- .../webdriver/browsers/edge.pt-br.md | 2 +- .../webdriver/browsers/edge.zh-cn.md | 2 +- 10 files changed, 40 insertions(+), 8 deletions(-) diff --git a/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java b/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java index a7a6e55ef7b7..430ae5d16394 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java @@ -180,4 +180,20 @@ private File getChromeLocation() { DriverFinder finder = new DriverFinder(ChromeDriverService.createDefaultService(), options); return new File(finder.getBrowserPath()); } + + @Test + public void setPermission() { + ChromeDriver driver = new ChromeDriver(); + driver.get("https://www.selenium.dev"); + + driver.setPermission("camera", "denied"); + + // Verify the permission state is 'denied' + String script = "return navigator.permissions.query({ name: 'camera' })" + + " .then(permissionStatus => permissionStatus.state);"; + String permissionState = (String) driver.executeScript(script); + + Assertions.assertEquals("denied", permissionState); + driver.quit(); + } } diff --git a/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java b/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java index 0711b26292cb..164d73b0aa0b 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java @@ -174,4 +174,20 @@ private File getEdgeLocation() { DriverFinder finder = new DriverFinder(EdgeDriverService.createDefaultService(), options); return new File(finder.getBrowserPath()); } + + @Test + public void setPermissions() { + EdgeDriver driver = new EdgeDriver(); + driver.get("https://www.selenium.dev"); + + driver.setPermission("camera", "denied"); + + // Verify the permission state is 'denied' + String script = "return navigator.permissions.query({ name: 'camera' })" + + " .then(permissionStatus => permissionStatus.state);"; + String permissionState = (String) driver.executeScript(script); + + Assertions.assertEquals("denied", permissionState); + driver.quit(); + } } diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index 64ca84f8bb84..511793595a0d 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -442,7 +442,7 @@ You can simulate various network conditions. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L189" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L149" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index 4bb00f9601d2..d467f29bd714 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -436,7 +436,7 @@ Chrome Castデバイスを操作することができ、タブの共有も含ま {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L189" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L149" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index 0fc6df4a34dc..4ab23dc41ea6 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -445,7 +445,7 @@ please refer to the {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L189" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L149" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index ca9b273ed67b..7c11540fc1ba 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -446,7 +446,7 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱 {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L189" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L149" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index cb2a9cd63bcb..ac1d97f57137 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -442,7 +442,7 @@ You can simulate various network conditions. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L183" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L149" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index 857d2052449f..9ec2b35bc6c7 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -428,7 +428,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#L183" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L149" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index 058ed2a451eb..ff70e45c0664 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -444,7 +444,7 @@ You can simulate various network conditions. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L183" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L149" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index f2a2d6cc1b54..0f72fe589e3a 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -444,7 +444,7 @@ You can simulate various network conditions. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L183" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L149" >}} From 07ba76aed2f29f273c1837145472159cb0c1ea71 Mon Sep 17 00:00:00 2001 From: Sri Harsha Date: Fri, 15 Nov 2024 13:20:20 -0500 Subject: [PATCH 09/18] add spaces to render code samples correctly in docs [deploy site] --- .../java/src/test/java/dev/selenium/browsers/FirefoxTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java index 649dae542d38..d217c3c95162 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java @@ -124,6 +124,7 @@ public void setProfileLocation() { Assertions.assertTrue(location.contains(profileDirectory.getAbsolutePath())); } + @Test public void installAddon() { driver = startFirefoxDriver(); @@ -137,6 +138,7 @@ public void installAddon() { "Content injected by webextensions-selenium-example", injected.getText()); } + @Test public void uninstallAddon() { driver = startFirefoxDriver(); @@ -149,6 +151,7 @@ public void uninstallAddon() { Assertions.assertEquals(driver.findElements(By.id("webextensions-selenium-example")).size(), 0); } + @Test public void installUnsignedAddonPath() { driver = startFirefoxDriver(); From 0e011c5ec20969ff85e97efa8df5d4f6854745ae Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 18 Nov 2024 14:16:25 +0700 Subject: [PATCH 10/18] [ci] Get latest Nightly from TestPyPi sort by upload_time (#2064) Signed-off-by: Viet Nguyen Duc --- scripts/latest-python-nightly-version.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/latest-python-nightly-version.py b/scripts/latest-python-nightly-version.py index 4c232f63c74e..fb1f18e812fa 100755 --- a/scripts/latest-python-nightly-version.py +++ b/scripts/latest-python-nightly-version.py @@ -1,12 +1,12 @@ import requests import json -import re response = requests.get("https://test.pypi.org/pypi/selenium/json") data = response.json() -versions = data['releases'].keys() -sorted_versions = sorted(versions, key=lambda s: [int(part) if part.isdigit() else part for part in re.split(r'(\d+)', s)]) -latest_version = sorted_versions[-1] +# Extract versions and their upload times +versions = data['releases'] +sorted_versions = sorted(versions.items(), key=lambda item: item[1][0]['upload_time'], reverse=True) +latest_version = sorted_versions[0][0] print(latest_version) \ No newline at end of file From 9c3d182f3e41b98b8fcc48a5df4cbdee6093a3d6 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 18 Nov 2024 20:57:27 +0700 Subject: [PATCH 11/18] [ci] Add range of python version 3.8 to 3.13 for example tests (#2065) Signed-off-by: Viet Nguyen Duc --- .github/workflows/python-examples.yml | 27 ++++++++++++++++++++++----- examples/python/requirements.txt | 1 + 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-examples.yml b/.github/workflows/python-examples.yml index e7d432cab113..6238c88ef60d 100644 --- a/.github/workflows/python-examples.yml +++ b/.github/workflows/python-examples.yml @@ -25,8 +25,25 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu, windows, macos ] - release: [ stable, nightly ] + include: + - os: ubuntu + release: stable + python: '3.8' + - os: ubuntu + release: nightly + python: '3.11' + - os: windows + release: stable + python: '3.9' + - os: windows + release: nightly + python: '3.12' + - os: macos + release: stable + python: '3.10' + - os: macos + release: nightly + python: '3.13' runs-on: ${{ format('{0}-latest', matrix.os) }} steps: - name: Checkout GitHub repo @@ -47,7 +64,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: ${{ matrix.python }} - name: Install dependencies nightly non-Windows if: matrix.release == 'nightly' && matrix.os != 'windows' run: | @@ -80,8 +97,8 @@ jobs: - name: Run tests uses: nick-invision/retry@v3.0.0 with: - timeout_minutes: 40 + timeout_minutes: 60 max_attempts: 3 command: | cd examples/python - pytest + pytest --reruns 3 diff --git a/examples/python/requirements.txt b/examples/python/requirements.txt index aba556812b9c..1aeaa1a03aa1 100644 --- a/examples/python/requirements.txt +++ b/examples/python/requirements.txt @@ -2,5 +2,6 @@ selenium==4.26.1 pytest trio pytest-trio +pytest-rerunfailures flake8 requests From 55a8ef0fa403217d5c679c878cbb35324fb51911 Mon Sep 17 00:00:00 2001 From: Navin Chandra <98466550+navin772@users.noreply.github.com> Date: Tue, 19 Nov 2024 01:23:01 +0530 Subject: [PATCH 12/18] [java]: docs example for full page screenshot in firefox (#2066) * java docs for full page screenshot in firefox * delete the file after assertion --------- Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com> --- .../dev/selenium/browsers/FirefoxTest.java | 20 ++++++++++++++++++- .../webdriver/browsers/firefox.en.md | 2 +- .../webdriver/browsers/firefox.ja.md | 2 +- .../webdriver/browsers/firefox.pt-br.md | 2 +- .../webdriver/browsers/firefox.zh-cn.md | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java index d217c3c95162..bc748391e2a7 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java @@ -13,6 +13,7 @@ import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; import org.openqa.selenium.By; +import org.openqa.selenium.OutputType; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxDriverLogLevel; @@ -20,7 +21,6 @@ import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.GeckoDriverService; import org.openqa.selenium.remote.service.DriverFinder; -import org.junit.jupiter.api.Disabled; public class FirefoxTest extends BaseTest { private FirefoxDriver driver; @@ -171,4 +171,22 @@ private Path getFirefoxLocation() { DriverFinder finder = new DriverFinder(GeckoDriverService.createDefaultService(), options); return Path.of(finder.getBrowserPath()); } + + @Test + public void fullPageScreenshot() throws Exception { + driver = startFirefoxDriver(); + + driver.get("https://www.selenium.dev"); + + File screenshot = driver.getFullPageScreenshotAs(OutputType.FILE); + + File targetFile = new File("full_page_screenshot.png"); + Files.move(screenshot.toPath(), targetFile.toPath()); + + // Verify the screenshot file exists + Assertions.assertTrue(targetFile.exists(), "The full page screenshot file should exist"); + Files.deleteIfExists(targetFile.toPath()); + + driver.quit(); + } } diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md index bf5e46ce2a43..974f2911d7ad 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md @@ -414,7 +414,7 @@ please refer to the {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L181" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L139" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md index dc97ef6e6d25..29324b6038bd 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -412,7 +412,7 @@ IDはアドオンインストール時の戻り値から取得できます。 {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L181" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L139" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md index 52964b50e405..83b751b7ff52 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md @@ -419,7 +419,7 @@ please refer to the {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L181" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L139" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md index 662d48020ebb..2b95a76576f0 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md @@ -416,7 +416,7 @@ please refer to the {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L181" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L139" >}} From 537fe55b7930b984a688dbdd888e25d4bd423bce Mon Sep 17 00:00:00 2001 From: Swastik Baranwal Date: Tue, 19 Nov 2024 21:35:45 +0530 Subject: [PATCH 13/18] [py] document console output for Edge (#2067)[deploy site] --- .../content/documentation/webdriver/browsers/edge.en.md | 3 ++- .../content/documentation/webdriver/browsers/edge.ja.md | 3 ++- .../content/documentation/webdriver/browsers/edge.pt-br.md | 3 ++- .../content/documentation/webdriver/browsers/edge.zh-cn.md | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index ac1d97f57137..8aa3527f2a35 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -239,7 +239,8 @@ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-implementation >}} +{{< badge-version version="4.11" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L82" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index 9ec2b35bc6c7..daa800be2014 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -229,7 +229,8 @@ MSEdgedriverには、ブラウザを起動するために使用されるいく プロパティ値:`DriverService.LOG_STDOUT` または `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-implementation >}} +{{< badge-version version="4.11" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L82" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index ff70e45c0664..3377739b2459 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -241,7 +241,8 @@ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-implementation >}} +{{< badge-version version="4.11" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L82" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index 0f72fe589e3a..7a62327dbd5f 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -241,7 +241,8 @@ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-implementation >}} +{{< badge-version version="4.11" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L82" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} From e4b258f753f5a7771447d76d6f23aea1f14a06ce Mon Sep 17 00:00:00 2001 From: Sri Harsha Date: Tue, 19 Nov 2024 17:42:21 -0500 Subject: [PATCH 14/18] [js] fix line numbers [deploy site] --- examples/javascript/test/browser/chromeSpecificCaps.spec.js | 2 ++ examples/javascript/test/browser/edgeSpecificCaps.spec.js | 1 + examples/javascript/test/getting_started/openEdgeTest.spec.js | 2 ++ .../content/documentation/webdriver/browsers/edge.en.md | 2 +- .../content/documentation/webdriver/browsers/edge.ja.md | 2 +- .../content/documentation/webdriver/browsers/edge.pt-br.md | 2 +- .../content/documentation/webdriver/browsers/edge.zh-cn.md | 2 +- .../content/documentation/webdriver/browsers/firefox.en.md | 2 +- .../content/documentation/webdriver/browsers/firefox.ja.md | 2 +- .../content/documentation/webdriver/browsers/firefox.pt-br.md | 2 +- .../content/documentation/webdriver/browsers/firefox.zh-cn.md | 2 +- .../content/documentation/webdriver/browsers/safari.en.md | 2 +- .../content/documentation/webdriver/browsers/safari.ja.md | 2 +- .../content/documentation/webdriver/browsers/safari.pt-br.md | 2 +- .../content/documentation/webdriver/browsers/safari.zh-cn.md | 2 +- 15 files changed, 17 insertions(+), 12 deletions(-) diff --git a/examples/javascript/test/browser/chromeSpecificCaps.spec.js b/examples/javascript/test/browser/chromeSpecificCaps.spec.js index 813636cb15a2..04175656d870 100644 --- a/examples/javascript/test/browser/chromeSpecificCaps.spec.js +++ b/examples/javascript/test/browser/chromeSpecificCaps.spec.js @@ -2,6 +2,8 @@ const Chrome = require('selenium-webdriver/chrome'); const { Browser, Builder } = require("selenium-webdriver"); const options = new Chrome.Options(); + + describe('Should be able to Test Command line arguments', function () { it('headless', async function () { let driver = new Builder() diff --git a/examples/javascript/test/browser/edgeSpecificCaps.spec.js b/examples/javascript/test/browser/edgeSpecificCaps.spec.js index 23fad7888f19..4f059f5c79a5 100644 --- a/examples/javascript/test/browser/edgeSpecificCaps.spec.js +++ b/examples/javascript/test/browser/edgeSpecificCaps.spec.js @@ -4,6 +4,7 @@ const options = new edge.Options(); const assert = require("assert"); + describe('Should be able to Test Command line arguments', function () { it('headless', async function () { let driver = new Builder() diff --git a/examples/javascript/test/getting_started/openEdgeTest.spec.js b/examples/javascript/test/getting_started/openEdgeTest.spec.js index f7cc5078924d..001337c356ec 100644 --- a/examples/javascript/test/getting_started/openEdgeTest.spec.js +++ b/examples/javascript/test/getting_started/openEdgeTest.spec.js @@ -5,6 +5,8 @@ const edge = require('selenium-webdriver/edge'); describe('Open Edge', function () { let driver; + + before(async function () { let options = new edge.Options(); driver = new Builder() diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index 8aa3527f2a35..9b8ae30a1eed 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -178,7 +178,7 @@ Set excluded arguments on options: {{< gh-codeblock path="/examples/ruby/spec/browsers/edge_spec.rb#L53" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/getting_started/openEdgeTest.spec.js#L20-L23">}} +{{< gh-codeblock path="/examples/javascript/test/browser/edgeSpecificCaps.spec.js#L22">}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index daa800be2014..2d693ad8533e 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -170,7 +170,7 @@ MSEdgedriverには、ブラウザを起動するために使用されるいく {{< gh-codeblock path="/examples/ruby/spec/browsers/edge_spec.rb#L53" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/getting_started/openEdgeTest.spec.js#L20-L23">}} +{{< gh-codeblock path="/examples/javascript/test/browser/edgeSpecificCaps.spec.js#L22">}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index 3377739b2459..92201fe03c0a 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -180,7 +180,7 @@ Set excluded arguments on options: {{< gh-codeblock path="/examples/ruby/spec/browsers/edge_spec.rb#L53" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/getting_started/openEdgeTest.spec.js#L20-L23">}} +{{< gh-codeblock path="/examples/javascript/test/browser/edgeSpecificCaps.spec.js#L22">}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index 7a62327dbd5f..417ffc7a5298 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -180,7 +180,7 @@ Set excluded arguments on options: {{< gh-codeblock path="/examples/ruby/spec/browsers/edge_spec.rb#L53" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/getting_started/openEdgeTest.spec.js#L20-L23">}} +{{< gh-codeblock path="/examples/javascript/test/browser/edgeSpecificCaps.spec.js#L22">}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md index 974f2911d7ad..2dd143919566 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md @@ -61,7 +61,7 @@ Add an argument to options: {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L17" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/browser/firefoxSpecificFunctionalities.spec.js#L12-L14">}} +{{< gh-codeblock path="/examples/javascript/test/browser/firefoxSpecificFunctionalities.spec.js#L12">}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md index 29324b6038bd..d489c0be1afd 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -64,7 +64,7 @@ Firefox に固有のCapabilityは、Mozilla のページの [firefoxOptions](htt {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L17" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/browser/firefoxSpecificFunctionalities.spec.js#L12-L14">}} +{{< gh-codeblock path="/examples/javascript/test/browser/firefoxSpecificFunctionalities.spec.js#L12">}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md index 83b751b7ff52..01cc173f5562 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md @@ -63,7 +63,7 @@ Adicione uma opção: {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L17" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/browser/firefoxSpecificFunctionalities.spec.js#L12-L14">}} +{{< gh-codeblock path="/examples/javascript/test/browser/firefoxSpecificFunctionalities.spec.js#L12">}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md index 2b95a76576f0..a30d1c9e751d 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md @@ -63,7 +63,7 @@ Add an argument to options: {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L17" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/browser/firefoxSpecificFunctionalities.spec.js#L12-L14">}} +{{< gh-codeblock path="/examples/javascript/test/browser/firefoxSpecificFunctionalities.spec.js#L12">}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md index 51941f5102f5..757b9cd1b066 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md @@ -39,7 +39,7 @@ Starting a Safari session with basic defined options looks like this: {{< gh-codeblock path="/examples/ruby/spec/browsers/safari_spec.rb#L8-L9" >}} {{< /tab >}} {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/browser/safariSpecificCap.spec.js#L10-L12" >}} +{{< gh-codeblock path="/examples/javascript/test/browser/safariSpecificCap.spec.js#L8-L11" >}} {{< /tab >}} {{< tab header="Kotlin" >}} val options = SafariOptions() diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md index d02e944514b4..a15036dab0b3 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md @@ -38,7 +38,7 @@ Starting a Safari session with basic defined options looks like this: {{< gh-codeblock path="/examples/ruby/spec/browsers/safari_spec.rb#L8-L9" >}} {{< /tab >}} {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/browser/safariSpecificCap.spec.js#L10-L12" >}} +{{< gh-codeblock path="/examples/javascript/test/browser/safariSpecificCap.spec.js#L8-L11" >}} {{< /tab >}} {{< tab header="Kotlin" >}} val options = SafariOptions() diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md index f2cf26866aff..0ef447205626 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md @@ -38,7 +38,7 @@ Este é um exemplo de como iniciar uma sessão Safari com um conjunto de opçõe {{< gh-codeblock path="/examples/ruby/spec/browsers/safari_spec.rb#L8-L9" >}} {{< /tab >}} {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/browser/safariSpecificCap.spec.js#L10-L12" >}} +{{< gh-codeblock path="/examples/javascript/test/browser/safariSpecificCap.spec.js#L8-L11" >}} {{< /tab >}} {{< tab header="Kotlin" >}} val options = SafariOptions() diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md index ad9945439a0b..d55da00b60b2 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md @@ -38,7 +38,7 @@ Safari独有的Capabilities可以在Apple的页面[关于Safari的WebDriver](htt {{< gh-codeblock path="/examples/ruby/spec/browsers/safari_spec.rb#L8-L9" >}} {{< /tab >}} {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/browser/safariSpecificCap.spec.js#L10-L12" >}} +{{< gh-codeblock path="/examples/javascript/test/browser/safariSpecificCap.spec.js#L8-L11" >}} {{< /tab >}} {{< tab header="Kotlin" >}} val options = SafariOptions() From cb7d8ae037a40d13cda214d845bf9d0b2f578d8c Mon Sep 17 00:00:00 2001 From: Navin Chandra <98466550+navin772@users.noreply.github.com> Date: Thu, 21 Nov 2024 00:07:06 +0530 Subject: [PATCH 15/18] [java]: docs for set context in firefox (#2068)[deploy site] java docs for set context in firefox --- .../dev/selenium/browsers/FirefoxTest.java | 26 +++++++++++++++---- .../webdriver/browsers/firefox.en.md | 2 +- .../webdriver/browsers/firefox.ja.md | 2 +- .../webdriver/browsers/firefox.pt-br.md | 2 +- .../webdriver/browsers/firefox.zh-cn.md | 2 +- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java index bc748391e2a7..70ea5c18240e 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java @@ -15,13 +15,13 @@ import org.openqa.selenium.By; import org.openqa.selenium.OutputType; import org.openqa.selenium.WebElement; -import org.openqa.selenium.firefox.FirefoxDriver; -import org.openqa.selenium.firefox.FirefoxDriverLogLevel; -import org.openqa.selenium.firefox.FirefoxDriverService; -import org.openqa.selenium.firefox.FirefoxOptions; -import org.openqa.selenium.firefox.GeckoDriverService; +import org.openqa.selenium.firefox.*; import org.openqa.selenium.remote.service.DriverFinder; + + + + public class FirefoxTest extends BaseTest { private FirefoxDriver driver; @@ -189,4 +189,20 @@ public void fullPageScreenshot() throws Exception { driver.quit(); } + + @Test + public void setContext() { + driver = startFirefoxDriver(); + + ((HasContext) driver).setContext(FirefoxCommandContext.CHROME); + driver.executeScript("console.log('Inside Chrome context');"); + + // Verify the context is back to "content" + Assertions.assertEquals( + FirefoxCommandContext.CHROME, ((HasContext) driver).getContext(), + "The context should be 'chrome'" + ); + + driver.quit(); + } } diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md index 2dd143919566..f2eac7c6b549 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md @@ -441,7 +441,7 @@ please refer to the {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L197-L198" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L149-L150" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md index d489c0be1afd..126638d5acb8 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -437,7 +437,7 @@ IDはアドオンインストール時の戻り値から取得できます。 {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L197-L198" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L149-L150" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md index 01cc173f5562..f36890f487da 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md @@ -446,7 +446,7 @@ please refer to the {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L197-L198" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L149-L150" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md index a30d1c9e751d..b56e5f62b742 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md @@ -443,7 +443,7 @@ please refer to the {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L197-L198" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L149-L150" >}} From b0ff2d92c02c965f36669f8d6f784200c94638d4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 23:13:10 -0500 Subject: [PATCH 16/18] chore(deps): update dependency gradle to v8.11.1 (#2069) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- examples/java/gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/java/gradle/wrapper/gradle-wrapper.properties b/examples/java/gradle/wrapper/gradle-wrapper.properties index 94113f200e61..e2847c820046 100644 --- a/examples/java/gradle/wrapper/gradle-wrapper.properties +++ b/examples/java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 6c18cac97caa6c98c465f827fd790463444fd789 Mon Sep 17 00:00:00 2001 From: Navin Chandra <98466550+navin772@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:51:52 +0530 Subject: [PATCH 17/18] [py]: add example and docs for casting in edge and chrome (#2072) * add example for python casting for edge and chrome * add docs for casting --- examples/python/tests/browsers/test_chrome.py | 17 ++++++++++++++++- examples/python/tests/browsers/test_edge.py | 17 ++++++++++++++++- .../webdriver/browsers/chrome.en.md | 6 +++--- .../webdriver/browsers/chrome.ja.md | 6 +++--- .../webdriver/browsers/chrome.pt-br.md | 6 +++--- .../webdriver/browsers/chrome.zh-cn.md | 7 +++---- .../documentation/webdriver/browsers/edge.en.md | 6 +++--- .../documentation/webdriver/browsers/edge.ja.md | 6 +++--- .../webdriver/browsers/edge.pt-br.md | 6 +++--- .../webdriver/browsers/edge.zh-cn.md | 6 +++--- 10 files changed, 56 insertions(+), 27 deletions(-) diff --git a/examples/python/tests/browsers/test_chrome.py b/examples/python/tests/browsers/test_chrome.py index e68daf326504..55667f514652 100644 --- a/examples/python/tests/browsers/test_chrome.py +++ b/examples/python/tests/browsers/test_chrome.py @@ -1,7 +1,7 @@ import os import re import subprocess - +import pytest from selenium import webdriver @@ -161,3 +161,18 @@ def get_permission_state(driver, name): }); """ return driver.execute_async_script(script, name) + + +def test_cast_features(): + driver = webdriver.Chrome() + + try: + sinks = driver.get_sinks() + if sinks: + sink_name = sinks[0]['name'] + driver.start_tab_mirroring(sink_name) + driver.stop_casting(sink_name) + else: + pytest.skip("No available Cast sinks to test with.") + finally: + driver.quit() diff --git a/examples/python/tests/browsers/test_edge.py b/examples/python/tests/browsers/test_edge.py index d478f511166b..363b15ea49f8 100644 --- a/examples/python/tests/browsers/test_edge.py +++ b/examples/python/tests/browsers/test_edge.py @@ -1,7 +1,7 @@ import os import re import subprocess - +import pytest from selenium import webdriver @@ -161,3 +161,18 @@ def get_permission_state(driver, name): }); """ return driver.execute_async_script(script, name) + + +def test_cast_features(): + driver = webdriver.Edge() + + try: + sinks = driver.get_sinks() + if sinks: + sink_name = sinks[0]['name'] + driver.start_tab_mirroring(sink_name) + driver.stop_casting(sink_name) + else: + pytest.skip("No available Cast sinks to test with.") + finally: + driver.quit() diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index 511793595a0d..462899b356c7 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -372,9 +372,9 @@ You can drive Chrome Cast devices, including sharing tabs {{< 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#L170-L174" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index d467f29bd714..73053fe32075 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -365,9 +365,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#L170-L174" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index 4ab23dc41ea6..8a96b3ac18d5 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -372,9 +372,9 @@ Pode comandar dispositivos Chrome Cast, incluindo partilhar abas {{< 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#L170-L174" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index 7c11540fc1ba..e86557c85b4a 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -373,10 +373,9 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱 {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} -{{< tab header="CSharp" >}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L170-L174" >}} +{{< /tab >}}{{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index 9b8ae30a1eed..04768b23e458 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -374,9 +374,9 @@ You can drive Chrome Cast devices with Edge, including sharing tabs {{< 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#L170-L174" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index 2d693ad8533e..ff9237645e62 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -360,9 +360,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#L170-L174" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index 92201fe03c0a..ce8bbb9505be 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -376,9 +376,9 @@ You can drive Chrome Cast devices with Edge, including sharing tabs {{< 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#L170-L174" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index 417ffc7a5298..a6d3aaa67de4 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -376,9 +376,9 @@ You can drive Chrome Cast devices with Edge, including sharing tabs {{< 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#L170-L174" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} From 5b505342dee60d0a13fd03b6202b82311c0501b7 Mon Sep 17 00:00:00 2001 From: Navin Chandra <98466550+navin772@users.noreply.github.com> Date: Fri, 22 Nov 2024 23:35:13 +0530 Subject: [PATCH 18/18] [java]: add docs and example for setNetworkConditions (#2071)[deploy site] * add example for java setNetworkConditions in chrome and edge * java docs for setNetworkConditions * delete network conditions after assertions --------- Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com> --- .../dev/selenium/browsers/ChromeTest.java | 28 +++++++++++++++++- .../java/dev/selenium/browsers/EdgeTest.java | 29 ++++++++++++++++++- .../webdriver/browsers/chrome.en.md | 2 +- .../webdriver/browsers/chrome.ja.md | 2 +- .../webdriver/browsers/chrome.pt-br.md | 2 +- .../webdriver/browsers/chrome.zh-cn.md | 2 +- .../webdriver/browsers/edge.en.md | 2 +- .../webdriver/browsers/edge.ja.md | 2 +- .../webdriver/browsers/edge.pt-br.md | 2 +- .../webdriver/browsers/edge.zh-cn.md | 2 +- 10 files changed, 63 insertions(+), 10 deletions(-) diff --git a/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java b/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java index 430ae5d16394..24e97185336a 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java @@ -19,12 +19,12 @@ import org.openqa.selenium.chrome.ChromeDriverService; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.chromium.ChromiumDriverLogLevel; +import org.openqa.selenium.chromium.ChromiumNetworkConditions; import org.openqa.selenium.logging.LogEntries; import org.openqa.selenium.logging.LogType; import org.openqa.selenium.logging.LoggingPreferences; import org.openqa.selenium.remote.service.DriverFinder; - public class ChromeTest extends BaseTest { @AfterEach public void clearProperties() { @@ -196,4 +196,30 @@ public void setPermission() { Assertions.assertEquals("denied", permissionState); driver.quit(); } + + @Test + public void setNetworkConditions() { + driver = new ChromeDriver(); + + ChromiumNetworkConditions networkConditions = new ChromiumNetworkConditions(); + networkConditions.setOffline(false); + networkConditions.setLatency(java.time.Duration.ofMillis(20)); // 20 ms of latency + networkConditions.setDownloadThroughput(2000 * 1024 / 8); // 2000 kbps + networkConditions.setUploadThroughput(2000 * 1024 / 8); // 2000 kbps + + ((ChromeDriver) driver).setNetworkConditions(networkConditions); + + driver.get("https://www.selenium.dev"); + + // Assert the network conditions are set as expected + ChromiumNetworkConditions actualConditions = ((ChromeDriver) driver).getNetworkConditions(); + Assertions.assertAll( + () -> Assertions.assertEquals(networkConditions.getOffline(), actualConditions.getOffline()), + () -> Assertions.assertEquals(networkConditions.getLatency(), actualConditions.getLatency()), + () -> Assertions.assertEquals(networkConditions.getDownloadThroughput(), actualConditions.getDownloadThroughput()), + () -> Assertions.assertEquals(networkConditions.getUploadThroughput(), actualConditions.getUploadThroughput()) + ); + ((ChromeDriver) driver).deleteNetworkConditions(); + driver.quit(); + } } diff --git a/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java b/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java index 164d73b0aa0b..11aa4f13f1e1 100644 --- a/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java +++ b/examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java @@ -15,7 +15,9 @@ 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; import org.openqa.selenium.edge.EdgeDriverService; import org.openqa.selenium.edge.EdgeOptions; @@ -24,7 +26,6 @@ import org.openqa.selenium.logging.LoggingPreferences; import org.openqa.selenium.remote.service.DriverFinder; - public class EdgeTest extends BaseTest { @AfterEach public void clearProperties() { @@ -190,4 +191,30 @@ public void setPermissions() { Assertions.assertEquals("denied", permissionState); driver.quit(); } + + @Test + public void setNetworkConditions() { + driver = new EdgeDriver(); + + ChromiumNetworkConditions networkConditions = new ChromiumNetworkConditions(); + networkConditions.setOffline(false); + networkConditions.setLatency(java.time.Duration.ofMillis(20)); // 20 ms of latency + networkConditions.setDownloadThroughput(2000 * 1024 / 8); // 2000 kbps + networkConditions.setUploadThroughput(2000 * 1024 / 8); // 2000 kbps + + ((EdgeDriver) driver).setNetworkConditions(networkConditions); + + driver.get("https://www.selenium.dev"); + + // Assert the network conditions are set as expected + ChromiumNetworkConditions actualConditions = ((EdgeDriver) driver).getNetworkConditions(); + Assertions.assertAll( + () -> Assertions.assertEquals(networkConditions.getOffline(), actualConditions.getOffline()), + () -> Assertions.assertEquals(networkConditions.getLatency(), actualConditions.getLatency()), + () -> Assertions.assertEquals(networkConditions.getDownloadThroughput(), actualConditions.getDownloadThroughput()), + () -> Assertions.assertEquals(networkConditions.getUploadThroughput(), actualConditions.getUploadThroughput()) + ); + ((EdgeDriver) driver).deleteNetworkConditions(); + driver.quit(); + } } diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index 462899b356c7..6e4f28c6a718 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -396,7 +396,7 @@ You can simulate various network conditions. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L204-L210" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L129-L135" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index 73053fe32075..241fbb3162bc 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -390,7 +390,7 @@ Chrome Castデバイスを操作することができ、タブの共有も含ま {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L204-L210" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L129-L135" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index 8a96b3ac18d5..e273d7f813a9 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -399,7 +399,7 @@ please refer to the {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L204-L210" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L129-L135" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index e86557c85b4a..cf2dde607193 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -399,7 +399,7 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱 {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L204-L210" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L129-L135" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index 04768b23e458..2bcae96e363d 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -397,7 +397,7 @@ You can simulate various network conditions. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L198-L204" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L129-L135" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index ff9237645e62..cf8098c55813 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -383,7 +383,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#L198-L204" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L129-L135" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index ce8bbb9505be..23e7599d04d6 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -399,7 +399,7 @@ You can simulate various network conditions. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L198-L204" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L129-L135" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index a6d3aaa67de4..cce5a9e4e36e 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -399,7 +399,7 @@ You can simulate various network conditions. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L198-L204" >}} {{< /tab >}} {{< tab header="Python" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L129-L135" >}}