From 52eca0550d0207ba27743431dff1b8d7e731d521 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 18 Aug 2022 17:35:02 -0700 Subject: [PATCH] test: page.reload() works with cross-origin redirect (#16655) --- tests/page/page-history.spec.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/page/page-history.spec.ts b/tests/page/page-history.spec.ts index 85c8ecb781..a244989839 100644 --- a/tests/page/page-history.spec.ts +++ b/tests/page/page-history.spec.ts @@ -146,6 +146,23 @@ it('page.reload should not resolve with same-document navigation', async ({ page expect(await gotResponse.text()).toBe('hello'); }); +it('page.reload should work with same origin redirect', async ({ page, server }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16147' }); + await page.goto(server.EMPTY_PAGE); + server.setRedirect('/empty.html', server.PREFIX + '/title.html'); + await page.reload(); + await expect(page).toHaveURL(server.PREFIX + '/title.html'); +}); + +it('page.reload should work with cross-origin redirect', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16147' }); + it.fixme(browserName === 'webkit'); + await page.goto(server.EMPTY_PAGE); + server.setRedirect('/empty.html', server.CROSS_PROCESS_PREFIX + '/title.html'); + await page.reload(); + await expect(page).toHaveURL(server.CROSS_PROCESS_PREFIX + '/title.html'); +}); + it('page.goBack during renderer-initiated navigation', async ({ page, server }) => { await page.goto(server.PREFIX + '/one-style.html'); await page.goto(server.EMPTY_PAGE);