-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand documentation on fresh browser per test #1671
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
Conversation
👷 Deploy request for selenium-dev pending review.Visit the deploys page to approve it
|
CLA assistant check
All committers have signed the CLA.
PR Description updated to latest commit (7f2aa0a)
- Copy walkthrough table to "Files Changed" Tab
PR Review
2, because the PR primarily focuses on expanding documentation with code examples across multiple languages. The changes are straightforward and involve adding explanations and code snippets to illustrate the concept of using a fresh browser for each test. The complexity is low, and the main effort would be in verifying the correctness and clarity of the examples provided.
No
Clarity: The documentation could benefit from a brief explanation of why using a static WebDriver can lead to issues, especially for readers who might not be familiar with concepts like thread safety and parallel test execution.
Consistency: Ensure that the code examples provided are consistent across different language versions of the documentation. This includes not only the code syntax but also the comments and explanations that accompany them.
No
✨ Review tool usage guide:
Overview:
The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.
The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
- When commenting, to edit configurations related to the review tool (
pr_reviewersection), use the following template:
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
- With a configuration file, use the following template:
[pr_reviewer]
some_config1=...
some_config2=...
See the review usage page for a comprehensive guide on using this tool.
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
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.
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.
There is already a code sample for this: https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/python/tests/conftest.py#L15-L21
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.
We prefer to avoid mentioning ThreadDriver as it has brought more damage than benefit.
Perhaps show here the code examples we have already:
I was wondering about showing ThreadLocal or not given its many issues. I'll remove the references to existing code in examples
We never got a reply to the comments. Closing.
Uh oh!
There was an error while loading. Please reload this page.
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.
Description
Added an extended explanation and code examples on how to implement a fresh browser per test. Tried to avoid specific framework code like JUnit vs TestNG.
Motivation and Context
I see a lot of Selenium automation project in the industry with a static WebDriver that gets shared between tests and across all these teams there has always been confusion on how to get started with a fresh browser per test. This is made more prominent with requirements to run tests is parallel and a lot of automation coders not understanding the implications a static driver (without ThreadLocal which brings its own complications) has in attempts to run parallel tests in multi-threaded languages like Java or C#
Types of changes
Checklist
Type
documentation, enhancement
Description
Changes walkthrough
fresh_browser_per_test.en.md
Enhance Documentation with Fresh Browser Per Test Exampleswebsite_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md
implementing a fresh browser per test.
ThreadLocal for thread safety.
fresh_browser_per_test.ja.md
Add Fresh Browser Per Test Examples in Japanese Documentationwebsite_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md
execution.
fresh_browser_per_test.pt-br.md
Update Portuguese Documentation with Browser Per Test Strategywebsite_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md
instance per test.
for thread safety.
fresh_browser_per_test.zh-cn.md
Enhance Chinese Documentation with New Browser Per Test Exampleswebsite_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md
ThreadLocal in test isolation.