From c817f765e8daa2eb9998fcd6318e5c96df55b03e Mon Sep 17 00:00:00 2001 From: innazh <38092381+innazh@users.noreply.github.com> Date: Fri, 16 Aug 2024 21:05:02 +0000 Subject: [PATCH 01/11] add browser options test examples in java added java examples/tests for browserName, browserVersion,platformName, scriptTimeout, pageLoadTimeout, implicitWaitTimeout, unhandledPromptBehaviour, setWindowRect, strictFileInteractability --- .../dev/selenium/drivers/OptionsTest.java | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java index 2010cd7b4964..a7bf44b921a5 100644 --- a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java +++ b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java @@ -60,5 +60,95 @@ public void setAcceptInsecureCerts() { driver.quit(); } } + + @Test + public void getBrowserName() { + ChromeOptions chromeOptions = new ChromeOptions(); + String name = chromeOptions.getBrowserName(); + assert !name.isEmpty(); + } + + @Test + public void setBrowserVersion() { + ChromeOptions chromeOptions = new ChromeOptions(); + String expected = "latest"; + chromeOptions.setBrowserVersion(expected); + assert expected.equals(chromeOptions.getBrowserVersion()); + } + + @Test + public void setPlatformName() { + ChromeOptions chromeOptions = new ChromeOptions(); + String expected = "OS X 10.6"; + chromeOptions.setPlatformName(expected); + Platform name = chromeOptions.getPlatformName(); + assert name.toString().equals(expected); + } + + @Test + public void setScriptTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration expected = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setScriptTimeout(expected); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getScriptTimeout(); + assert timeout.equals(expected); + } finally { + driver.quit(); + } + } + + @Test + public void setPageLoadTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration expected = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setPageLoadTimeout(expected); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getPageLoadTimeout(); + assert timeout.equals(expected); + } finally { + driver.quit(); + } + } + + @Test + public void setImplicitWaitTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration expected = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setImplicitWaitTimeout(expected); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getImplicitWaitTimeout(); + assert timeout.equals(expected); + } finally { + driver.quit(); + } + } + + @Test + public void setUnhandledPromptBehaviour() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.DISMISS_AND_NOTIFY); + assert chromeOptions.getCapability(CapabilityType.UNHANDLED_PROMPT_BEHAVIOUR).equals(UnexpectedAlertBehaviour.DISMISS_AND_NOTIFY); + } + + @Test + public void setWindowRect() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setCapability(CapabilityType.SET_WINDOW_RECT, true); + assert chromeOptions.getCapability(CapabilityType.SET_WINDOW_RECT).equals(true); + } + + @Test + public void setStrictFileInteractability() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setCapability(CapabilityType.STRICT_FILE_INTERACTABILITY, true); + assert chromeOptions.getCapability(CapabilityType.STRICT_FILE_INTERACTABILITY).equals(true); + } } From b9bbea1160e77dbb99b72b908d9d7d967f1f8a86 Mon Sep 17 00:00:00 2001 From: innazh Date: Sat, 17 Aug 2024 01:01:31 +0000 Subject: [PATCH 02/11] add java examples to /drivers/options.en.md added all mising examples for java for driver options page, except for the ones that require moving code --- .../webdriver/drivers/options.en.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index 14ffc923a1a6..ecd8114350a9 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.en.md @@ -31,7 +31,7 @@ Browser name is set by default when using an Options class instance. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L66-67" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -58,7 +58,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-75" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -287,7 +287,7 @@ setting `platformName` sets the OS at the remote-end. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L81-L83">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -325,7 +325,7 @@ effect for the entire session. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L53-L54">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -360,7 +360,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L90-L92">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -389,7 +389,7 @@ _TimeoutException_. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L105-L107">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -416,7 +416,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L120-L122">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -454,7 +454,7 @@ user prompt encounters at the remote-end. This is defined by {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L135-L136">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -479,7 +479,7 @@ Indicates whether the remote end supports all of the [resizing and repositioning {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L142-L143">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -507,7 +507,7 @@ when using _Element Send Keys_ with hidden file upload controls. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L149-L150">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} From 140428fe1247ce25f08ca9c610a4e8b690cda9e4 Mon Sep 17 00:00:00 2001 From: innazh Date: Sat, 17 Aug 2024 21:44:53 +0000 Subject: [PATCH 03/11] rename variables in the added to OptionsTest file functions --- .../dev/selenium/drivers/OptionsTest.java | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java index a7bf44b921a5..bd866ce3aeae 100644 --- a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java +++ b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java @@ -71,30 +71,29 @@ public void getBrowserName() { @Test public void setBrowserVersion() { ChromeOptions chromeOptions = new ChromeOptions(); - String expected = "latest"; - chromeOptions.setBrowserVersion(expected); - assert expected.equals(chromeOptions.getBrowserVersion()); + String version = "latest"; + chromeOptions.setBrowserVersion(version); + assert version.equals(chromeOptions.getBrowserVersion()); } @Test public void setPlatformName() { ChromeOptions chromeOptions = new ChromeOptions(); - String expected = "OS X 10.6"; - chromeOptions.setPlatformName(expected); - Platform name = chromeOptions.getPlatformName(); - assert name.toString().equals(expected); + String platform = "OS X 10.6"; + chromeOptions.setPlatformName(platform); + assert platform.toString().equals(chromeOptions.getPlatformName()); } @Test public void setScriptTimeout() { ChromeOptions chromeOptions = new ChromeOptions(); - Duration expected = Duration.of(5, ChronoUnit.SECONDS); - chromeOptions.setScriptTimeout(expected); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setScriptTimeout(duration); WebDriver driver = new ChromeDriver(chromeOptions); try { Duration timeout = driver.manage().timeouts().getScriptTimeout(); - assert timeout.equals(expected); + assert timeout.equals(duration); } finally { driver.quit(); } @@ -103,13 +102,13 @@ public void setScriptTimeout() { @Test public void setPageLoadTimeout() { ChromeOptions chromeOptions = new ChromeOptions(); - Duration expected = Duration.of(5, ChronoUnit.SECONDS); - chromeOptions.setPageLoadTimeout(expected); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setPageLoadTimeout(duration); WebDriver driver = new ChromeDriver(chromeOptions); try { Duration timeout = driver.manage().timeouts().getPageLoadTimeout(); - assert timeout.equals(expected); + assert timeout.equals(duration); } finally { driver.quit(); } @@ -118,13 +117,13 @@ public void setPageLoadTimeout() { @Test public void setImplicitWaitTimeout() { ChromeOptions chromeOptions = new ChromeOptions(); - Duration expected = Duration.of(5, ChronoUnit.SECONDS); - chromeOptions.setImplicitWaitTimeout(expected); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setImplicitWaitTimeout(duration); WebDriver driver = new ChromeDriver(chromeOptions); try { Duration timeout = driver.manage().timeouts().getImplicitWaitTimeout(); - assert timeout.equals(expected); + assert timeout.equals(duration); } finally { driver.quit(); } From d964cce45b7005263e2f9a91d113fed5ada20e66 Mon Sep 17 00:00:00 2001 From: innazh Date: Sat, 17 Aug 2024 22:00:18 +0000 Subject: [PATCH 04/11] update the line nums in options.en.md based on the changes I just made to the example file --- .../content/documentation/webdriver/drivers/options.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index ecd8114350a9..22e37c934a7f 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.en.md @@ -454,7 +454,7 @@ user prompt encounters at the remote-end. This is defined by {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L135-L136">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L134-L135">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -479,7 +479,7 @@ Indicates whether the remote end supports all of the [resizing and repositioning {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L142-L143">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -507,7 +507,7 @@ when using _Element Send Keys_ with hidden file upload controls. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L149-L150">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L148-L149">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} From cff3f9d63170ab154f8540ea160d809f4b6c5af4 Mon Sep 17 00:00:00 2001 From: innazh Date: Sat, 17 Aug 2024 22:10:32 +0000 Subject: [PATCH 05/11] update options.ja.md file with java examples for driver options --- .../webdriver/drivers/options.ja.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md index 0895b84fc365..ca64f9716d80 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md @@ -31,7 +31,7 @@ Browser name is set by default when using an Options class instance. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L66-67" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -59,7 +59,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-75" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -281,7 +281,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L81-L83">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -313,7 +313,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L53-L54">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -345,7 +345,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L90-L92">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -371,7 +371,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L105-L107">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -396,7 +396,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L120-L122">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -433,7 +433,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L134-L135">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -459,7 +459,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -486,7 +486,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L148-L149">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} From 4350411ef49afb958ca04929eadbf966474fd42b Mon Sep 17 00:00:00 2001 From: innazh Date: Sat, 17 Aug 2024 22:18:35 +0000 Subject: [PATCH 06/11] update options.pt-br.md file with java examples --- .../webdriver/drivers/options.pt-br.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md index 4325eb4d612a..5ce6eba10875 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md @@ -43,7 +43,7 @@ extremidade remota, a criação da sessão falhará. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L66-67" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -71,7 +71,7 @@ tiver apenas 80 instalados, a criação da sessão falhará. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-75" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -298,7 +298,7 @@ setting `platformName` sets the OS at the remote-end. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L81-L83">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -336,7 +336,7 @@ effect for the entire session. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L53-L54">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -372,7 +372,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L90-L92">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -401,7 +401,7 @@ _TimeoutException_. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L105-L107">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -428,7 +428,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L120-L122">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -467,7 +467,7 @@ user prompt encounters at the remote-end. This is defined by {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L134-L135">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -493,7 +493,7 @@ Indicates whether the remote end supports all of the [resizing and repositioning {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -522,7 +522,7 @@ when using _Element Send Keys_ with hidden file upload controls. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L148-L149">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} From 2faea60457c03fcb5ef648f02174bb48e7b46f13 Mon Sep 17 00:00:00 2001 From: innazh Date: Sat, 17 Aug 2024 22:28:39 +0000 Subject: [PATCH 07/11] update options.zh-cn.md file with java examples --- .../webdriver/drivers/options.zh-cn.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md index 979ee5244e86..30d43b4c6917 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md @@ -34,7 +34,7 @@ aliases: [ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L66-67" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -63,7 +63,7 @@ aliases: [ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-75" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -294,7 +294,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L81-L83">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -329,7 +329,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L53-L54">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -364,7 +364,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L90-L92">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -392,7 +392,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L105-L107">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -418,7 +418,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L120-L122">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -457,7 +457,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L134-L135">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -484,7 +484,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -513,7 +513,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L148-L149">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} From 10b21c807c4ce95f94283260ab61b0ec6942bbc9 Mon Sep 17 00:00:00 2001 From: innazh <38092381+innazh@users.noreply.github.com> Date: Sat, 17 Aug 2024 18:54:49 -0400 Subject: [PATCH 08/11] remove toString() method from a string var I was using toString() on a string variable by accident, removing it here. --- .../java/src/test/java/dev/selenium/drivers/OptionsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java index bd866ce3aeae..ef1ea846168d 100644 --- a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java +++ b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java @@ -81,7 +81,7 @@ public void setPlatformName() { ChromeOptions chromeOptions = new ChromeOptions(); String platform = "OS X 10.6"; chromeOptions.setPlatformName(platform); - assert platform.toString().equals(chromeOptions.getPlatformName()); + assert platform.equals(chromeOptions.getPlatformName()); } @Test From 2da5d05a988c46db03288d2e60ea5dd3f7e20282 Mon Sep 17 00:00:00 2001 From: Inna Date: Sun, 18 Aug 2024 15:09:59 -0400 Subject: [PATCH 09/11] addressed the feedback and now using Assertions library using assertions library, fixed spacing to match the rest of the code, added the missing imports. All of this threw off the line numbers for the options docs, so will have to edit it in the next commit. --- .../dev/selenium/drivers/OptionsTest.java | 174 ++++++++++-------- 1 file changed, 97 insertions(+), 77 deletions(-) diff --git a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java index ef1ea846168d..3aef0b4b6e3f 100644 --- a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java +++ b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java @@ -1,10 +1,17 @@ package dev.selenium.drivers; import dev.selenium.BaseTest; + +import java.time.Duration; +import java.time.temporal.ChronoUnit; + import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.openqa.selenium.PageLoadStrategy; +import org.openqa.selenium.UnexpectedAlertBehaviour; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeOptions; +import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.chrome.ChromeDriver; public class OptionsTest extends BaseTest { @@ -61,93 +68,106 @@ public void setAcceptInsecureCerts() { } } - @Test - public void getBrowserName() { - ChromeOptions chromeOptions = new ChromeOptions(); - String name = chromeOptions.getBrowserName(); - assert !name.isEmpty(); - } + @Test + public void getBrowserName() { + ChromeOptions chromeOptions = new ChromeOptions(); + String name = chromeOptions.getBrowserName(); + Assertions.assertFalse(name.isEmpty(), "Browser name should not be empty"); + } - @Test - public void setBrowserVersion() { - ChromeOptions chromeOptions = new ChromeOptions(); - String version = "latest"; - chromeOptions.setBrowserVersion(version); - assert version.equals(chromeOptions.getBrowserVersion()); - } + @Test + public void setBrowserVersion() { + ChromeOptions chromeOptions = new ChromeOptions(); + String version = "latest"; + chromeOptions.setBrowserVersion(version); + Assertions.assertEquals(version, chromeOptions.getBrowserVersion()); + } - @Test - public void setPlatformName() { - ChromeOptions chromeOptions = new ChromeOptions(); - String platform = "OS X 10.6"; - chromeOptions.setPlatformName(platform); - assert platform.equals(chromeOptions.getPlatformName()); - } + @Test + public void setPlatformName() { + ChromeOptions chromeOptions = new ChromeOptions(); + String platform = "OS X 10.6"; + chromeOptions.setPlatformName(platform); + Assertions.assertEquals(platform, chromeOptions.getPlatformName().toString()); + } - @Test - public void setScriptTimeout() { - ChromeOptions chromeOptions = new ChromeOptions(); - Duration duration = Duration.of(5, ChronoUnit.SECONDS); - chromeOptions.setScriptTimeout(duration); - - WebDriver driver = new ChromeDriver(chromeOptions); - try { - Duration timeout = driver.manage().timeouts().getScriptTimeout(); - assert timeout.equals(duration); - } finally { - driver.quit(); - } + @Test + public void setScriptTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setScriptTimeout(duration); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getScriptTimeout(); + Assertions.assertEquals(timeout, duration, "The script timeout should be set to 5 seconds."); + } finally { + driver.quit(); } + } - @Test - public void setPageLoadTimeout() { - ChromeOptions chromeOptions = new ChromeOptions(); - Duration duration = Duration.of(5, ChronoUnit.SECONDS); - chromeOptions.setPageLoadTimeout(duration); - - WebDriver driver = new ChromeDriver(chromeOptions); - try { - Duration timeout = driver.manage().timeouts().getPageLoadTimeout(); - assert timeout.equals(duration); - } finally { - driver.quit(); - } + @Test + public void setPageLoadTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setPageLoadTimeout(duration); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getPageLoadTimeout(); + Assertions.assertEquals(timeout, duration, "The page load timeout should be set to 5 seconds."); + } finally { + driver.quit(); } + } - @Test - public void setImplicitWaitTimeout() { - ChromeOptions chromeOptions = new ChromeOptions(); - Duration duration = Duration.of(5, ChronoUnit.SECONDS); - chromeOptions.setImplicitWaitTimeout(duration); - - WebDriver driver = new ChromeDriver(chromeOptions); - try { - Duration timeout = driver.manage().timeouts().getImplicitWaitTimeout(); - assert timeout.equals(duration); - } finally { - driver.quit(); - } + @Test + public void setImplicitWaitTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setImplicitWaitTimeout(duration); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getImplicitWaitTimeout(); + Assertions.assertEquals(timeout, duration, "The implicit wait timeout should be set to 5 seconds."); + } finally { + driver.quit(); } + } - @Test - public void setUnhandledPromptBehaviour() { - ChromeOptions chromeOptions = new ChromeOptions(); - chromeOptions.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.DISMISS_AND_NOTIFY); - assert chromeOptions.getCapability(CapabilityType.UNHANDLED_PROMPT_BEHAVIOUR).equals(UnexpectedAlertBehaviour.DISMISS_AND_NOTIFY); - } + @Test + public void setUnhandledPromptBehaviour() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.DISMISS_AND_NOTIFY); + //verify the capability object is not null + Object capabilityObject = chromeOptions.getCapability(CapabilityType.UNHANDLED_PROMPT_BEHAVIOUR); + Assertions.assertNotNull(capabilityObject, "Capability UNHANDLED_PROMPT_BEHAVIOUR should not be null."); + Assertions.assertEquals(capabilityObject.toString(), UnexpectedAlertBehaviour.DISMISS_AND_NOTIFY.toString()); + } - @Test - public void setWindowRect() { - ChromeOptions chromeOptions = new ChromeOptions(); - chromeOptions.setCapability(CapabilityType.SET_WINDOW_RECT, true); - assert chromeOptions.getCapability(CapabilityType.SET_WINDOW_RECT).equals(true); - } + @Test + public void setWindowRect() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setCapability(CapabilityType.SET_WINDOW_RECT, true); + //verify the capability object is not null + Object capabilityObject = chromeOptions.getCapability(CapabilityType.SET_WINDOW_RECT); + Assertions.assertNotNull(capabilityObject, "Capability SET_WINDOW_RECT should not be null."); + + Boolean capability = (Boolean) capabilityObject; + Assertions.assertTrue(capability, "The capability SET_WINDOW_RECT should be set to true."); + } - @Test - public void setStrictFileInteractability() { - ChromeOptions chromeOptions = new ChromeOptions(); - chromeOptions.setCapability(CapabilityType.STRICT_FILE_INTERACTABILITY, true); - assert chromeOptions.getCapability(CapabilityType.STRICT_FILE_INTERACTABILITY).equals(true); - } + @Test + public void setStrictFileInteractability() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setCapability(CapabilityType.STRICT_FILE_INTERACTABILITY, true); + //verify the capability object is not null + Object capabilityObject = chromeOptions.getCapability(CapabilityType.STRICT_FILE_INTERACTABILITY); + Assertions.assertNotNull(capabilityObject, "Capability STRICT_FILE_INTERACTABILITY should not be null."); + + Boolean capability = (Boolean) capabilityObject; + Assertions.assertTrue(capability, "The capability STRICT_FILE_INTERACTABILITY should be set to true."); + } } From 426b83d165092982ad21866e8062a61c2aeaaca3 Mon Sep 17 00:00:00 2001 From: innazh Date: Sun, 18 Aug 2024 23:44:03 +0000 Subject: [PATCH 10/11] Update all line num in the docs Since I had added imports, the line numbers fro the examples had to be updated. --- .../webdriver/drivers/options.en.md | 26 +++++++++---------- .../webdriver/drivers/options.ja.md | 26 +++++++++---------- .../webdriver/drivers/options.pt-br.md | 26 +++++++++---------- .../webdriver/drivers/options.zh-cn.md | 26 +++++++++---------- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index 22e37c934a7f..dd767e885b2e 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.en.md @@ -31,7 +31,7 @@ Browser name is set by default when using an Options class instance. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L66-67" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -58,7 +58,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-75" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -114,7 +114,7 @@ event fire is returned. {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L14-L16">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L9-L10">}} @@ -171,7 +171,7 @@ event fire is returned. {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L27-L29">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L19-L20">}} @@ -227,7 +227,7 @@ WebDriver only waits until the initial page is downloaded. {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L40-L42">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L29-L30">}} @@ -287,7 +287,7 @@ setting `platformName` sets the OS at the remote-end. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L81-L83">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -325,7 +325,7 @@ effect for the entire session. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L53-L54">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -360,7 +360,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L90-L92">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -389,7 +389,7 @@ _TimeoutException_. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L105-L107">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -416,7 +416,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L120-L122">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -454,7 +454,7 @@ user prompt encounters at the remote-end. This is defined by {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L134-L135">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -479,7 +479,7 @@ Indicates whether the remote end supports all of the [resizing and repositioning {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -507,7 +507,7 @@ when using _Element Send Keys_ with hidden file upload controls. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L148-L149">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md index ca64f9716d80..6df6df28da6b 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md @@ -31,7 +31,7 @@ Browser name is set by default when using an Options class instance. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L66-67" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -59,7 +59,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-75" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -112,7 +112,7 @@ WebDriver は [load](https://developer.mozilla.org/ja/docs/Web/API/Window/load_e {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L14-L16">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L9-L10">}} @@ -168,7 +168,7 @@ WebDriver は、[DOMContentLoaded](https://developer.mozilla.org/ja/docs/Web/API {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L27-L29">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L19-L20">}} @@ -223,7 +223,7 @@ WebDriver は、最初のページがダウンロードされるまで待機し {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L40-L42">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L29-L30">}} @@ -281,7 +281,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L81-L83">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -313,7 +313,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L53-L54">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -345,7 +345,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L90-L92">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -371,7 +371,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L105-L107">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -396,7 +396,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L120-L122">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -433,7 +433,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L134-L135">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -459,7 +459,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -486,7 +486,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L148-L149">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md index 5ce6eba10875..b5b295536e6f 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md @@ -43,7 +43,7 @@ extremidade remota, a criação da sessão falhará. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L66-67" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -71,7 +71,7 @@ tiver apenas 80 instalados, a criação da sessão falhará. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-75" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -127,7 +127,7 @@ event fire is returned. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L14-L16">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L9-L10">}} @@ -183,7 +183,7 @@ event fire is returned. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L27-L29">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L19-L20">}} @@ -238,7 +238,7 @@ WebDriver only waits until the initial page is downloaded. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L40-L42">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L29-L30">}} @@ -298,7 +298,7 @@ setting `platformName` sets the OS at the remote-end. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L81-L83">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -336,7 +336,7 @@ effect for the entire session. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L53-L54">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -372,7 +372,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L90-L92">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -401,7 +401,7 @@ _TimeoutException_. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L105-L107">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -428,7 +428,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L120-L122">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -467,7 +467,7 @@ user prompt encounters at the remote-end. This is defined by {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L134-L135">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -493,7 +493,7 @@ Indicates whether the remote end supports all of the [resizing and repositioning {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -522,7 +522,7 @@ when using _Element Send Keys_ with hidden file upload controls. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L148-L149">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md index 30d43b4c6917..b94b88ac546f 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md @@ -34,7 +34,7 @@ aliases: [ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L66-67" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -63,7 +63,7 @@ aliases: [ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-75" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -123,7 +123,7 @@ WebDriver一直等到 [load](https://developer.mozilla.org/en-US/docs/Web/API/Wi {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L14-L16">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L9-L10">}} @@ -179,7 +179,7 @@ WebDriver一直等到 [DOMContentLoaded](https://developer.mozilla.org/en-US/doc {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L27-L29">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L19-L20">}} @@ -234,7 +234,7 @@ WebDriver 仅等待初始页面已下载. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L40-L42">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L29-L30">}} @@ -294,7 +294,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L81-L83">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -329,7 +329,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L53-L54">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -364,7 +364,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L90-L92">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -392,7 +392,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L105-L107">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -418,7 +418,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L120-L122">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -457,7 +457,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L134-L135">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -484,7 +484,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -513,7 +513,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L148-L149">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} From 48cd7dbef67b53682ba2e5c8a20782b49b4f2271 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Mon, 19 Aug 2024 09:23:44 +0000 Subject: [PATCH 11/11] Fixing nightly version retrieval --- .github/workflows/java-examples.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java-examples.yml b/.github/workflows/java-examples.yml index 8cea55ce5f95..d3d11805b77a 100644 --- a/.github/workflows/java-examples.yml +++ b/.github/workflows/java-examples.yml @@ -67,7 +67,7 @@ jobs: command: | pip install yq xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/) - latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text') + latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r .text) echo $latest_snapshot cd examples/java mvn -B -U test -Dselenium.version="$latest_snapshot" @@ -81,7 +81,7 @@ jobs: command: | pip install yq $xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/" - $latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text' + $latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r .text Write-Output $latest_snapshot cd examples/java mvn -B -U test "-Dselenium.version=$latest_snapshot"