{
- const content = await this._snapshotStorage.resourceContent(sha1);
- if (!content)
- return new Response(null, { status: 404 });
+ const content = sha1 ? await this._snapshotStorage.resourceContent(sha1) || new Blob([]) : new Blob([]);
let contentType = resource.response.content.mimeType;
const isTextEncoding = /^text\/|^application\/(javascript|json)/.test(contentType);
@@ -95,7 +88,11 @@ export class SnapshotServer {
headers.delete('Content-Length');
headers.set('Content-Length', String(content.size));
headers.set('Cache-Control', 'public, max-age=31536000');
- return new Response(content, { headers });
+ return new Response(content, {
+ headers,
+ status: resource.response.status,
+ statusText: resource.response.statusText,
+ });
}
}
diff --git a/packages/playwright-core/src/web/traceViewer/ui/callTab.tsx b/packages/playwright-core/src/web/traceViewer/ui/callTab.tsx
index caeb4191ac..f2be96bee6 100644
--- a/packages/playwright-core/src/web/traceViewer/ui/callTab.tsx
+++ b/packages/playwright-core/src/web/traceViewer/ui/callTab.tsx
@@ -42,7 +42,7 @@ export const CallTab: React.FunctionComponent<{
{action.metadata.apiName}
{<>
Time
- wall time: {wallTime}
+ {action.metadata.wallTime && wall time: {wallTime}
}
duration: {duration}
>}
{ !!paramKeys.length && Parameters
}
diff --git a/packages/playwright-core/src/web/traceViewer/ui/snapshotTab.tsx b/packages/playwright-core/src/web/traceViewer/ui/snapshotTab.tsx
index 7aaeed6775..062de81fbe 100644
--- a/packages/playwright-core/src/web/traceViewer/ui/snapshotTab.tsx
+++ b/packages/playwright-core/src/web/traceViewer/ui/snapshotTab.tsx
@@ -63,7 +63,8 @@ export const SnapshotTab: React.FunctionComponent<{
if (snapshotInfoUrl) {
const response = await fetch(snapshotInfoUrl);
const info = await response.json();
- setSnapshotInfo(info);
+ if (!info.error)
+ setSnapshotInfo(info);
}
if (!iframeRef.current)
return;
diff --git a/tests/snapshotter.spec.ts b/tests/snapshotter.spec.ts
index 84edbf08f1..0e3ac0b487 100644
--- a/tests/snapshotter.spec.ts
+++ b/tests/snapshotter.spec.ts
@@ -216,6 +216,7 @@ function distillSnapshot(snapshot, distillTarget = true) {
if (distillTarget)
html = html.replace(/\s__playwright_target__="[^"]+"/g, '');
return html
+ .replace(/