chore: reorganize test files into domain-specific subdirectories under tests/
Split the monolithic test directory into three tiers (unit, api, e2e) with a path-mirroring directory structure. Added corresponding Makefile targets (test-unit, test-api, test-e2e) and updated all documentation references (CLAUDE.md, README.md, testing-cicd.html, testing-framework.html, testing-make.html) to reflect the new layout and naming conventions.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
import re
|
||||
from playwright.sync_api import expect
|
||||
from tests.conftest import BASE_URL
|
||||
def _open_composer(page):
|
||||
page.goto(f"{BASE_URL}/feed", wait_until="domcontentloaded")
|
||||
page.locator(".feed-fab").first.wait_for(state="visible", timeout=10000)
|
||||
page.locator(".feed-fab").first.click()
|
||||
def _create_plain_post_engagement_ui(page, content):
|
||||
_open_composer(page)
|
||||
page.fill("#post-content", content)
|
||||
page.locator("#create-post-modal button.btn-primary:has-text('Post')").click()
|
||||
page.wait_for_url(f"{BASE_URL}/posts/*", wait_until="domcontentloaded")
|
||||
|
||||
|
||||
def test_poll_builder_hidden_until_add_poll(alice):
|
||||
page, _ = alice
|
||||
_open_composer(page)
|
||||
expect(page.locator("[data-poll-builder]")).to_be_hidden()
|
||||
page.locator("[data-poll-toggle]").click()
|
||||
expect(page.locator("[data-poll-builder]")).to_be_visible()
|
||||
|
||||
|
||||
def test_reaction_palette_toggle_and_react(alice):
|
||||
page, _ = alice
|
||||
_create_plain_post_engagement_ui(page, "Post to react to in the reaction UI test.")
|
||||
|
||||
expect(page.locator(".reaction-chip:visible")).to_have_count(0)
|
||||
expect(page.locator(".reaction-palette").first).to_be_hidden()
|
||||
|
||||
page.locator(".reaction-add-btn").first.click()
|
||||
expect(page.locator(".reaction-palette").first).to_be_visible()
|
||||
|
||||
page.locator(".reaction-palette-btn").first.click()
|
||||
expect(page.locator(".reaction-chip.reacted").first).to_be_visible()
|
||||
expect(
|
||||
page.locator(".reaction-chip.reacted").first.locator(".reaction-count")
|
||||
).to_have_text("1")
|
||||
Reference in New Issue
Block a user