Skip to content

[rb] Move examples for ruby elements interactions #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/ruby/spec/elements/interaction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,15 @@

RSpec.describe 'Element Interaction' do
let(:driver) { start_session }

before { driver.get 'https://www.selenium.dev/selenium/web/inputs.html' }

it 'clicks an element' do
driver.find_element(name: 'color_input').click
end

it 'clears and send keys to an element' do
driver.find_element(name: 'email_input').clear
driver.find_element(name: 'email_input').send_keys '[email protected]'
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,9 @@ Selenium will return an [element click intercepted](https://w3c.github.io/webdri
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L17-L21" >}}
{{< /tab >}}

{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Click the element
driver.find_element(name: 'color_input').click

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L11" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L20" >}}
{{< /tab >}}
Expand Down Expand Up @@ -118,20 +111,11 @@ possible keystrokes that WebDriver Supports.
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L27-L33" >}}
{{< /tab >}}


{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Clear field to empty it from any previous data
driver.find_element(name: 'email_input').clear

# Enter Text
driver.find_element(name: 'email_input').send_keys '[email protected]'

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L16" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/elements/interactions.spec.js#L21" >}}
{{< /tab >}}
Expand Down Expand Up @@ -178,17 +162,11 @@ with a`content-editable` attribute. If these conditions are not met,
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L40-L43" >}}
{{< /tab >}}


{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Clear field to empty it from any previous data
driver.find_element(name: 'email_input').clear

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L15" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/elements/interactions.spec.js#L20" >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,11 @@ Selenium will return an [element click intercepted](https://w3c.github.io/webdri
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L17-L21" >}}
{{< /tab >}}


{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Click the element
driver.find_element(name: 'color_input').click

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L11" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L20" >}}
{{< /tab >}}
Expand Down Expand Up @@ -115,18 +109,9 @@ possible keystrokes that WebDriver Supports.
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L27-L33" >}}
{{< /tab >}}

{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Clear field to empty it from any previous data
driver.find_element(name: 'email_input').clear

# Enter Text
driver.find_element(name: 'email_input').send_keys '[email protected]'

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L16" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/elements/interactions.spec.js#L21" >}}
{{< /tab >}}
Expand Down Expand Up @@ -172,17 +157,11 @@ with a`content-editable` attribute. If these conditions are not met,
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L40-L43" >}}
{{< /tab >}}


{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Clear field to empty it from any previous data
driver.find_element(name: 'email_input').clear

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L15" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/elements/interactions.spec.js#L20" >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,9 @@ Selenium will return an [element click intercepted](https://w3c.github.io/webdri
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L17-L21" >}}
{{< /tab >}}

{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Click the element
driver.find_element(name: 'color_input').click

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L11" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L20" >}}
{{< /tab >}}
Expand Down Expand Up @@ -116,18 +110,9 @@ possible keystrokes that WebDriver Supports.
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L27-L33" >}}
{{< /tab >}}

{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Clear field to empty it from any previous data
driver.find_element(name: 'email_input').clear

# Enter Text
driver.find_element(name: 'email_input').send_keys '[email protected]'

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L16" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/elements/interactions.spec.js#L21" >}}
{{< /tab >}}
Expand Down Expand Up @@ -173,16 +158,10 @@ with a`content-editable` attribute. If these conditions are not met,
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L40-L43" >}}
{{< /tab >}}

{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Clear field to empty it from any previous data
driver.find_element(name: 'email_input').clear

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L15" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/elements/interactions.spec.js#L20" >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,10 @@ Selenium将返回一个 [元素点击中断](https://w3c.github.io/webdriver/#df
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L17-L21" >}}
{{< /tab >}}

{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Click the element
driver.find_element(name: 'color_input').click

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L11" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L20" >}}
{{< /tab >}}
Expand Down Expand Up @@ -117,20 +111,11 @@ Selenium将返回一个 [元素点击中断](https://w3c.github.io/webdriver/#df
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L27-L33" >}}
{{< /tab >}}


{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Clear field to empty it from any previous data
driver.find_element(name: 'email_input').clear

# Enter Text
driver.find_element(name: 'email_input').send_keys '[email protected]'

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L16" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/elements/interactions.spec.js#L21" >}}
{{< /tab >}}
Expand Down Expand Up @@ -177,16 +162,10 @@ Selenium将返回一个 [元素点击中断](https://w3c.github.io/webdriver/#df
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InteractionTest.cs#L40-L43" >}}
{{< /tab >}}

{{< tab header="Ruby" >}}

# Navigate to URL
driver.get 'https://www.selenium.dev/selenium/web/inputs.html'

# Clear field to empty it from any previous data
driver.find_element(name: 'email_input').clear

{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples/ruby/spec/elements/interaction_spec.rb#L15" >}}
{{< /tab >}}
{{< tab header="JavaScript" text=true >}}
{{< gh-codeblock path="examples/javascript/test/elements/interactions.spec.js#L20" >}}
{{< /tab >}}
Expand Down
Loading