mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-11 20:37:54 +03:00
fix(trace-viewer): fix snapshot.html (#31033)
Actual path to get trace contexts is /contexts, not /context
This commit is contained in:
parent
e047c478a4
commit
f254290ab4
@ -26,7 +26,7 @@
|
||||
const traceUrl = new URL(location.href).searchParams.get('trace');
|
||||
const params = new URLSearchParams();
|
||||
params.set('trace', traceUrl);
|
||||
await fetch('context?' + params.toString()).then(r => r.json());
|
||||
await fetch('contexts?' + params.toString()).then(r => r.json());
|
||||
await location.reload();
|
||||
})();
|
||||
</script>
|
||||
|
@ -1207,3 +1207,20 @@ test('should remove noscript when javaScriptEnabled is set to true', async ({ br
|
||||
await expect(frame.getByText('Always visible')).toBeVisible();
|
||||
await expect(frame.getByText('Enable JavaScript to run this app.')).toBeHidden();
|
||||
});
|
||||
|
||||
test('should open snapshot in new browser context', async ({ browser, page, runAndTrace, server }) => {
|
||||
const traceViewer = await runAndTrace(async () => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.setContent('hello');
|
||||
});
|
||||
await traceViewer.snapshotFrame('page.setContent');
|
||||
const popupPromise = traceViewer.page.context().waitForEvent('page');
|
||||
await traceViewer.page.getByTitle('Open snapshot in a new tab').click();
|
||||
const popup = await popupPromise;
|
||||
|
||||
// doesn't share sw.bundle.js
|
||||
const newPage = await browser.newPage();
|
||||
await newPage.goto(popup.url());
|
||||
await expect(newPage.getByText('hello')).toBeVisible();
|
||||
await newPage.close();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user