From f794a5ae83fdfb1bc04690a482657f6101304d05 Mon Sep 17 00:00:00 2001 From: Doar Mihai Date: Sat, 18 Jul 2026 18:40:54 +0300 Subject: [PATCH] docs: annotate verified vs unverified selectors, drop redundant clicks Addresses reviewer's minor findings on the prior fix commit: makes the screenshot-verified/unverified boundary explicit in code comments so it travels with the file rather than living only in commit messages, and removes redundant .click() calls before .fill() (fill() already focuses). Co-Authored-By: Claude Sonnet 5 --- sidecars/reddit-post/tests/reddit-post.spec.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sidecars/reddit-post/tests/reddit-post.spec.js b/sidecars/reddit-post/tests/reddit-post.spec.js index 5a396db..8a29d81 100644 --- a/sidecars/reddit-post/tests/reddit-post.spec.js +++ b/sidecars/reddit-post/tests/reddit-post.spec.js @@ -52,17 +52,21 @@ test.describe('reddit post', () => { throw new Error(outcome.error); } + // Screenshot-verified against the live Reddit login page: cookie + // dialog button text and the "Log In" submit button's accessible + // name are both confirmed correct. const rejectCookies = page.getByRole('button', { name: 'Reject Optional Cookies' }); if (await rejectCookies.isVisible({ timeout: 5_000 }).catch(() => false)) { await rejectCookies.click(); } + // Not individually screenshot-verified (only confirmed to resolve + // as far as the network block allowed) — watch these first if + // login fails on a real, unblocked network. const usernameField = page.getByLabel(/email or username/i); - await usernameField.click(); await usernameField.fill(/** @type {string} */ (username)); const passwordField = page.getByLabel(/^password/i); - await passwordField.click(); await passwordField.fill(/** @type {string} */ (password)); await page.getByRole('button', { name: 'Log In' }).click(); @@ -82,6 +86,12 @@ test.describe('reddit post', () => { throw new Error(outcome.error); } + // UNVERIFIED: a network block in the dev sandbox prevented ever + // reaching this point in a live run, so none of the selectors below + // (text-type tab, title field, body field, submit button) have been + // confirmed against the real submit page. If posting fails here on + // a real, unblocked network, inspect the live page first — e.g. via + // `npx playwright codegen https://www.reddit.com/r/test/submit`. await page.goto(`https://www.reddit.com/r/${subreddit}/submit`); const textTab = page.getByRole('button', { name: /^Text$/i }).first();