From 62da9a461a6d4fcf9865f9c48f056b9b03d15206 Mon Sep 17 00:00:00 2001 From: Simon Benzer Date: Tue, 24 Sep 2024 14:18:38 -0400 Subject: [PATCH 1/2] Added Javascript Example to Selenium Manager --- .../test/selenium_manager/usage.spec.js | 34 +++++++++++++++++++ .../documentation/selenium_manager.en.md | 7 ++-- .../documentation/selenium_manager.ja.md | 7 ++-- .../documentation/selenium_manager.pt-br.md | 7 ++-- .../documentation/selenium_manager.zh-cn.md | 7 ++-- 5 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 examples/javascript/test/selenium_manager/usage.spec.js diff --git a/examples/javascript/test/selenium_manager/usage.spec.js b/examples/javascript/test/selenium_manager/usage.spec.js new file mode 100644 index 000000000000..cb11e2001d8f --- /dev/null +++ b/examples/javascript/test/selenium_manager/usage.spec.js @@ -0,0 +1,34 @@ +const Chrome = require('selenium-webdriver/chrome'); +const {Browser, Builder} = require("selenium-webdriver"); +const {getBinaryPaths} = require("selenium-webdriver/common/driverFinder"); +const options = new Chrome.Options(); + +describe('Usage Test', function () { + it('After Selenium Manager', async function () { + + let driver = new Builder() + .forBrowser(Browser.CHROME) + .build(); + + await driver.get('https://www.selenium.dev/selenium/web/blank.html'); + await driver.quit(); + }); + + it('Before Selenium Manager', async function () { + let paths = getBinaryPaths(options) + let driverPath = paths.driverPath; + let browserPath = paths.browserPath; + + options.setChromeBinaryPath(browserPath) + + let service = new Chrome.ServiceBuilder().setPath(driverPath) + + let driver = new Builder() + .forBrowser(Browser.CHROME) + .setChromeService(service) + .build(); + + await driver.get('https://www.selenium.dev/selenium/web/blank.html'); + await driver.quit(); + }); +}); \ No newline at end of file diff --git a/website_and_docs/content/documentation/selenium_manager.en.md b/website_and_docs/content/documentation/selenium_manager.en.md index 86dea97d1806..fac44d989985 100644 --- a/website_and_docs/content/documentation/selenium_manager.en.md +++ b/website_and_docs/content/documentation/selenium_manager.en.md @@ -227,8 +227,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c {{< tab header="Ruby" >}} {{< badge-code >}} {{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} +{{% tab header="JavaScript" %}} +**Previously** +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}} +**Selenium Manager** +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/selenium_manager.ja.md b/website_and_docs/content/documentation/selenium_manager.ja.md index 463b984231e1..e5b66188040e 100644 --- a/website_and_docs/content/documentation/selenium_manager.ja.md +++ b/website_and_docs/content/documentation/selenium_manager.ja.md @@ -227,8 +227,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c {{< tab header="Ruby" >}} {{< badge-code >}} {{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} +{{% tab header="JavaScript" %}} +**Previously** +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}} +**Selenium Manager** +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/selenium_manager.pt-br.md b/website_and_docs/content/documentation/selenium_manager.pt-br.md index 463b984231e1..e5b66188040e 100644 --- a/website_and_docs/content/documentation/selenium_manager.pt-br.md +++ b/website_and_docs/content/documentation/selenium_manager.pt-br.md @@ -227,8 +227,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c {{< tab header="Ruby" >}} {{< badge-code >}} {{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} +{{% tab header="JavaScript" %}} +**Previously** +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}} +**Selenium Manager** +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/selenium_manager.zh-cn.md b/website_and_docs/content/documentation/selenium_manager.zh-cn.md index 463b984231e1..e5b66188040e 100644 --- a/website_and_docs/content/documentation/selenium_manager.zh-cn.md +++ b/website_and_docs/content/documentation/selenium_manager.zh-cn.md @@ -227,8 +227,11 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c {{< tab header="Ruby" >}} {{< badge-code >}} {{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} +{{% tab header="JavaScript" %}} +**Previously** +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}} +**Selenium Manager** +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} From bef96e50c80e177b2104425487f00cf397b17b48 Mon Sep 17 00:00:00 2001 From: Simon Benzer Date: Thu, 2 Jan 2025 17:32:55 -0500 Subject: [PATCH 2/2] removed GetBinaryPaths --- examples/javascript/test/selenium_manager/usage.spec.js | 2 -- website_and_docs/content/documentation/selenium_manager.en.md | 4 ++-- website_and_docs/content/documentation/selenium_manager.ja.md | 4 ++-- .../content/documentation/selenium_manager.pt-br.md | 4 ++-- .../content/documentation/selenium_manager.zh-cn.md | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/examples/javascript/test/selenium_manager/usage.spec.js b/examples/javascript/test/selenium_manager/usage.spec.js index cb11e2001d8f..7dd6ae92fcf3 100644 --- a/examples/javascript/test/selenium_manager/usage.spec.js +++ b/examples/javascript/test/selenium_manager/usage.spec.js @@ -1,6 +1,5 @@ const Chrome = require('selenium-webdriver/chrome'); const {Browser, Builder} = require("selenium-webdriver"); -const {getBinaryPaths} = require("selenium-webdriver/common/driverFinder"); const options = new Chrome.Options(); describe('Usage Test', function () { @@ -15,7 +14,6 @@ describe('Usage Test', function () { }); it('Before Selenium Manager', async function () { - let paths = getBinaryPaths(options) let driverPath = paths.driverPath; let browserPath = paths.browserPath; diff --git a/website_and_docs/content/documentation/selenium_manager.en.md b/website_and_docs/content/documentation/selenium_manager.en.md index f880245f004f..863ea00301f5 100644 --- a/website_and_docs/content/documentation/selenium_manager.en.md +++ b/website_and_docs/content/documentation/selenium_manager.en.md @@ -236,9 +236,9 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c {{< /tab >}} {{% tab header="JavaScript" %}} **Previously** -{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}} +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L16-L31" >}} **Selenium Manager** -{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}} +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L6-L14" >}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/selenium_manager.ja.md b/website_and_docs/content/documentation/selenium_manager.ja.md index 075206a21037..a6ce0b6d6f97 100644 --- a/website_and_docs/content/documentation/selenium_manager.ja.md +++ b/website_and_docs/content/documentation/selenium_manager.ja.md @@ -236,9 +236,9 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c {{< /tab >}} {{% tab header="JavaScript" %}} **Previously** -{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}} +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L16-L31" >}} **Selenium Manager** -{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}} +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L6-L14" >}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/selenium_manager.pt-br.md b/website_and_docs/content/documentation/selenium_manager.pt-br.md index 075206a21037..a6ce0b6d6f97 100644 --- a/website_and_docs/content/documentation/selenium_manager.pt-br.md +++ b/website_and_docs/content/documentation/selenium_manager.pt-br.md @@ -236,9 +236,9 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c {{< /tab >}} {{% tab header="JavaScript" %}} **Previously** -{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}} +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L16-L31" >}} **Selenium Manager** -{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}} +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L6-L14" >}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/selenium_manager.zh-cn.md b/website_and_docs/content/documentation/selenium_manager.zh-cn.md index 075206a21037..a6ce0b6d6f97 100644 --- a/website_and_docs/content/documentation/selenium_manager.zh-cn.md +++ b/website_and_docs/content/documentation/selenium_manager.zh-cn.md @@ -236,9 +236,9 @@ INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\117.0.5938.22\c {{< /tab >}} {{% tab header="JavaScript" %}} **Previously** -{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L17-L33" >}} +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L16-L31" >}} **Selenium Manager** -{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L7-L15" >}} +{{< gh-codeblock path="examples/javascript/test/selenium_manager/usage.spec.js#L6-L14" >}} {{< /tab >}} {{< tab header="Kotlin" >}} {{< badge-code >}}