Fixed imports
This commit is contained in:
@@ -25,12 +25,10 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from enum import Enum
|
||||||
from typing import Any, Generator, Optional
|
from typing import Any, Generator, Optional
|
||||||
|
|
||||||
from playwright.sync_api import BrowserContext, Page
|
from playwright.sync_api import BrowserContext, Page, expect
|
||||||
|
|
||||||
|
|
||||||
from enum import Enum
|
|
||||||
|
|
||||||
|
|
||||||
class AuthType(Enum):
|
class AuthType(Enum):
|
||||||
@@ -101,7 +99,7 @@ type = {config.auth_type.value}
|
|||||||
f.write("htpasswd_encryption = plain\n")
|
f.write("htpasswd_encryption = plain\n")
|
||||||
|
|
||||||
f.write(
|
f.write(
|
||||||
f"""[web]
|
"""[web]
|
||||||
type = internal
|
type = internal
|
||||||
[headers]
|
[headers]
|
||||||
Content-Security-Policy = default-src 'self'; object-src 'none'
|
Content-Security-Policy = default-src 'self'; object-src 'none'
|
||||||
@@ -172,9 +170,6 @@ max:maxpassword
|
|||||||
process.wait()
|
process.wait()
|
||||||
|
|
||||||
|
|
||||||
from playwright.sync_api import BrowserContext, Page, expect
|
|
||||||
|
|
||||||
|
|
||||||
def login(
|
def login(
|
||||||
page: Page,
|
page: Page,
|
||||||
radicale_server: str,
|
radicale_server: str,
|
||||||
|
|||||||
@@ -24,14 +24,9 @@ from typing import Any, Generator
|
|||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page, expect
|
from playwright.sync_api import BrowserContext, Page, expect
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||||
NOSHARE_HTPASSWD,
|
SHARING_XREMOTE, Config, login,
|
||||||
SHARING_HTPASSWD,
|
start_radicale_server)
|
||||||
SHARING_XREMOTE,
|
|
||||||
Config,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@@ -41,7 +36,9 @@ def radicale_server(
|
|||||||
yield from start_radicale_server(tmp_path, config)
|
yield from start_radicale_server(tmp_path, config)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD])
|
@pytest.mark.parametrize(
|
||||||
|
"config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD]
|
||||||
|
)
|
||||||
def test_index_html_loads(page: Page, radicale_server: str, config: Config) -> None:
|
def test_index_html_loads(page: Page, radicale_server: str, config: Config) -> None:
|
||||||
"""Test that the index.html loads from the server."""
|
"""Test that the index.html loads from the server."""
|
||||||
console_msgs: list[str] = []
|
console_msgs: list[str] = []
|
||||||
@@ -53,7 +50,9 @@ def test_index_html_loads(page: Page, radicale_server: str, config: Config) -> N
|
|||||||
assert len(errors) == 0
|
assert len(errors) == 0
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD])
|
@pytest.mark.parametrize(
|
||||||
|
"config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD]
|
||||||
|
)
|
||||||
def test_user_login_works(
|
def test_user_login_works(
|
||||||
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|||||||
@@ -24,15 +24,9 @@ from typing import Any, Generator
|
|||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page, expect
|
from playwright.sync_api import BrowserContext, Page, expect
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||||
NOSHARE_HTPASSWD,
|
SHARING_XREMOTE, Config, create_collection,
|
||||||
SHARING_HTPASSWD,
|
login, start_radicale_server)
|
||||||
SHARING_XREMOTE,
|
|
||||||
Config,
|
|
||||||
create_collection,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@@ -42,7 +36,9 @@ def radicale_server(
|
|||||||
yield from start_radicale_server(tmp_path, config)
|
yield from start_radicale_server(tmp_path, config)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD])
|
@pytest.mark.parametrize(
|
||||||
|
"config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD]
|
||||||
|
)
|
||||||
def test_delete_wrong_confirmation(
|
def test_delete_wrong_confirmation(
|
||||||
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
||||||
) -> None:
|
) -> None:
|
||||||
@@ -68,7 +64,9 @@ def test_delete_wrong_confirmation(
|
|||||||
expect(page.locator("#deleteconfirmationscene")).to_be_visible()
|
expect(page.locator("#deleteconfirmationscene")).to_be_visible()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD])
|
@pytest.mark.parametrize(
|
||||||
|
"config", [SHARING_HTPASSWD, SHARING_XREMOTE, NOSHARE_HTPASSWD]
|
||||||
|
)
|
||||||
def test_delete_correct_confirmation(
|
def test_delete_correct_confirmation(
|
||||||
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
context: BrowserContext, page: Page, radicale_server: str, config: Config
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|||||||
@@ -18,19 +18,15 @@
|
|||||||
Integration tests for download page
|
Integration tests for download page
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import pathlib
|
||||||
from typing import Any, Generator
|
from typing import Any, Generator
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page
|
from playwright.sync_api import BrowserContext, Page
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||||
NOSHARE_HTPASSWD,
|
SHARING_XREMOTE, Config, login,
|
||||||
SHARING_HTPASSWD,
|
start_radicale_server)
|
||||||
SHARING_XREMOTE,
|
|
||||||
Config,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(
|
@pytest.fixture(
|
||||||
|
|||||||
@@ -24,15 +24,9 @@ from typing import Any, Generator
|
|||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page, expect
|
from playwright.sync_api import BrowserContext, Page, expect
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||||
NOSHARE_HTPASSWD,
|
SHARING_XREMOTE, Config, create_collection,
|
||||||
SHARING_HTPASSWD,
|
login, start_radicale_server)
|
||||||
SHARING_XREMOTE,
|
|
||||||
Config,
|
|
||||||
create_collection,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(
|
@pytest.fixture(
|
||||||
|
|||||||
@@ -24,15 +24,9 @@ from typing import Any, Generator
|
|||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page, expect
|
from playwright.sync_api import BrowserContext, Page, expect
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||||
NOSHARE_HTPASSWD,
|
SHARING_XREMOTE, Config, create_collection,
|
||||||
SHARING_HTPASSWD,
|
login, start_radicale_server)
|
||||||
SHARING_XREMOTE,
|
|
||||||
Config,
|
|
||||||
create_collection,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(
|
@pytest.fixture(
|
||||||
|
|||||||
@@ -24,13 +24,8 @@ from typing import Any, Generator
|
|||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import Page, expect
|
from playwright.sync_api import Page, expect
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD, Config,
|
||||||
NOSHARE_HTPASSWD,
|
login, start_radicale_server)
|
||||||
SHARING_HTPASSWD,
|
|
||||||
Config,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(params=[SHARING_HTPASSWD, NOSHARE_HTPASSWD], ids=lambda c: c.name)
|
@pytest.fixture(params=[SHARING_HTPASSWD, NOSHARE_HTPASSWD], ids=lambda c: c.name)
|
||||||
|
|||||||
@@ -24,14 +24,9 @@ from typing import Any, Generator
|
|||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page, expect
|
from playwright.sync_api import BrowserContext, Page, expect
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (SHARING_HTPASSWD, SHARING_XREMOTE, Config,
|
||||||
SHARING_HTPASSWD,
|
create_collection, login,
|
||||||
SHARING_XREMOTE,
|
start_radicale_server)
|
||||||
Config,
|
|
||||||
create_collection,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(params=[SHARING_HTPASSWD, SHARING_XREMOTE], ids=lambda c: c.name)
|
@pytest.fixture(params=[SHARING_HTPASSWD, SHARING_XREMOTE], ids=lambda c: c.name)
|
||||||
|
|||||||
@@ -24,12 +24,8 @@ from typing import Any, Generator
|
|||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import Page, expect
|
from playwright.sync_api import Page, expect
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (SHARING_HTPASSWD, create_collection, login,
|
||||||
SHARING_HTPASSWD,
|
start_radicale_server)
|
||||||
create_collection,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@@ -25,14 +25,9 @@ from typing import Any, Generator
|
|||||||
import pytest
|
import pytest
|
||||||
from playwright.sync_api import BrowserContext, Page, expect
|
from playwright.sync_api import BrowserContext, Page, expect
|
||||||
|
|
||||||
from integ_tests.common import (
|
from integ_tests.common import (NOSHARE_HTPASSWD, SHARING_HTPASSWD,
|
||||||
NOSHARE_HTPASSWD,
|
SHARING_XREMOTE, Config, login,
|
||||||
SHARING_HTPASSWD,
|
start_radicale_server)
|
||||||
SHARING_XREMOTE,
|
|
||||||
Config,
|
|
||||||
login,
|
|
||||||
start_radicale_server,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(
|
@pytest.fixture(
|
||||||
|
|||||||
Reference in New Issue
Block a user