Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ [#1834] Disable flakey e2e test in firefox #834

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading