mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-11 20:37:54 +03:00
fix(trace-viewer): popup snapshot utf-8 support (#32006)
This commit is contained in:
parent
c54567a46b
commit
dbc4bc84d6
@ -37,7 +37,7 @@ export class SnapshotServer {
|
||||
return new Response(null, { status: 404 });
|
||||
const renderedSnapshot = snapshot.render();
|
||||
this._snapshotIds.set(snapshotUrl, snapshot);
|
||||
return new Response(renderedSnapshot.html, { status: 200, headers: { 'Content-Type': 'text/html' } });
|
||||
return new Response(renderedSnapshot.html, { status: 200, headers: { 'Content-Type': 'text/html; charset=utf-8' } });
|
||||
}
|
||||
|
||||
serveSnapshotInfo(pathname: string, searchParams: URLSearchParams): Response {
|
||||
|
@ -291,13 +291,13 @@ test('should show snapshot URL', async ({ page, runAndTrace, server }) => {
|
||||
test('should popup snapshot', async ({ page, runAndTrace, server }) => {
|
||||
const traceViewer = await runAndTrace(async () => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.setContent('hello');
|
||||
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;
|
||||
await expect(popup.getByText('hello')).toBeVisible();
|
||||
await expect(popup.getByText('hello äöü 🙂')).toBeVisible();
|
||||
});
|
||||
|
||||
test('should capture iframe with sandbox attribute', async ({ page, server, runAndTrace }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user