-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java][bidi]: add test for onNavigationFailed
#16241
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
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
🎫 Ticket compliance analysis 🔶
5678 - Partially compliant
Compliant requirements:
Non-compliant requirements:
- Investigate/resolve ChromeDriver connection failures after first instantiation on Ubuntu.
- Diagnose "Error: ConnectFailure (Connection refused)" occurring for subsequent ChromeDriver instances.
- Provide steps or fixes related to Chrome/ChromeDriver versions mentioned.
Requires further human verification:
- Reproduce connection failure across multiple ChromeDriver instantiations on Ubuntu with specified versions.
- Validate environment-specific behavior and logs.
1234 - Partially compliant
Compliant requirements:
Non-compliant requirements:
- Address regression where click() no longer triggers JavaScript in link href in 2.48.x on Firefox 42.
- Provide fix or test coverage for JS href click handling.
Requires further human verification:
- Verify behavior on legacy Firefox/Selenium versions outside the scope of current PR.
Flaky Test Risk
Using a public invalid domain may not consistently fail quickly across environments or networks. Consider using a guaranteed blackhole domain (e.g., example.invalid) or a local unreachable endpoint to reduce flakiness.
context.navigate( "http://invalid-domain-that-does-not-exist.test/", ReadinessState.COMPLETE); } catch (Exception e) { // Expect an exception due to navigation failure } NavigationInfo navigationInfo = future.get(5, TimeUnit.SECONDS); assertThat(navigationInfo.getBrowsingContextId()).isEqualTo(context.getId()); assertThat(navigationInfo.getUrl()) .isEqualTo("http://invalid-domain-that-does-not-exist.test/"); }
Exception Handling
Catching a broad Exception and ignoring it can mask unexpected issues. Narrow the catch to the expected exception type(s) or assert that an exception occurred to ensure deterministic behavior.
} catch (Exception e) { // Expect an exception due to navigation failure }
Browser Skip Annotation
The @NotYetImplemented(FIREFOX) annotation is added; verify if other browsers need gating (e.g., EDGE/SAFARI) or if the event is consistently implemented across them to avoid intermittent CI failures.
@NotYetImplemented(FIREFOX) void canListenToNavigationFailedEvent()
PR Code Suggestions ✨Explore these optional code suggestions:
|
Hi @pujagani, could you review this PR?
Uh oh!
There was an error while loading. Please reload this page.
User description
🔗 Related Issues
💥 What does this PR do?
Adds test for
onNavigationFailed
event.🔧 Implementation Notes
💡 Additional Considerations
Initially, I added test for
onDownloadWillBegin
also, but it requires some implementation modification and a newDownloadInfo
class, so that will come in a separate PR.🔄 Types of changes
PR Type
Tests
Description
Add test for
onNavigationFailed
BiDi eventTest validates navigation failure handling with invalid domain
Include proper exception handling and assertions
Diagram Walkthrough
File Walkthrough
BrowsingContextInspectorTest.java
Add navigation failed event test
java/test/org/openqa/selenium/bidi/browsingcontext/BrowsingContextInspectorTest.java
NotYetImplemented
annotationcanListenToNavigationFailedEvent