diff --git a/phpbb-test-board/README.md b/phpbb-test-board/README.md index e57c2b9..b310f95 100644 --- a/phpbb-test-board/README.md +++ b/phpbb-test-board/README.md @@ -148,7 +148,7 @@ Saves PNG screenshots of an extension's or style's pages with [Playwright](https `phpbbmodders/copylinks` clicks a topic title, a post subject and an FAQ question and shows each one's icon turned into a tick, with the copy to the clipboard stubbed, since headless Chromium may not write to it. It also saves the ACP settings. Use `--seed` with seed-forum's standard fixtures for a topic with replies. -`phpbbmodders/seenotes` needs `--seed` with seed-forum's standard fixtures; it then runs seed-forum's `bin/seed-seenotes-fixtures.php` from the same folder, which gives the members reasons, notes and warnings. Reasons show only to staff, so every shot is taken as the admin: a post's mini-profile with the reason, a profile with a reason and one with NONE, the MCP post details notice, MCP → Moderator notes, ACP → Manage users → Moderator notes, and the ACP reasons and settings pages (in full). +`phpbbmodders/seenotes` needs `--seed` with seed-forum's standard fixtures; it then runs seed-forum's `bin/seed-seenotes-fixtures.php` from the same folder, which gives the members reasons, notes and warnings. Reasons show only to staff, so every shot is taken as the admin: a post's mini-profile with the reason, a profile with the reason and the Moderator notes link, a post by a member without a reason with the notes button, the MCP post details notice, MCP → Moderator notes, ACP → Manage users → Moderator notes, and the ACP reasons and settings pages (in full). `phpbbmodders/topicclaim` needs `--seed` with seed-forum's standard fixtures, for its `forum_moderator` user. That user claims the busiest topic with a note, and the admin claims another topic in the same forum. Claims show only to moderators, so every shot is taken as the admin: the forum's topic list, the claim notice on the topic page, the claim page (with take over, transfer and release), MCP → Claimed topics and the ACP settings. diff --git a/phpbb-test-board/feature_checks.py b/phpbb-test-board/feature_checks.py index fcb9401..fbc8b3e 100755 --- a/phpbb-test-board/feature_checks.py +++ b/phpbb-test-board/feature_checks.py @@ -1279,6 +1279,7 @@ def check_seenotes(b: Board) -> None: html = session.get(pages["the topic page"], timeout=20).text + \ session.get(pages["the profile"], timeout=20).text ok(title not in html and "STAFF NOTE" not in html, f"{who} do not see the reason line") + ok("seenotes-mcp-main_module" not in html, f"{who} get no notes button or profile link") # ACP > Manage users shows the same records users = f"{b.base}/adm/index.php?i=users&mode=seenotes&u={member_id}&sid={sid}" @@ -1320,10 +1321,15 @@ def delete_with_name(name: str) -> str: and not b.sql("SELECT 1 FROM phpbb_seenotes_entries WHERE reason_id = ?", (reason_id,)), "typing the name deletes the reason with its entries") - # Without a current reason, staff see NONE linking to the form that gives one - html = admin.get(pages["the profile"], timeout=20).text - ok(re.search(r']*>NONE' % member_id, html), - "a member without a current reason shows NONE, linking to the Give a reason form") + # Without a current reason nothing shows, but staff keep the notes button and profile link, + # which open the Give a reason form; members and guests get neither + topic = admin.get(pages["the topic page"], timeout=20).text + profile = admin.get(pages["the profile"], timeout=20).text + ok("STAFF NOTE" not in profile, "a member without a current reason shows no reason line") + to_form = r'href="[^"]*mode=notes&u=%s[^"]*#seenotes-add-entry"' % member_id + ok(re.search(r']*class="button button-icon-only"' % to_form, topic), + "the notes button next to the member's post opens the Give a reason form") + ok(re.search(r'
' % to_form, profile), "the profile's Moderator notes link opens the Give a reason form") CHECKS = { diff --git a/phpbb-test-board/screenshots.py b/phpbb-test-board/screenshots.py index 0cfa5e0..00ef1d8 100755 --- a/phpbb-test-board/screenshots.py +++ b/phpbb-test-board/screenshots.py @@ -1271,8 +1271,9 @@ def public_directory(p) -> None: def shots_seenotes(board: Board, shoot: Shooter, args: argparse.Namespace) -> None: - """phpbbmodders/seenotes: the reason line next to a post and on a profile, NONE for a member - without a current reason, the MCP post notice, MCP → Moderator notes, and the ACP pages. + """phpbbmodders/seenotes: the reason line next to a post and on a profile, the notes button + next to a post by a member without a reason, the MCP post notice, MCP → Moderator notes, and + the ACP pages. Needs seed-forum's fixtures: run with --seed and seed-forum's bin/seed-standard-fixtures.php; seed-forum's bin/seed-seenotes-fixtures.php, @@ -1297,8 +1298,11 @@ def shots_seenotes(board: Board, shoot: Shooter, args: argparse.Namespace) -> No shoot.shot("seenotes-viewtopic", f"viewtopic.php?t={topic}&sid={{sid}}", admin=True, selector=f"#p{post}") shoot.shot("seenotes-profile", f"memberlist.php?mode=viewprofile&u={alex}&sid={{sid}}", admin=True, selector="form#viewprofile") - shoot.shot("seenotes-profile-none", f"memberlist.php?mode=viewprofile&u={drew}&sid={{sid}}", admin=True, - selector="form#viewprofile") + drew_post = board.sql("SELECT post_id FROM phpbb_posts WHERE poster_id = ? ORDER BY post_time DESC LIMIT 1", + (drew,))[0][0] + drew_topic = board.sql("SELECT topic_id FROM phpbb_posts WHERE post_id = ?", (drew_post,))[0][0] + shoot.shot("seenotes-post-button", f"viewtopic.php?t={drew_topic}&sid={{sid}}", admin=True, + selector=f"#p{drew_post}") shoot.shot("seenotes-mcp-notes", mcp.format(user=alex), admin=True, selector="#page-body") shoot.shot("seenotes-mcp-post", f"mcp.php?i=main&mode=post_details&p={post}&sid={{sid}}", admin=True, selector="#page-body")