Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions phpbb-test-board/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ Saves PNG screenshots of an extension's or style's pages with [Playwright](https

`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.

`phpbbmodders/printallposts` sets the board to two posts per page, so the busiest topic spans two pages, then saves the **Topic tools** menu open on it and the **Print all** page showing every post, both as a guest. Use `--seed` with seed-forum's standard fixtures.

`phpbbmodders/posteripinviewtopic` gives the busiest topic's posts the IP address 8.8.8.8 (seeded posts come from 127.0.0.1, which the extension hides) and saves, as the admin, the address in a post's profile column and its lookup popup. The lookup is real: the board asks ip-api.com, so the run needs internet access. Use `--seed` with seed-forum's standard fixtures.

For example, ProMinoDeux's screenshots:

```bash
Expand Down
51 changes: 51 additions & 0 deletions phpbb-test-board/screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,13 +1058,64 @@ def first_post_only(p) -> None:
admin=True)


def shots_printallposts(board: Board, shoot: Shooter, args: argparse.Namespace) -> None:
"""phpbbmodders/printallposts: the Print all link in the Topic tools menu and the page it opens.

Use --seed with seed-forum's bin/seed-standard-fixtures.php for a topic
with replies. Shown as a guest, who has the Can print topic permission in
the seeded forums, so no moderator tools appear. Two posts per page split
the topic over pages, so the print page shows it gathering every post.
"""
_, topic = busiest_forum_and_topic(board)
set_config(board, {"posts_per_page": "2"})

def open_topic_tools(p) -> None:
# Crop to the title, the menu and the first post
p.add_style_tag(content="#page-body > .post ~ *:not(.action-bar.bar-top) { display: none; }")
p.click(".action-bar.bar-top .topic-tools .dropdown-trigger")
p.wait_for_selector(".action-bar.bar-top .topic-tools .dropdown:visible")
shoot.shot("printallposts-topic-tools", f"viewtopic.php?t={topic}", selector="#page-body",
prepare=open_topic_tools)
shoot.shot("printallposts-print", f"viewtopic.php?t={topic}&view=printall", selector="#wrap")


# Seeded posts come from 127.0.0.1, which the extension hides; this public DNS
# server's address is shown instead.
POSTERIP_EXAMPLE_IP = "8.8.8.8"


def shots_posteripinviewtopic(board: Board, shoot: Shooter, args: argparse.Namespace) -> None:
"""phpbbmodders/posteripinviewtopic: the IP address in a post's profile column and its lookup popup.

Use --seed with seed-forum's bin/seed-standard-fixtures.php for a topic
with replies. The busiest topic's posts get POSTER_IP_EXAMPLE_IP. The IP
is shown only to moderators, so both shots are taken as the admin. The
popup is a real lookup: the board asks ip-api.com, so the run needs
internet access.
"""
_, topic = busiest_forum_and_topic(board)
board.sql("UPDATE phpbb_posts SET poster_ip = ? WHERE topic_id = ?", (POSTERIP_EXAMPLE_IP, topic))
post = board.sql("SELECT post_id FROM phpbb_posts WHERE topic_id = ? ORDER BY post_time, post_id LIMIT 1",
(topic,))[0][0]

def look_up(p) -> None:
p.click(f"#p{post} a.posterip")
p.wait_for_selector("#phpbb_alert:visible")
p.wait_for_timeout(400) # the popup fades in
shoot.shot("posteripinviewtopic-viewtopic", f"viewtopic.php?t={topic}&sid={{sid}}", admin=True,
selector=f"#p{post}")
shoot.shot("posteripinviewtopic-lookup", f"viewtopic.php?t={topic}&sid={{sid}}", admin=True, prepare=look_up)


SHOTS = {
"phpbbmodders/contactadmin": shots_contactadmin,
"phpbbmodders/copylinks": shots_copylinks,
"phpbbmodders/documentation": shots_documentation,
"phpbbmodders/feedlinks": shots_feedlinks,
"phpbbmodders/knowledgebase": shots_knowledgebase,
"phpbbmodders/newspage": shots_newspage,
"phpbbmodders/posteripinviewtopic": shots_posteripinviewtopic,
"phpbbmodders/printallposts": shots_printallposts,
"phpbbmodders/sfscompanion": shots_sfscompanion,
"phpbbmodders/stopforumspam": shots_stopforumspam,
"phpbbmodders/topicclaim": shots_topicclaim,
Expand Down
Loading