From c2262cd9901536a5d26d30f51d03666718fbe94f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 16:09:45 +0000 Subject: [PATCH 1/2] Initial plan From 676bba0db81b3875b2e026d4810ffb7ad15da05e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 16:17:53 +0000 Subject: [PATCH 2/2] Fix flaky mobile-safari e2e test: assert searchbox value after fill before click MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `await expect(page.getByRole('searchbox')).toHaveValue('awful')` after each `fill('awful')` call in tests 06–14 of the "search flow with mock API" group. This ensures React has processed the input state update before the Search button is clicked, preventing a WebKit race condition where the form submit handler would exit early with an empty query value. Co-authored-by: evcatalyst <8740078+evcatalyst@users.noreply.github.com> Agent-Logs-Url: https://github.com/gitbrainlab/BackWords/sessions/7129578c-26bb-4fab-b875-4b5ddc2e03e6 --- pwa/e2e/journey.spec.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pwa/e2e/journey.spec.ts b/pwa/e2e/journey.spec.ts index aa132d0..f4ee10e 100644 --- a/pwa/e2e/journey.spec.ts +++ b/pwa/e2e/journey.spec.ts @@ -128,6 +128,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('06 – Search "awful" navigates to result page', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await shot(page, '06-before-search-submit') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) @@ -137,6 +138,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('07 – Result page shows word title', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) await expect(page.getByRole('heading', { name: 'awful' })).toBeVisible() @@ -146,6 +148,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('08 – Result page shows summary banner', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) await expect(page.getByTestId('summary-banner')).toBeVisible() @@ -155,6 +158,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('09 – Result page shows Then/Now snapshots', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) await expect(page.getByTestId('snapshot-now')).toBeVisible() @@ -165,6 +169,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('10 – Navigate to Timeline from Result', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) await page.getByTestId('view-timeline-btn').click() @@ -176,6 +181,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('11 – Timeline scrubber shows eras', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) await page.getByTestId('view-timeline-btn').click() @@ -187,6 +193,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('12 – Navigate to Source Detail from Result', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) await page.getByTestId('source-card').first().getByText('Details →').click() @@ -198,6 +205,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('13 – "Ask BackWords" explain button appears', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) await page.getByTestId('source-card').first().getByText('Details →').click() @@ -209,6 +217,7 @@ test.describe('BackWords PWA — search flow with mock API', () => { test('14 – Back navigation returns to result', async ({ page }) => { await page.goto(`${BASE}/`) await page.getByRole('searchbox').fill('awful') + await expect(page.getByRole('searchbox')).toHaveValue('awful') await page.getByRole('button', { name: 'Search' }).click() await page.waitForURL(`**${BASE}/result`, { waitUntil: 'commit' }) await page.getByRole('button', { name: 'Back to search' }).click()