-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add ruby examples for the using selenium page #1649
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
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
27b8121
first script update
aguspe 7a4270b
Remove selenium manager error
aguspe 562ae71
Add examples on translations
aguspe 1021709
Reverse title
aguspe d411575
Merge branch 'trunk' into expand_ruby_examples_on_docs
aguspe 3632fc8
Merge branch 'trunk' into expand_ruby_examples_on_docs
aguspe 0a26e56
Merge branch 'trunk' into expand_ruby_examples_on_docs
aguspe eac7b50
Move example to README.md and link to example
aguspe d94261d
Merge remote-tracking branch 'origin/expand_ruby_examples_on_docs' in...
aguspe e4d1793
Merge branch 'trunk' into expand_ruby_examples_on_docs
aguspe 584c085
Merge branch 'trunk' into expand_ruby_examples_on_docs
aguspe c5093c9
Merge branch 'trunk' into expand_ruby_examples_on_docs
aguspe 7ee01cf
Merge branch 'trunk' into expand_ruby_examples_on_docs
aguspe 83402c4
Merge branch 'trunk' into expand_ruby_examples_on_docs
aguspe 9009895
Added examples for the using_selenium page in multiple languages and ...
aguspe 6dafcf4
Merge branch 'trunk' into add_ruby_documentation
aguspe b843c9c
Merge branch 'trunk' into add_ruby_documentation
aguspe 68b3559
Merge branch 'trunk' into add_ruby_documentation
aguspe 19de47b
Merge branch 'trunk' into add_ruby_documentation
diemol bad0d66
Merge branch 'trunk' into add_ruby_documentation
aguspe c8f4535
Remove the added quit and roll back the spec helper
aguspe 98ba630
Remove accidental typo
aguspe 09f6f5a
Merge branch 'trunk' into add_ruby_documentation
aguspe 90fe88f
Merge branch 'trunk' into add_ruby_documentation
diemol 910ad11
Merge branch 'trunk' into add_ruby_documentation
diemol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
23 changes: 12 additions & 11 deletions
examples/ruby/spec/getting_started/using_selenium_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,29 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| require 'spec_helper' | ||
| require 'selenium-webdriver' | ||
|
|
||
|
|
||
| RSpec.describe 'Using Selenium' do | ||
| it 'uses eight components' do | ||
| driver = Selenium::WebDriver.for :chrome | ||
| before do | ||
| @driver = Selenium::WebDriver.for :chrome | ||
| end | ||
|
|
||
| driver.get('https://www.selenium.dev/selenium/web/web-form.html') | ||
| it 'uses eight components' do | ||
| @driver.get('https://www.selenium.dev/selenium/web/web-form.html') | ||
|
|
||
| title = driver.title | ||
| title = @driver.title | ||
| expect(title).to eq('Web form') | ||
|
|
||
| driver.manage.timeouts.implicit_wait = 500 | ||
| @driver.manage.timeouts.implicit_wait = 500 | ||
|
|
||
| text_box = driver.find_element(name: 'my-text') | ||
| submit_button = driver.find_element(tag_name: 'button') | ||
| text_box = @driver.find_element(name: 'my-text') | ||
| submit_button = @driver.find_element(tag_name: 'button') | ||
|
|
||
| text_box.send_keys('Selenium') | ||
| submit_button.click | ||
|
|
||
| message = driver.find_element(id: 'message') | ||
| message = @driver.find_element(id: 'message') | ||
| value = message.text | ||
| expect(value).to eq('Received!') | ||
|
|
||
| driver.quit | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.