Add new test for non-sharing, fix non-sharing use case

This commit is contained in:
Max Berger
2026-03-26 21:20:02 +01:00
parent 78cf5f7fe3
commit bde188ff55
10 changed files with 100 additions and 31 deletions

View File

@@ -24,17 +24,30 @@ from typing import Any, Generator
import pytest
from playwright.sync_api import Page, expect
from integ_tests.common import SHARING_HTPASSWD, login, start_radicale_server
from integ_tests.common import (
NOSHARE_HTPASSWD,
SHARING_HTPASSWD,
Config,
login,
start_radicale_server,
)
@pytest.fixture(params=[SHARING_HTPASSWD, NOSHARE_HTPASSWD], ids=lambda c: c.name)
def config(request: pytest.FixtureRequest) -> Config:
return request.param
@pytest.fixture
def radicale_server(tmp_path: pathlib.Path) -> Generator[str, Any, None]:
yield from start_radicale_server(tmp_path, SHARING_HTPASSWD)
def radicale_server(
tmp_path: pathlib.Path, config: Config
) -> Generator[str, Any, None]:
yield from start_radicale_server(tmp_path, config)
def test_login_logout_login(page: Page, radicale_server: str) -> None:
def test_login_logout_login(page: Page, radicale_server: str, config: Config) -> None:
# 1. First login
login(page, radicale_server, SHARING_HTPASSWD)
login(page, radicale_server, config)
expect(page.locator("#collectionsscene")).to_be_visible()
# 2. Logout
@@ -43,5 +56,5 @@ def test_login_logout_login(page: Page, radicale_server: str) -> None:
expect(page.locator("#collectionsscene")).to_be_hidden()
# 3. Second login
login(page, radicale_server, SHARING_HTPASSWD)
login(page, radicale_server, config)
expect(page.locator("#collectionsscene")).to_be_visible()