From 9a0f961d08e92ce7417e3a780ea53a66b90eab4d Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Mon, 19 Oct 2026 18:18:09 -0500 Subject: [PATCH 1/2] Add Copy Links screenshots Co-Authored-By: Claude Opus 5.5 --- phpbb-test-board/README.md | 2 ++ phpbb-test-board/screenshots.py | 42 +++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/phpbb-test-board/README.md b/phpbb-test-board/README.md index f2c623c..423c2fc 100644 --- a/phpbb-test-board/README.md +++ b/phpbb-test-board/README.md @@ -113,6 +113,8 @@ Saves PNG screenshots of an extension's or style's pages with [Playwright](https `phpbbmodders/newspage` replaces the board's welcome topic with four example news topics, the last one opening with a picture the script draws (and deletes afterwards), and makes that forum the news forum. It saves the news page with the first image above the text and without poster information or post buttons, one news item as the admin, the ACP settings (in full), the news page on a phone and filtered by forum, then the news page with poster information and post buttons on, shortened to 120 characters, and without the filters. +`phpbbmodders/copylinks` clicks a topic title, a post subject and an FAQ question and shows each one's tick, with the copy to the clipboard stubbed, since headless Chromium may not write to it. Use `--seed` with seed-forum's standard fixtures for a topic with replies. + For example, ProMinoDeux's screenshots: ```bash diff --git a/phpbb-test-board/screenshots.py b/phpbb-test-board/screenshots.py index fedc399..b4b7100 100755 --- a/phpbb-test-board/screenshots.py +++ b/phpbb-test-board/screenshots.py @@ -943,8 +943,50 @@ def shots_newspage(board: Board, shoot: Shooter, args: argparse.Namespace) -> No shoot.shot("newspage-news-no-filters", "app.php/news") +def show_copied(selector: str) -> Callable: + """A prepare() step for phpbbmodders/copylinks: click SELECTOR and wait for its tick. + + Headless Chromium has no clipboard permission, so the copy is stubbed to + succeed. The tick stays for two seconds; the shot is taken inside that. + """ + def prepare(p) -> None: + p.evaluate("Object.defineProperty(navigator, 'clipboard', " + "{value: {writeText: () => Promise.resolve()}, configurable: true})") + p.locator(selector).first.click() + # No hover or focus underline on the heading + p.mouse.move(0, 0) + p.evaluate("document.activeElement.blur()") + p.wait_for_selector(".copylinks-copied") + p.wait_for_timeout(400) # the tick fades in over 0.2s + return prepare + + +def shots_copylinks(board: Board, shoot: Shooter, args: argparse.Namespace) -> None: + """phpbbmodders/copylinks: the tick after copying a topic title, a post subject and an FAQ question. + + Use --seed with seed-forum's bin/seed-standard-fixtures.php for a topic + with replies. The post shot is the topic's second post, so its subject + differs from the title. + """ + forum, topic = busiest_forum_and_topic(board) + post = board.sql("SELECT post_id FROM phpbb_posts WHERE topic_id = ? " + "ORDER BY post_time, post_id LIMIT 1 OFFSET 1", (topic,))[0][0] + shoot.shot("copylinks-topic", f"viewtopic.php?t={topic}", prepare=show_copied("h2.topic-title > a")) + shoot.shot("copylinks-post", f"viewtopic.php?t={topic}", selector=f"#p{post}", + prepare=show_copied(f"#p{post} h3 > a")) + copy_question = show_copied("dl.faq > dt > a") + + def first_question_only(p) -> None: + # Crop to the question's section, keeping only that first question + copy_question(p) + p.add_style_tag(content=".panel:has(.copylinks-copied) dl.faq ~ * { display: none; }") + shoot.shot("copylinks-faq", "app.php/help/faq", selector=".panel:has(.copylinks-copied)", + prepare=first_question_only) + + SHOTS = { "phpbbmodders/contactadmin": shots_contactadmin, + "phpbbmodders/copylinks": shots_copylinks, "phpbbmodders/documentation": shots_documentation, "phpbbmodders/knowledgebase": shots_knowledgebase, "phpbbmodders/newspage": shots_newspage, From 3736c7b2a0da3f6fada3a0e303302d35d7e41290 Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Mon, 19 Oct 2026 18:25:07 -0500 Subject: [PATCH 2/2] Show the Copy Links icon and ACP settings Co-Authored-By: Claude Opus 5.5 --- phpbb-test-board/README.md | 2 +- phpbb-test-board/screenshots.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/phpbb-test-board/README.md b/phpbb-test-board/README.md index 423c2fc..bd33c71 100644 --- a/phpbb-test-board/README.md +++ b/phpbb-test-board/README.md @@ -113,7 +113,7 @@ Saves PNG screenshots of an extension's or style's pages with [Playwright](https `phpbbmodders/newspage` replaces the board's welcome topic with four example news topics, the last one opening with a picture the script draws (and deletes afterwards), and makes that forum the news forum. It saves the news page with the first image above the text and without poster information or post buttons, one news item as the admin, the ACP settings (in full), the news page on a phone and filtered by forum, then the news page with poster information and post buttons on, shortened to 120 characters, and without the filters. -`phpbbmodders/copylinks` clicks a topic title, a post subject and an FAQ question and shows each one's tick, with the copy to the clipboard stubbed, since headless Chromium may not write to it. Use `--seed` with seed-forum's standard fixtures for a topic with replies. +`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. For example, ProMinoDeux's screenshots: diff --git a/phpbb-test-board/screenshots.py b/phpbb-test-board/screenshots.py index b4b7100..b4322e5 100755 --- a/phpbb-test-board/screenshots.py +++ b/phpbb-test-board/screenshots.py @@ -947,7 +947,8 @@ def show_copied(selector: str) -> Callable: """A prepare() step for phpbbmodders/copylinks: click SELECTOR and wait for its tick. Headless Chromium has no clipboard permission, so the copy is stubbed to - succeed. The tick stays for two seconds; the shot is taken inside that. + succeed. The heading's icon turns into a tick for two seconds; the shot is + taken inside that. """ def prepare(p) -> None: p.evaluate("Object.defineProperty(navigator, 'clipboard', " @@ -957,14 +958,16 @@ def prepare(p) -> None: p.mouse.move(0, 0) p.evaluate("document.activeElement.blur()") p.wait_for_selector(".copylinks-copied") - p.wait_for_timeout(400) # the tick fades in over 0.2s + p.wait_for_timeout(400) # without the icon, the text tick fades in over 0.2s return prepare def shots_copylinks(board: Board, shoot: Shooter, args: argparse.Namespace) -> None: - """phpbbmodders/copylinks: the tick after copying a topic title, a post subject and an FAQ question. + """phpbbmodders/copylinks: the tick after copying a topic title, a post subject and an FAQ question, + and the ACP settings. - Use --seed with seed-forum's bin/seed-standard-fixtures.php for a topic + The headings show the extension's default icon, which turns into a tick + after a copy. Use --seed with seed-forum's bin/seed-standard-fixtures.php for a topic with replies. The post shot is the topic's second post, so its subject differs from the title. """ @@ -982,6 +985,8 @@ def first_question_only(p) -> None: p.add_style_tag(content=".panel:has(.copylinks-copied) dl.faq ~ * { display: none; }") shoot.shot("copylinks-faq", "app.php/help/faq", selector=".panel:has(.copylinks-copied)", prepare=first_question_only) + shoot.shot("copylinks-acp-settings", "adm/index.php?i=-phpbbmodders-copylinks-acp-main_module&mode=settings&sid={sid}", + admin=True) SHOTS = {