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

issues on upgrade from 0.0.10 -> 0.0.12 #43

Closed
hampsterx opened this issue Mar 2, 2021 · 1 comment · Fixed by microsoft/playwright#5685
Closed

issues on upgrade from 0.0.10 -> 0.0.12 #43

hampsterx opened this issue Mar 2, 2021 · 1 comment · Fixed by microsoft/playwright#5685

Comments

@hampsterx
Copy link

Hi there, couple of (hopefully small) issues :)

 browser = getattr(playwright, browser_name).launch(**launch_options)
E       TypeError: launch() got an unexpected keyword argument 'slowMo'

Also

page.wait_for_response('**/api/1.0/blah*')
E       AttributeError: 'Page' object has no attribute 'wait_for_response'

quick 5s debugging..

page.__class__
<class 'playwright.sync_api._generated.Page'>

(Pdb) dir(page)

[..., 'wait_for_event', 'wait_for_function', 'wait_for_load_state', 'wait_for_selector', 'wait_for_timeout', 'workers']

Cheers~

@mxschmitt
Copy link
Member

Hi, slowMo is now slow_mo now since a few weeks. wait_for_response in the sync world is not-ideal, since the request sometimes can also can occur before your click e.g. has finished. Something like that is more recommended:

    page.goto(server.EMPTY_PAGE)
    with page.expect_response(server.PREFIX + "/digits/2.png") as response_info:
        page.click("foo")
    # optionally you can access the response like that
    response = response_info.value
    assert response.url == server.PREFIX + "/digits/2.png"

Will follow up on it so its reflected in the docs correctly.

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

Successfully merging a pull request may close this issue.

2 participants