From 617ff2e177539c20231f9ba39061f2662ac83c1d Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 22 Oct 2020 11:10:38 +0200 Subject: [PATCH 1/2] tests: mark test as flaky --- local-requirements.txt | 1 + tests/async/test_defaultbrowsercontext.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/local-requirements.txt b/local-requirements.txt index 2ba92a371..c60e27c42 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -4,6 +4,7 @@ pytest-cov==2.10.1 pytest-sugar==0.9.4 pytest-xdist==2.1.0 pytest-timeout==1.4.2 +flaky==3.7.0 pixelmatch==0.2.1 Pillow==7.2.0 mypy==0.782 diff --git a/tests/async/test_defaultbrowsercontext.py b/tests/async/test_defaultbrowsercontext.py index cffec4546..6a97c2d21 100644 --- a/tests/async/test_defaultbrowsercontext.py +++ b/tests/async/test_defaultbrowsercontext.py @@ -16,6 +16,7 @@ import os import pytest +from flaky import flaky from playwright.helper import Error @@ -279,6 +280,7 @@ async def test_should_accept_user_data_dir(server, tmpdir, launch_persistent): assert len(os.listdir(tmpdir)) > 0 +@flaky async def test_should_restore_state_from_userDataDir( browser_type, launch_arguments, server, tmp_path_factory ): From c052e3be642f212a2f63595ebfacacc7f2fb0bb7 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 22 Oct 2020 11:35:29 +0200 Subject: [PATCH 2/2] mark test_page_bring_to_front_should_work as flaky --- tests/async/test_headful.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/async/test_headful.py b/tests/async/test_headful.py index 66d09af07..f5c6b7ec3 100644 --- a/tests/async/test_headful.py +++ b/tests/async/test_headful.py @@ -16,6 +16,7 @@ import asyncio import pytest +from flaky import flaky async def test_should_have_default_url_when_launching_browser( @@ -179,6 +180,7 @@ async def test_should_not_override_viewport_size_when_passed_null( await browser.close() +@flaky async def test_page_bring_to_front_should_work(browser_type, launch_arguments): browser = await browser_type.launch(**{**launch_arguments, "headless": False}) page1 = await browser.newPage()