Skip to content

[pull] main from microsoft:main #6

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

Merged
merged 3 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion local-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ autobahn==23.1.2
black==25.1.0
build==1.2.2.post1
flake8==7.2.0
mypy==1.17.0
mypy==1.17.1
objgraph==3.6.2
Pillow==11.2.1
pixelmatch==0.3.0
Expand Down
4 changes: 2 additions & 2 deletions tests/async/test_defaultbrowsercontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async def test_context_add_cookies_should_work(
]
)
assert await page.evaluate("() => document.cookie") == "username=John Doe"
assert await page.context.cookies() == [
assert _filter_cookies(await page.context.cookies()) == [
{
"name": "username",
"value": "John Doe",
Expand All @@ -127,7 +127,7 @@ async def test_context_add_cookies_should_work(

def _filter_cookies(cookies: Sequence[Cookie]) -> List[Cookie]:
return list(
filter(lambda cookie: cookie["domain"] != "copilot.microsoft.com", cookies)
filter(lambda cookie: not cookie["domain"].endswith("microsoft.com"), cookies)
)


Expand Down
20 changes: 11 additions & 9 deletions tests/sync/test_browsercontext_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,25 @@ def test_dialog_event_should_work_with_inline_script_tag(
) -> None:
def handle_route(request: TestServerRequest) -> None:
request.setHeader("content-type", "text/html")
request.write(b"""<script>window.result = prompt('hey?')</script>""")
request.write(b"<script>window.result = prompt('hey?')</script>")
request.finish()

server.set_route("/popup.html", handle_route)
page.goto(server.EMPTY_PAGE)
page.set_content("<a href='popup.html' target=_blank>Click me</a>")

def handle_dialog(dialog: Dialog) -> None:
assert dialog.message == "hey?"
assert dialog.page == popup
dialog.accept("hello")
with (
page.context.expect_event("dialog") as dialog_info,
page.expect_popup() as popup_info,
):
page.click("a")

page.context.on("dialog", handle_dialog)
dialog: Dialog = dialog_info.value
popup: Page = popup_info.value

with page.expect_popup() as popup_info:
page.click("a")
popup = popup_info.value
assert dialog.message == "hey?"
assert dialog.page == popup
dialog.accept("hello")
assert popup.evaluate("window.result") == "hello"


Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy