I would like playwright to fail early, and stop as soon as one http request is not 200 or 302.
def test_it(live_server):
os.environ['DEBUG']='pw:api'
with sync_playwright() as playwright:
run_test_id(live_server, playwright)
def run_test_id(live_server, playwright):
browser = playwright.webkit.launch(headless=False)
context = browser.new_context()
page = context.new_page()
page.goto(live_server.url)
page.click("text=Create Test Data")
Unfortunately page.click() returns None, so I have no clue how I can check for the http status of the click.
How could I implement "Fail on unusual http status" in Playwright?