Skip to content

Commit

Permalink
Merge pull request #834 from maykinmedia/issue/1834-disable-flakey-fi…
Browse files Browse the repository at this point in the history
…refox-tests

✅ [#1834] Disable flakey e2e test in firefox
  • Loading branch information
stevenbal authored Nov 6, 2023
2 parents 74068e1 + 2216e9b commit 61361c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/open_inwoner/accounts/tests/test_action_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from open_inwoner.cms.tests import cms_tools
from open_inwoner.configurations.models import SiteConfiguration
from open_inwoner.utils.tests.playwright import get_driver_name

from ...utils.tests.playwright import PlaywrightSyncLiveServerTestCase
from ..choices import StatusChoices
Expand Down Expand Up @@ -337,6 +338,10 @@ def setUp(self) -> None:
self.action_list_url = reverse("profile:action_list")

def test_action_status(self, mock_solo):
# @skipIf(...) causes issues together with Playwright
if get_driver_name() == "firefox":
self.skipTest("Test is flakey in firefox")

mock_solo.return_value.cookiebanner_enabled = False

context = self.browser.new_context(storage_state=self.user_login_state)
Expand Down
6 changes: 5 additions & 1 deletion src/open_inwoner/utils/tests/playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
BROWSER_DEFAULT = "chromium"


def get_driver_name() -> str:
return os.environ.get("E2E_DRIVER", BROWSER_DEFAULT)


class PlaywrightSyncLiveServerTestCase(StaticLiveServerTestCase):
"""
base class for convenient synchronous Playwright in Django
Expand Down Expand Up @@ -73,7 +77,7 @@ def launch_browser(cls, playwright: Playwright) -> Browser:

@classmethod
def get_browser_launcher(cls) -> Callable[[Playwright], Browser]:
name = os.environ.get("E2E_DRIVER", BROWSER_DEFAULT)
name = get_driver_name()
if name in BROWSER_DRIVERS:
return BROWSER_DRIVERS[name]
else:
Expand Down

0 comments on commit 61361c6

Please sign in to comment.