Add E2E tests
Django CI/CD / test (push) Failing after 1m1s
Django CI/CD / build-and-push (push) Has been skipped

This commit is contained in:
2026-06-09 12:47:44 +02:00
parent 83aefcb849
commit e45be806fc
6 changed files with 266 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import os
import shutil
import pytest
# Playwright runs an async event loop in the background, which triggers
# Django's async safety checks when running synchronous tests. This allows
# synchronous operations inside the async context safely.
os.environ.setdefault("DJANGO_ALLOW_ASYNC_UNSAFE", "true")
@pytest.fixture(scope="session")
def browser_type_launch_args(browser_type_launch_args):
# Try to find a system-installed Google Chrome or Chromium to bypass Nix/NixOS shared library issues
for browser_name in ["google-chrome-stable", "google-chrome", "chromium", "chrome"]:
path = shutil.which(browser_name)
if path:
return {
**browser_type_launch_args,
"executable_path": path,
}
# Fallback to default Playwright behavior
return browser_type_launch_args