Closed aguspe closed 3 months ago
Visit the deploys page to approve it
Name | Link |
---|---|
Latest commit | 8caf46a5be2355463565942e1f17c6f54d747a3b |
PR Description updated to latest commit (https://github.com/SeleniumHQ/seleniumhq.github.io/commit/8caf46a5be2355463565942e1f17c6f54d747a3b)
โฑ๏ธ Estimated effort to review [1-5] | 2, because the changes are mostly straightforward with the addition of new tests and minor updates to documentation. The code is well-structured and mainly involves standard API usage and test assertions. |
๐งช Relevant tests | Yes |
โก Possible issues | Possible Bug: The `permission` method uses an asynchronous script to query permissions but does not handle potential errors or rejections from the `navigator.permissions.query` method. This could lead to unhandled promise rejections if the query fails. |
๐ Security concerns | No |
Category | Suggestion | Score |
Best practice |
Replace
___
**Instead of using | 8 |
Add proper cleanup to ensure the browser is closed after the test___ **Ensure that the@driver instance is properly quit after the test to avoid leaving the browser open.** [examples/ruby/spec/browsers/chrome_spec.rb [138-143]](https://github.com/SeleniumHQ/seleniumhq.github.io/pull/1731/files#diff-f3e68237826e1b64c37885dc12602e936e6e4ea29da653aeb659d466a465ffcaR138-R143) ```diff @driver = Selenium::WebDriver.for :chrome -@driver.navigate.to 'https://www.selenium.dev/selenium/web/' -sleep 1 -logs = @driver.logs.get(:browser) -expect(logs.first.message).to include 'Failed to load resource' +begin + @driver.navigate.to 'https://www.selenium.dev/selenium/web/' + wait = Selenium::WebDriver::Wait.new(timeout: 10) + wait.until { @driver.find_element(tag_name: 'body') } + logs = @driver.logs.get(:browser) + expect(logs.first.message).to include 'Failed to load resource' +ensure + @driver.quit +end ``` Suggestion importance[1-10]: 7Why: Ensuring that the `@driver` instance is properly quit after the test is a best practice to avoid resource leakage, making this suggestion valuable. | 7 | |
Possible issue |
Add error handling to the
___
**Add error handling for the | 7 |
Enhancement |
Combine multiple
___
**Combine the two | 6 |
User description
Description
This PR adds examples for permissions in Chrome using Ruby, it also updates and organizes the logs test so they are under the same describe group
Motivation and Context
The documentation must be up to date so users can find concrete examples and be aware of all the possibilities that Selenium has to offer
Right now the example looks like this:
Types of changes
Checklist
PR Type
Enhancement, Documentation
Description
permission
to check permission states in tests.Changes walkthrough ๐
chrome_spec.rb
Add and refactor tests for Chrome browser permissions and logs
examples/ruby/spec/browsers/chrome_spec.rb
permission
to check permission states.chrome.en.md
Update Ruby code block references in Chrome documentation (EN)
website_and_docs/content/documentation/webdriver/browsers/chrome.en.md - Updated code block references for Ruby examples.
chrome.ja.md
Update Ruby code block references in Chrome documentation (JA)
website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md - Updated code block references for Ruby examples.
chrome.pt-br.md
Update Ruby code block references in Chrome documentation (PT-BR)
website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md - Updated code block references for Ruby examples.
chrome.zh-cn.md
Update Ruby code block references in Chrome documentation (ZH-CN)
website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md - Updated code block references for Ruby examples.