-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
added frame code #2236
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
added frame code #2236
Conversation
👷 Deploy request for selenium-dev pending review.Visit the deploys page to approve it
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Hey @aguspe ... I fixed the gem file.. and code looking at the PR 2100 example. now everything fails :( . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor tidy ups if you are interested
@@ -7,5 +7,5 @@ gem 'rake', '~> 13.0' | |||
gem 'rspec', '~> 3.0' | |||
gem 'rubocop', '~> 1.35' | |||
gem 'rubocop-rspec', '~> 3.0' | |||
gem 'selenium-devtools', '= 0.133.0' | |||
gem 'selenium-webdriver', '= 4.29.1' | |||
gem 'selenium-devtools', '= 0.134.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traditionally exact versions can be provided just by doing '0.134.0'
(Same below)
let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) } | ||
|
||
it 'interacts with elements inside iframes' do | ||
#navigate to web page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code comments might trip up IDE's as generally they have one space infront of the #
# Switch to iframe using WebElement | ||
iframe = driver.find_element(id: 'iframe1') | ||
driver.switch_to.frame(iframe) | ||
expect(driver.page_source.include?('We Leave From Here')).to be true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(driver.page_source.include?('We Leave From Here')).to be true | |
expect(driver.page_source).to include('We Leave From Here') |
Reason. RSpec exposes these booleans and it's a way of getting a better error message if it occurs
# Switch to iframe using name | ||
iframe=driver.find_element(name: 'iframe1-name') | ||
driver.switch_to.frame(iframe) | ||
expect(driver.page_source.include?('We Leave From Here')).to be true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(driver.page_source.include?('We Leave From Here')).to be true | |
expect(driver.page_source).to include('We Leave From Here') |
Thank you very much @luke-hill |
User description
Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.
added frame code
Description
added frame code
Motivation and Context
Types of changes
Checklist
PR Type
Tests, Documentation
Description
Added a comprehensive Ruby test for iframe interactions.
Updated Ruby code snippets in multiple documentation files.
Improved iframe-related documentation across various languages.
Modified Hugo configuration to ignore specific errors.
Changes walkthrough 📝
frames_spec.rb
Add Ruby test for iframe interactions
examples/ruby/spec/interactions/frames_spec.rb
frames.en.md
Update Ruby iframe examples in English documentation
website_and_docs/content/documentation/webdriver/interactions/frames.en.md
frames.ja.md
Update Ruby iframe examples in Japanese documentation
website_and_docs/content/documentation/webdriver/interactions/frames.ja.md
frames.pt-br.md
Update Ruby iframe examples in Brazilian Portuguese documentation
website_and_docs/content/documentation/webdriver/interactions/frames.pt-br.md
frames.zh-cn.md
Update Ruby iframe examples in Chinese documentation
website_and_docs/content/documentation/webdriver/interactions/frames.zh-cn.md
hugo.toml
Update Hugo configuration for error handling
website_and_docs/hugo.toml