You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fragment navigation test is now skipped for Chrome and Edge browsers. Consider adding alternative test coverage or documenting why this functionality cannot be tested on these browsers.
ignore(env.browsers(Browser.EDGE,Browser.CHROME)).it('can listen to fragment navigated event',asyncfunction(){letnavigationInfo=nullconstbrowsingConextInspector=awaitBrowsingContextInspector(driver)constbrowsingContext=awaitBrowsingContext(driver,{browsingContextId: awaitdriver.getWindowHandle(),})awaitbrowsingContext.navigate(Pages.linkedImage,'complete')awaitbrowsingConextInspector.onFragmentNavigated((entry)=>{navigationInfo=entry})awaitbrowsingContext.navigate(Pages.linkedImage+'#linkToAnchorOnThisPage','complete')// Chrome/Edge do not return the window's browsing context id as per the spec.// This assertion fails.assert.equal(navigationInfo.browsingContextId,browsingContext.id)assert(navigationInfo.url.includes('linkToAnchorOnThisPage'))},)
The userActivation parameter was removed from EvaluateParameters. Verify this change aligns with the BiDi specification and doesn't break expected browser behavior.
The false parameter in evaluateFunction seems incorrect for a test named "canEvaluateScriptWithUserActivationTrue". This could lead to incorrect test behavior since it contradicts the test's intention.
script.evaluateFunction(
- new EvaluateParameters(new ContextTarget(id), "window.open();", false));+ new EvaluateParameters(new ContextTarget(id), "window.open();", true));
Apply this suggestion
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a critical inconsistency where the test named "canEvaluateScriptWithUserActivationTrue" uses false for user activation, which contradicts the test's purpose and could lead to incorrect test behavior.
High
Fix contradictory test parameter
Similar to the previous test, the false parameter contradicts the test method name "canEvaluateScriptWithUserActivationTrue" and could cause test failures.
script.evaluateFunction(
- new EvaluateParameters(new ContextTarget(id), "window.open();", false));+ new EvaluateParameters(new ContextTarget(id), "window.open();", true));
Apply this suggestion
Suggestion importance[1-10]: 9
__
Why: The suggestion identifies the same critical issue in another test file where the parameter value contradicts the test method name, which could cause test validation failures and incorrect behavior verification.
High
Learned best practice
Enhance debugging comments by including specific details about expected versus actual behavior
The comment about Chrome/Edge behavior should be more specific and include details about what the actual behavior is versus what's expected according to the spec. This helps other developers better understand the issue.
-// Chrome/Edge do not return the window's browsing context id as per the spec.-// This assertion fails.+// Chrome/Edge return null for browsingContextId instead of the window's context id.+// Spec requires: browsingContextId to match the window handle.+// Actual: Chrome/Edge return null. See: https://w3c.github.io/webdriver-bidi/#navigation
assert.equal(navigationInfo.browsingContextId, browsingContext.id)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Thanks 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.
Motivation and Context
Prepping for the release
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
Fixed BiDi-related test failures across Java, .NET, and JavaScript.
Updated
EvaluateParametersto removeuserActivationin Java and .NET tests.Adjusted JavaScript test to ignore specific browsers for fragment navigation.
Improved test consistency and alignment with specifications.
Changes walkthrough 📝
CallFunctionParameterTest.java
Adjusted `EvaluateParameters` usage in Java testsjava/test/org/openqa/selenium/bidi/script/CallFunctionParameterTest.java
userActivationparameter inEvaluateParameters.EvaluateParametersTest.java
Simplified script evaluation in Java testsjava/test/org/openqa/selenium/bidi/script/EvaluateParametersTest.java
userActivationparameter inEvaluateParameters.CallFunctionParameterTest.cs
Updated BiDi script evaluation in .NET testsdotnet/test/common/BiDi/Script/CallFunctionParameterTest.cs
UserActivationparameter inEvaluateAsync.EvaluateParametersTest.cs
Enhanced script evaluation tests in .NETdotnet/test/common/BiDi/Script/EvaluateParametersTest.cs
UserActivationparameter inEvaluateAsync.browsingcontext_inspector_test.js
Adjusted fragment navigation test in JavaScriptjavascript/node/selenium-webdriver/test/bidi/browsingcontext_inspector_test.js