Files
devplacepy/tests/e2e/ui/components.py
T
retoor 8a48e3ef85
DevPlace CI / test (push) Failing after 3h10m39s
Keep composers usable, group actions and notifications, and drop the tool-count cap
Comment and post layouts stay full width on small screens. Secondary actions live in the More menu. Notifications can be grouped and throttled, and Enter can submit when that profile setting is on. Emulated-tool models accept large catalogs, with reserved names aliased on the wire and the catalog cached per owner. A dropped service-worker navigation is retried once. The test server waits 120s to finish importing before it is stopped.
2026-11-12 15:29:27 +01:00

78 lines
2.3 KiB
Python

# retoor <retoor@molodetz.nl>
from playwright.sync_api import expect
from tests.conftest import BASE_URL, open_action_menu
from tests.e2e.project.files import _make_project_ui
def _open_project_with_delete(page, title):
proj_url = _make_project_ui(page, title)
slug = proj_url.rstrip("/").split("/")[-1]
return proj_url, slug
TRIGGER = "[data-action-menu-trigger]"
PANEL = "[data-action-menu-panel]"
def _open_menu(page):
panel = page.locator("#project-actions-panel")
if panel.count():
open_action_menu(panel)
return
trigger = page.locator(TRIGGER).first
if trigger.count():
trigger.click()
def _menu_item(page, label):
return page.locator(
f"{PANEL} [data-menu-action]:has-text('{label}'), "
f"{PANEL} [data-menu-action][data-menu-label='{label}']"
)
def _pick(page, label):
item = _menu_item(page, label).first
open_action_menu(item)
item.click()
def _click_delete(page):
_pick(page, "Delete")
def test_data_confirm_opens_custom_dialog(alice):
page, _ = alice
_open_project_with_delete(page, "Confirm Dialog Open")
_click_delete(page)
expect(page.locator(".dialog-overlay.visible")).to_be_visible()
expect(page.locator(".dialog-overlay.visible .dialog-message")).to_contain_text(
"Delete"
)
def test_data_confirm_cancel_aborts(alice):
page, _ = alice
proj_url, _ = _open_project_with_delete(page, "Confirm Cancel")
_click_delete(page)
page.locator(".dialog-overlay.visible .dialog-cancel").click()
expect(page.locator(".dialog-overlay")).not_to_be_visible()
resp = page.goto(proj_url, wait_until="domcontentloaded")
assert resp.status == 200
def test_dialog_escape_cancels(alice):
page, _ = alice
_open_project_with_delete(page, "Confirm Escape")
_click_delete(page)
expect(page.locator(".dialog-overlay.visible")).to_be_visible()
page.keyboard.press("Escape")
expect(page.locator(".dialog-overlay")).not_to_be_visible()
def test_dialog_backdrop_click_cancels(alice):
page, _ = alice
_open_project_with_delete(page, "Confirm Backdrop")
_click_delete(page)
overlay = page.locator(".dialog-overlay.visible")
expect(overlay).to_be_visible()
overlay.click(position={"x": 5, "y": 5})
expect(page.locator(".dialog-overlay")).not_to_be_visible()