Start adding special features examples
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.
Description
Motivation and Context
Types of changes
- [ ] Change to the site (I have double-checked the Netlify deployment, and my changes look good)
- [ ] Code example added (and I also added the example to all translated languages)
- [ ] Improved translation
- [ ] Added new translation (and I also added a notice to each document missing translation)
Checklist
- [ ] I have read the contributing document.
- [ ] I have used hugo to render the site/docs locally and I am sure it works.
Deploy request for selenium-dev pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | 6b08dee16568c374f8b73e6b807cfd55f10f8b85 |
PR Description updated to latest commit (https://github.com/SeleniumHQ/seleniumhq.github.io/commit/bbdc626b28449199b8d4ee208691332b750fa50c)
- [ ] Copy walkthrough table to "Files Changed" Tab
PR Review 🔍
| ⏱️ Estimated effort to review [1-5] |
2, because the PR primarily involves adding a new example for a specific feature in Ruby and updating documentation across multiple languages to reference this new example. The changes are straightforward and localized, making the review process relatively quick and easy. |
| 🧪 Relevant tests |
Yes |
| ⚡ Possible issues |
Possible Bug: The code checks if the list of sinks is empty but does not handle the scenario where |
| 🔒 Security concerns |
No |
PR Code Suggestions ✨
| Category | Suggestions | |||||||
| Best practice |
Add an
| |||||||
Specify the type of exception expected in the test for clarity.To improve the exception handling, specify the type of exception you expect not to be examples/ruby/spec/browsers/chrome_spec.rb [124]
| ||||||||
| Performance |
Reduce redundant WebDriver calls by reusing the result stored in a variable.Instead of calling examples/ruby/spec/browsers/chrome_spec.rb [119-120]
| |||||||
| Maintainability |
Use a more descriptive variable name for the list of casting devices.To improve the readability and maintainability of the test, consider using a more examples/ruby/spec/browsers/chrome_spec.rb [120]
| |||||||
| Enhancement |
Add an assertion to ensure the list of sinks is not empty before proceeding with the test.To ensure that the test is more robust, add an assertion to check that the list of sinks examples/ruby/spec/browsers/chrome_spec.rb [121-124]
|
HI @aguspe,
Can we just include code from L119-L122 Or L124?
Hi @harsha509 thank you so much for the question, I think the best is still L119-L124 because in the current implementation if people try just to use @driver.cast_sinks it will actually not work
I made a question regarding this on the slack channel to see how much we needed to expand the example for the users, here is the message: https://seleniumhq.slack.com/archives/C0K0BK8MQ/p1715280896233389
HI @aguspe, Can we just include code from L119-L122 Or L124?
Hi @harsha509 thank you so much for the question, I think the best is still L119-L124 because in the current implementation if people try just to use @driver.cast_sinks it will actually not work
I made a question regarding this on the slack channel to see how much we needed to expand the example for the users, here is the message: https://seleniumhq.slack.com/archives/C0K0BK8MQ/p1715280896233389
L119-L124 looks fine to me...
HI @aguspe, Can we just include code from L119-L122 Or L124?
Hi @harsha509 thank you so much for the question, I think the best is still L119-L124 because in the current implementation if people try just to use @driver.cast_sinks it will actually not work I made a question regarding this on the slack channel to see how much we needed to expand the example for the users, here is the message: https://seleniumhq.slack.com/archives/C0K0BK8MQ/p1715280896233389
L119-L124 looks fine to me...
Perfect thank you so much @harsha509, let me know if there are other questions