mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-10-07 16:18:54 +00:00
test(form): guarantee Playwright browser cleanup
This commit is contained in:
parent
84cb6251fe
commit
fca2ec6044
1 changed files with 46 additions and 44 deletions
|
|
@ -343,6 +343,7 @@ class TestGenerateFormGooglePlaywright:
|
||||||
"Chromium is required for form Playwright tests. "
|
"Chromium is required for form Playwright tests. "
|
||||||
"Run: playwright install --with-deps chromium"
|
"Run: playwright install --with-deps chromium"
|
||||||
) from exc
|
) from exc
|
||||||
|
try:
|
||||||
page = browser.new_page()
|
page = browser.new_page()
|
||||||
page.add_init_script(
|
page.add_init_script(
|
||||||
"""window.google = {
|
"""window.google = {
|
||||||
|
|
@ -388,6 +389,7 @@ class TestGenerateFormGooglePlaywright:
|
||||||
)
|
)
|
||||||
page.locator("#admin-btn").wait_for(state="visible")
|
page.locator("#admin-btn").wait_for(state="visible")
|
||||||
yield page
|
yield page
|
||||||
|
finally:
|
||||||
browser.close()
|
browser.close()
|
||||||
|
|
||||||
@pytest.mark.parametrize("width", [320, 375])
|
@pytest.mark.parametrize("width", [320, 375])
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue