From 8b8444dacc933e52f5c356400a8313e1e7e8d877 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 23 Feb 2023 13:22:22 +0100 Subject: [PATCH] test: page.reload() on a page with a hash (#21152) https://github.com/microsoft/playwright/issues/21145 --- tests/page/page-history.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/page/page-history.spec.ts b/tests/page/page-history.spec.ts index 58a8bcb48f..2403b38949 100644 --- a/tests/page/page-history.spec.ts +++ b/tests/page/page-history.spec.ts @@ -185,6 +185,14 @@ it('page.reload should work with cross-origin redirect', async ({ page, server, await expect(page).toHaveURL(server.CROSS_PROCESS_PREFIX + '/title.html'); }); +it('page.reload should work on a page with a hash', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21145' }); + it.fixme(browserName === 'firefox'); + await page.goto(server.EMPTY_PAGE + '#hash'); + await page.reload(); + await expect(page).toHaveURL(server.EMPTY_PAGE + '#hash'); +}); + it('page.goBack during renderer-initiated navigation', async ({ page, server }) => { await page.goto(server.PREFIX + '/one-style.html'); await page.goto(server.EMPTY_PAGE);