Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: add test for page.goto with hash at the end (#21437)

Max Schmitt41dc45d47121
diff --git a/tests/page/page-history.spec.ts b/tests/page/page-history.spec.ts
index 30259286dc..a0ae7bb98f 100644
--- a/tests/page/page-history.spec.ts
+++ b/tests/page/page-history.spec.ts
@@ -192,6 +192,14 @@ it('page.reload should work on a page with a hash', async ({ page, server }) =>
await expect(page).toHaveURL(server.EMPTY_PAGE + '#hash');
});
+it('page.reload should work on a page with a hash at the end', async ({ page, server, browserName }) => {
+ it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21430' });
+ it.fixme(browserName === 'firefox');
+ await page.goto(server.EMPTY_PAGE + '#');
+ await page.reload();
+ await expect(page).toHaveURL(server.EMPTY_PAGE + '#');
+});
+
it('page.goBack during renderer-initiated navigation', async ({ page, server }) => {
await page.goto(server.PREFIX + '/one-style.html');
await page.goto(server.EMPTY_PAGE);