feat: enforce hard test-tier requirement across all DevPlace workflow agents and feature-builder docs
DevPlace CI / test (push) Failing after 21m53s
DevPlace CI / test (push) Failing after 21m53s
Update the feature-builder agent prompt, test-maintainer agent, and all four workflow JS files (devii-tool, endpoint, feature, job-service) to codify the DevPlace test standard as a non-optional project requirement: one test file per endpoint, directory tree mirroring the URL/source path, split into three tiers (unit, api, e2e). Add explicit Test phases to devii-tool, endpoint, feature, and job-service workflows, and embed tier-specific test instructions (path mapping, fixture choice, coverage scope) directly in each workflow's meta description and TESTS constant.
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
from playwright.sync_api import expect
|
||||
from tests.e2e.post import create_post
|
||||
|
||||
|
||||
def _post_comment(page, body):
|
||||
textarea = page.locator(".comment-form textarea[name='content']")
|
||||
textarea.fill(body)
|
||||
page.locator(".comment-form button:has-text('Post')").click()
|
||||
comment = page.locator(f".comment-text:has-text('{body}')")
|
||||
expect(comment).to_be_visible()
|
||||
return comment
|
||||
|
||||
|
||||
def _delete_comment(page, body):
|
||||
wrapper = page.locator(f".comment:has(.comment-text:has-text('{body}'))").last
|
||||
wrapper.locator(".comment-action-btn:has-text('Delete')").click()
|
||||
page.locator(".dialog-overlay.visible .dialog-confirm").click()
|
||||
|
||||
|
||||
def test_delete_comment_removes_it(alice):
|
||||
page, _ = alice
|
||||
create_post(page, "fun", "Post for delete scroll removal")
|
||||
comment = _post_comment(page, "Comment that will be deleted")
|
||||
_delete_comment(page, "Comment that will be deleted")
|
||||
expect(comment).to_have_count(0)
|
||||
|
||||
|
||||
def test_delete_comment_scrolls_to_previous_comment(alice):
|
||||
page, _ = alice
|
||||
create_post(page, "devlog", "Post for delete scroll anchor")
|
||||
for index in range(6):
|
||||
_post_comment(page, f"Scroll anchor comment {index}")
|
||||
|
||||
target = "Scroll anchor comment 5"
|
||||
previous = "Scroll anchor comment 4"
|
||||
previous_wrapper = page.locator(
|
||||
f".comment:has(.comment-text:has-text('{previous}'))"
|
||||
).last
|
||||
anchor_top = previous_wrapper.evaluate(
|
||||
"el => el.getBoundingClientRect().top + window.scrollY"
|
||||
)
|
||||
|
||||
page.evaluate("window.scrollTo(0, document.body.scrollHeight)")
|
||||
_delete_comment(page, target)
|
||||
expect(page.locator(f".comment-text:has-text('{target}')")).to_have_count(0)
|
||||
|
||||
page.wait_for_function(
|
||||
"expected => Math.abs(window.scrollY - expected) < 120",
|
||||
arg=anchor_top,
|
||||
)
|
||||
expect(previous_wrapper).to_be_visible()
|
||||
|
||||
|
||||
def test_delete_only_comment_scrolls_without_error(alice):
|
||||
page, _ = alice
|
||||
create_post(page, "random", "Post for delete only comment")
|
||||
_post_comment(page, "Sole comment to delete")
|
||||
page.evaluate("window.scrollTo(0, document.body.scrollHeight)")
|
||||
_delete_comment(page, "Sole comment to delete")
|
||||
expect(page.locator(".comment-text:has-text('Sole comment to delete')")).to_have_count(0)
|
||||
assert page.evaluate("window.scrollY") >= 0
|
||||
Reference in New Issue
Block a user