Closed vlad8x8 closed 1 week ago
⏱️ Estimated effort to review [1-5] | 1 |
🧪 Relevant tests | No |
🔒 Security concerns | No |
⚡ Key issues to review | None |
Category | Suggestion | Score |
Best practice |
Add a method description to explain the purpose and behavior of the
___
**Add a method description to explain the purpose and behavior of the | 7 |
Possible issue |
Ensure that the browser name is not null to prevent potential issues when setting capabilities___ **Ensure that theWEBVIEW2_BROWSER_NAME and EDGE.browserName() are not null to prevent potential issues when setting capabilities.** [java/src/org/openqa/selenium/edge/EdgeOptions.java [65-69]](https://github.com/SeleniumHQ/selenium/pull/14157/files#diff-2a19705afa93cc28103a6935b7f549605f8bcc8dc6b45f351d0e1cc97d273593R65-R69) ```diff public EdgeOptions useWebView(boolean enable) { String browserName = enable ? WEBVIEW2_BROWSER_NAME : EDGE.browserName(); + if (browserName == null) { + throw new IllegalStateException("Browser name cannot be null"); + } setCapability(CapabilityType.BROWSER_NAME, browserName); return this; } ``` - [ ] **Apply this suggestion** Suggestion importance[1-10]: 4Why: While ensuring non-null values is generally good, the suggestion lacks context on whether `WEBVIEW2_BROWSER_NAME` or `EDGE.browserName()` could realistically be null, which affects the necessity of this check. | 4 |
User description
All ChromiumOptions methods return
this
This commit makes EdgeOptions.useWebView behave the same as other Options methodsThanks for contributing to Selenium! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines. Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
All ChromiumOptions methods return
this
This commit makes EdgeOptions.useWebView behave the same as other Options methodsMotivation and Context
All ChromiumOptions methods return
this
This commit makes EdgeOptions.useWebView behave the same as other Options methodsTypes of changes
Checklist
PR Type
Enhancement
Description
useWebView
method inEdgeOptions
class to return theEdgeOptions
instance (this
) instead of void.ChromiumOptions
methods that returnthis
.Changes walkthrough 📝
EdgeOptions.java
Modify `useWebView` method to return `EdgeOptions` instance
java/src/org/openqa/selenium/edge/EdgeOptions.java
useWebView
method to returnEdgeOptions
instead of void.this
in theuseWebView
method.