Skip to content

Commit

Permalink
Add test for wait_for_ready_state method
Browse files Browse the repository at this point in the history
  • Loading branch information
khamaileon committed Feb 6, 2025
1 parent 31f0c9b commit ac1a089
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/core/test_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,12 @@ async def request_handler(event):
with pytest.raises(ValueError) as e:
tab.remove_handlers(handler=request_handler)
assert str(e) == "if handler is provided, event_type should be provided as well"


async def test_wait_for_ready_state(browser: zd.Browser):
tab = await browser.get(sample_file("groceries.html"))

await tab.wait_for_ready_state("complete")

ready_state = await tab.evaluate("document.readyState")
assert ready_state == "complete"

0 comments on commit ac1a089

Please sign in to comment.