Skip to content

Commit

Permalink
👷 [#1834] Disable flakey e2e test in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Nov 6, 2023
1 parent 000ab68 commit 048f2af
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
@@ -1,4 +1,5 @@
from datetime import date
from unittest import skipIf
from unittest.mock import patch

from django.contrib.messages import get_messages
Expand All @@ -13,6 +14,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 +339,9 @@ def setUp(self) -> None:
self.action_list_url = reverse("profile:action_list")

def test_action_status(self, mock_solo):
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 048f2af

Please sign in to comment.