Files
devplacepy/tests/e2e/profile/mute.py
T
retoor 8a48e3ef85 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

60 lines
1.6 KiB
Python

# retoor <retoor@molodetz.nl>
from playwright.sync_api import expect
from tests.conftest import BASE_URL, open_action_menu
MUTE = "form[action='/mute/bob_test'] button"
UNMUTE = "form[action='/mute/unmute/bob_test'] button"
def _confirm(page):
page.locator(".dialog-overlay.visible .dialog-confirm").click()
def _has(page, selector):
loc = page.locator(selector)
if loc.count() == 0:
return False
return open_action_menu(loc).is_visible()
def _pick(page, selector):
open_action_menu(page.locator(selector)).click()
def _reset_mute(page):
page.goto(f"{BASE_URL}/profile/bob_test", wait_until="domcontentloaded")
if _has(page, UNMUTE):
_pick(page, UNMUTE)
_confirm(page)
page.wait_for_url("**/profile/bob_test", wait_until="domcontentloaded")
def test_mute_and_unmute_buttons_toggle(alice):
page, _ = alice
_reset_mute(page)
assert _has(page, MUTE)
_pick(page, MUTE)
_confirm(page)
page.wait_for_url("**/profile/bob_test", wait_until="domcontentloaded")
assert _has(page, UNMUTE)
_pick(page, UNMUTE)
_confirm(page)
page.wait_for_url("**/profile/bob_test", wait_until="domcontentloaded")
assert _has(page, MUTE)
def test_mute_button_opens_confirmation_dialog(alice):
page, _ = alice
_reset_mute(page)
_pick(page, MUTE)
expect(page.locator(".dialog-overlay.visible")).to_be_visible()
expect(page.locator(".dialog-overlay.visible .dialog-message")).to_contain_text(
"Mute"
)
page.locator(".dialog-overlay.visible .dialog-cancel").click()
expect(page.locator(".dialog-overlay")).not_to_be_visible()
assert _has(page, MUTE)