parent
58a23bc7a0
commit
870edd1aae
|
|
@ -21,13 +21,13 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "firefox",
|
"name": "firefox",
|
||||||
"revision": "1384",
|
"revision": "1387",
|
||||||
"installByDefault": true,
|
"installByDefault": true,
|
||||||
"browserVersion": "109.0"
|
"browserVersion": "109.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "firefox-beta",
|
"name": "firefox-beta",
|
||||||
"revision": "1386",
|
"revision": "1389",
|
||||||
"installByDefault": false,
|
"installByDefault": false,
|
||||||
"browserVersion": "110.0b7"
|
"browserVersion": "110.0b7"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -393,20 +393,7 @@ export class FFPage implements PageDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
async reload(): Promise<void> {
|
async reload(): Promise<void> {
|
||||||
const mainFrame = this._page._frameManager.mainFrame();
|
await this._session.send('Page.reload');
|
||||||
// This is a workaround for https://github.com/microsoft/playwright/issues/21145
|
|
||||||
let hash = '';
|
|
||||||
try {
|
|
||||||
hash = (new URL(mainFrame.url())).hash;
|
|
||||||
} catch (e) {
|
|
||||||
// Ignore URL parsing error, if any.
|
|
||||||
}
|
|
||||||
if (hash.length) {
|
|
||||||
const context = await mainFrame._utilityContext();
|
|
||||||
await context.rawEvaluateJSON(`void window.location.reload();`);
|
|
||||||
} else {
|
|
||||||
await this._session.send('Page.reload');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async goBack(): Promise<boolean> {
|
async goBack(): Promise<boolean> {
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ it('should navigate subframes @smoke', async ({ page, server }) => {
|
||||||
it('should reject when frame detaches', async ({ page, server, browserName }) => {
|
it('should reject when frame detaches', async ({ page, server, browserName }) => {
|
||||||
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
||||||
|
|
||||||
server.setRoute('/empty.html', () => {});
|
server.setRoute('/one-style.css', () => {});
|
||||||
const navigationPromise = page.frames()[1].goto(server.EMPTY_PAGE).catch(e => e);
|
const navigationPromise = page.frames()[1].goto(server.PREFIX + '/one-style.html').catch(e => e);
|
||||||
await server.waitForRequest('/empty.html');
|
await server.waitForRequest('/one-style.css');
|
||||||
|
|
||||||
await page.$eval('iframe', frame => frame.remove());
|
await page.$eval('iframe', frame => frame.remove());
|
||||||
const error = await navigationPromise;
|
const error = await navigationPromise;
|
||||||
|
|
|
||||||
|
|
@ -703,9 +703,8 @@ it('should work with overridden globalThis.Window/Document/Node', async ({ page,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work with overridden URL/Date/RegExp', async ({ page, server, browserName }) => {
|
it('should work with overridden URL/Date/RegExp', async ({ page, server }) => {
|
||||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21109' });
|
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21109' });
|
||||||
it.fixme(browserName === 'firefox');
|
|
||||||
const testCases = [
|
const testCases = [
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
() => globalThis.URL = 'foo',
|
() => globalThis.URL = 'foo',
|
||||||
|
|
|
||||||
|
|
@ -192,9 +192,8 @@ it('page.reload should work on a page with a hash', async ({ page, server }) =>
|
||||||
await expect(page).toHaveURL(server.EMPTY_PAGE + '#hash');
|
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('page.reload should work on a page with a hash at the end', async ({ page, server }) => {
|
||||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21430' });
|
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.goto(server.EMPTY_PAGE + '#');
|
||||||
await page.reload();
|
await page.reload();
|
||||||
await expect(page).toHaveURL(server.EMPTY_PAGE + '#');
|
await expect(page).toHaveURL(server.EMPTY_PAGE + '#');
|
||||||
|
|
|
||||||
|
|
@ -250,11 +250,12 @@ it('should fail when frame detaches', async ({ page, server }) => {
|
||||||
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
||||||
const frame = page.frames()[1];
|
const frame = page.frames()[1];
|
||||||
server.setRoute('/empty.html', () => {});
|
server.setRoute('/empty.html', () => {});
|
||||||
|
server.setRoute('/one-style.css', () => {});
|
||||||
const [error] = await Promise.all([
|
const [error] = await Promise.all([
|
||||||
frame.waitForNavigation().catch(e => e),
|
frame.waitForNavigation().catch(e => e),
|
||||||
page.$eval('iframe', frame => { frame.contentWindow.location.href = '/empty.html'; }),
|
page.$eval('iframe', frame => { frame.contentWindow.location.href = '/one-style.html'; }),
|
||||||
// Make sure policy checks pass and navigation actually begins before removing the frame to avoid other errors
|
// Make sure policy checks pass and navigation actually begins before removing the frame to avoid other errors
|
||||||
server.waitForRequest('/empty.html').then(() => page.$eval('iframe', frame => setTimeout(() => frame.remove(), 0)))
|
server.waitForRequest('/one-style.css').then(() => page.$eval('iframe', frame => setTimeout(() => frame.remove(), 0)))
|
||||||
]);
|
]);
|
||||||
expect(error.message).toContain('waiting for navigation until "load"');
|
expect(error.message).toContain('waiting for navigation until "load"');
|
||||||
expect(error.message).toContain('frame was detached');
|
expect(error.message).toContain('frame was detached');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue