Improvements

This commit is contained in:
Edward Betts 2023-08-11 11:35:32 +01:00
parent f6085aae21
commit 0e3a9d7ea2

View file

@ -55,8 +55,8 @@ def run(playwright: Playwright) -> None:
context = browser.new_context() context = browser.new_context()
page = context.new_page() page = context.new_page()
# hr = HandleResponse() hr = HandleResponse()
# page.on("requestfinished", hr.requestfinished) page.on("requestfinished", hr.requestfinished)
re_month_name = re.compile(r"^([A-Z][a-z]+) (\d{4})$") re_month_name = re.compile(r"^([A-Z][a-z]+) (\d{4})$")
@ -65,10 +65,11 @@ def run(playwright: Playwright) -> None:
page.get_by_role("textbox", name="Outbound").click() page.get_by_role("textbox", name="Outbound").click()
month_row = page.get_by_role("row", name=re_month_name) month_row = page.get_by_role("row", name=re_month_name)
month_and_year = month_row.inner_text() month_and_year = month_row.inner_text().strip()
if month_and_year == "August 2023": if month_and_year == "August 2023":
month_row.get_by_role("cell").nth(1).click() month_row.get_by_role("cell").nth(1).click()
# page.get_by_role("row", name="August 2023").get_by_role("cell").nth(1).click() else:
assert month_and_year == "September 2023"
page.get_by_role("cell", name="29").click() page.get_by_role("cell", name="29").click()
page.get_by_role("textbox", name="Return").click() page.get_by_role("textbox", name="Return").click()