Skip to content
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

[wdspec] Align aborted navigation tests with specification #48751

Conversation

sadym-chromium
Copy link
Contributor

@sadym-chromium sadym-chromium commented Oct 22, 2024

Align aborted navigation tests with specification.

WebDriver BiDi requires to succeed the navigation, if it was aborted by another navigation:

Comment on lines 11 to 29
async def test_interactive_change_location_throws(bidi_session, inline,
new_tab):
new_url = inline("<div>foo</div>")
url_with_redirect = inline(f"<script>window.location='{new_url}';</script>")
with pytest.raises(error.UnknownErrorException):
await bidi_session.browsing_context.navigate(
context=new_tab["context"], url=url_with_redirect,
wait="interactive")


async def test_interactive_change_location_succeeded(bidi_session, inline,
new_tab):
new_url = inline("<div>foo</div>")
url_with_redirect = inline(f"<script>window.location='{new_url}';</script>")
result = await bidi_session.browsing_context.navigate(
context=new_tab["context"], url=url_with_redirect, wait="interactive")

any_string(result["navigation"])
assert result["url"] == new_url
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By definition, one of the two tests will necessarily fail. Given that both chrome and firefox pass test_interactive_change_location_throws at the moment, maybe we should only keep this one and updated when the spec is clarified?

@sadym-chromium sadym-chromium force-pushed the sadym/test_browsingContext_navigateWaitInteractive_redirect branch from f56cce3 to d9f3ac1 Compare November 25, 2024 14:31
@sadym-chromium sadym-chromium changed the title Test change document location while navigating [wdspec] Align aborted navigation tests with specification Nov 25, 2024
Copy link
Contributor

@juliandescottes juliandescottes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at the two similar tests in bidi/browsing_context/navigation_failed/navigation_failed.py, at the moment they expect a navigationFailed event for similar scenarios. If I understand the spec change correctly, this also wrong? Can you check if they need updating?

@sadym-chromium
Copy link
Contributor Author

I was looking at the two similar tests in bidi/browsing_context/navigation_failed/navigation_failed.py, at the moment they expect a navigationFailed event for similar scenarios. If I understand the spec change correctly, this also wrong? Can you check if they need updating?

I'm working on it from the implementation side: GoogleChromeLabs/chromium-bidi#2856

@juliandescottes
Copy link
Contributor

I was looking at the two similar tests in bidi/browsing_context/navigation_failed/navigation_failed.py, at the moment they expect a navigationFailed event for similar scenarios. If I understand the spec change correctly, this also wrong? Can you check if they need updating?

I'm working on it from the implementation side: GoogleChromeLabs/chromium-bidi#2856

Does this mean you will also update those tests here or will it be another PR?

@sadym-chromium
Copy link
Contributor Author

closing in favor of #49718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants