From 4270a4f2bc6af48fbbc6ee2efa297be0cf0cf745 Mon Sep 17 00:00:00 2001 From: harsha509 Date: Wed, 18 Oct 2023 10:44:40 -0400 Subject: [PATCH] [JS] link code samples to github [deploy site] --- .../webdriver/elements/information.en.md | 38 ++++++------------- .../webdriver/elements/information.ja.md | 38 ++++++------------- .../webdriver/elements/information.pt-br.md | 38 ++++++------------- .../webdriver/elements/information.zh-cn.md | 38 ++++++------------- 4 files changed, 44 insertions(+), 108 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/elements/information.en.md b/website_and_docs/content/documentation/webdriver/elements/information.en.md index 9ee082ca0e30..9f0f5d963633 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.en.md @@ -54,12 +54,8 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html"); #fetch display status val = driver.find_element(name: 'email_input').displayed? {{< /tab >}} -{{< tab header="JavaScript" >}} -// Navigate to url -await driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - -// Resolves Promise and returns boolean value -let result = await driver.findElement(By.name("email_input")).isDisplayed(); +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L16-L17">}} {{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url @@ -113,13 +109,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns true if element is enabled else returns false ele = driver.find_element(name: 'button_input').enabled? {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to url -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Resolves Promise and returns boolean value -let element = await driver.findElement(By.name("button_input")).isEnabled(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L23-L24">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") @@ -168,13 +160,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns true if element is checked else returns false ele = driver.find_element(name: "checkbox_input").selected? {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to url -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Returns true if element ins checked else returns false -let res = await driver.findElement(By.name("checkbox_input")).isSelected(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L30-L31">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") @@ -219,13 +207,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns TagName of the element attr = driver.find_element(name: "email_input").tag_name {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to URL -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Returns TagName of the element -let value = await driver.findElement(By.name('email_input')).getTagName(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L37-L38">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") diff --git a/website_and_docs/content/documentation/webdriver/elements/information.ja.md b/website_and_docs/content/documentation/webdriver/elements/information.ja.md index 94042e583876..6d4c92aec872 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.ja.md @@ -53,12 +53,8 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html"); #fetch display status val = driver.find_element(name: 'email_input').displayed? {{< /tab >}} -{{< tab header="JavaScript" >}} -// Navigate to url -await driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - -// Resolves Promise and returns boolean value -let result = await driver.findElement(By.name("email_input")).isDisplayed(); +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L16-L17">}} {{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url @@ -108,13 +104,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns true if element is enabled else returns false ele = driver.find_element(name: 'button_input').enabled? {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to url -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Resolves Promise and returns boolean value -let element = await driver.findElement(By.name("button_input")).isEnabled(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L23-L24">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") @@ -160,13 +152,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns true if element is checked else returns false ele = driver.find_element(name: "checkbox_input").selected? {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to url -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Returns true if element ins checked else returns false -let res = await driver.findElement(By.name("checkbox_input")).isSelected(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L30-L31">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") @@ -210,13 +198,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns TagName of the element attr = driver.find_element(name: "email_input").tag_name {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to URL -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Returns TagName of the element -let value = await driver.findElement(By.name('email_input')).getTagName(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L37-L38">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") diff --git a/website_and_docs/content/documentation/webdriver/elements/information.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/information.pt-br.md index 6206242ad73c..c0ec4d9f9bb2 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.pt-br.md @@ -54,12 +54,8 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html"); #fetch display status val = driver.find_element(name: 'email_input').displayed? {{< /tab >}} -{{< tab header="JavaScript" >}} -// Navigate to url -await driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - -// Resolves Promise and returns boolean value -let result = await driver.findElement(By.name("email_input")).isDisplayed(); +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L16-L17">}} {{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url @@ -109,13 +105,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns true if element is enabled else returns false ele = driver.find_element(name: 'button_input').enabled? {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to url -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Resolves Promise and returns boolean value -let element = await driver.findElement(By.name("button_input")).isEnabled(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L23-L24">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") @@ -166,13 +158,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns true if element is checked else returns false ele = driver.find_element(name: "checkbox_input").selected? {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to url -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Returns true if element ins checked else returns false -let res = await driver.findElement(By.name("checkbox_input")).isSelected(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L30-L31">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") @@ -216,13 +204,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns TagName of the element attr = driver.find_element(name: "email_input").tag_name {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to URL -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Returns TagName of the element -let value = await driver.findElement(By.name('email_input')).getTagName(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L37-L38">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") diff --git a/website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md index 87e27f3db93c..f61a70155a88 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md @@ -47,12 +47,8 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html"); #fetch display status val = driver.find_element(name: 'email_input').displayed? {{< /tab >}} -{{< tab header="JavaScript" >}} -// Navigate to url -await driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - -// Resolves Promise and returns boolean value -let result = await driver.findElement(By.name("email_input")).isDisplayed(); +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L16-L17">}} {{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url @@ -101,13 +97,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns true if element is enabled else returns false ele = driver.find_element(name: 'button_input').enabled? {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to url -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Resolves Promise and returns boolean value -let element = await driver.findElement(By.name("button_input")).isEnabled(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L23-L24">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") @@ -152,13 +144,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns true if element is checked else returns false ele = driver.find_element(name: "checkbox_input").selected? {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to url -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Returns true if element ins checked else returns false -let res = await driver.findElement(By.name("checkbox_input")).isSelected(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L30-L31">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html") @@ -201,13 +189,9 @@ driver.get 'https://www.selenium.dev/selenium/web/inputs.html' # Returns TagName of the element attr = driver.find_element(name: "email_input").tag_name {{< /tab >}} - {{< tab header="JavaScript" >}} -// Navigate to URL -await driver.get('https://www.selenium.dev/selenium/web/inputs.html'); - -// Returns TagName of the element -let value = await driver.findElement(By.name('email_input')).getTagName(); - {{< /tab >}} +{{< tab header="JavaScript" text=true >}} +{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L37-L38">}} +{{< /tab >}} {{< tab header="Kotlin" >}} //navigates to url driver.get("https://www.selenium.dev/selenium/web/inputs.html")