Skip to content

Commit dbe3258

Browse files
authored
Merge branch 'main' into roll-into-pw-firefox/1471
Signed-off-by: Yury Semikhatsky <[email protected]>
2 parents 6d1710d + d2e7ad3 commit dbe3258

File tree

6 files changed

+45
-15
lines changed

6 files changed

+45
-15
lines changed

docs/src/browsers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ Certain Enterprise Browser Policies may impact Playwright's ability to launch an
452452
:::
453453

454454
:::warning
455-
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) fore details.
455+
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for details.
456456
:::
457457

458458
```js

packages/html-reporter/src/links.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
color: var(--color-scale-orange-6);
6161
border: 1px solid var(--color-scale-orange-4);
6262
}
63+
.label-color-gray {
64+
background-color: var(--color-scale-gray-0);
65+
color: var(--color-scale-gray-6);
66+
border: 1px solid var(--color-scale-gray-4);
67+
}
6368
}
6469

6570
@media(prefers-color-scheme: dark) {
@@ -93,6 +98,11 @@
9398
color: var(--color-scale-orange-2);
9499
border: 1px solid var(--color-scale-orange-4);
95100
}
101+
.label-color-gray {
102+
background-color: var(--color-scale-gray-9);
103+
color: var(--color-scale-gray-2);
104+
border: 1px solid var(--color-scale-gray-4);
105+
}
96106
}
97107

98108
.attachment-body {

packages/html-reporter/src/testResultView.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export const TestResultView: React.FC<{
134134
</div>)}
135135
</AutoChip></Anchor>}
136136

137-
{!!otherAttachments.size && <AutoChip header='Attachments' revealOnAnchorId={otherAttachmentAnchors}>
137+
{!!otherAttachments.size && <AutoChip header='Attachments' revealOnAnchorId={otherAttachmentAnchors} dataTestId='attachments'>
138138
{[...otherAttachments].map((a, i) =>
139139
<Anchor key={`attachment-link-${i}`} id={`attachment-${result.attachments.indexOf(a)}`}>
140140
<AttachmentLink attachment={a} result={result} openInNewTab={a.contentType.startsWith('text/html')} />
@@ -176,15 +176,27 @@ const StepTreeItem: React.FC<{
176176
}> = ({ test, step, result, depth }) => {
177177
return <TreeItem title={<span aria-label={step.title}>
178178
<span style={{ float: 'right' }}>{msToString(step.duration)}</span>
179-
{step.attachments.length > 0 && <a style={{ float: 'right' }} title='link to attachment' href={testResultHref({ test, result, anchor: `attachment-${step.attachments[0]}` })} onClick={evt => { evt.stopPropagation(); }}>{icons.attachment()}</a>}
180179
{statusIcon(step.error || step.duration === -1 ? 'failed' : 'passed')}
181180
<span>{step.title}</span>
182181
{step.count > 1 && <><span className='test-result-counter'>{step.count}</span></>}
183182
{step.location && <span className='test-result-path'>{step.location.file}:{step.location.line}</span>}
184183
</span>} loadChildren={step.steps.length + (step.snippet ? 1 : 0) ? () => {
185-
const children = step.steps.map((s, i) => <StepTreeItem key={i} step={s} depth={depth + 1} result={result} test={test} />);
186-
if (step.snippet)
187-
children.unshift(<TestErrorView testId='test-snippet' key='line' error={step.snippet}/>);
188-
return children;
184+
const snippet = step.snippet ? [<TestErrorView testId='test-snippet' key='line' error={step.snippet}/>] : [];
185+
const steps = step.steps.map((s, i) => <StepTreeItem key={i} step={s} depth={depth + 1} result={result} test={test} />);
186+
const attachments = step.attachments.map(attachmentIndex => (
187+
<a key={'' + attachmentIndex}
188+
href={testResultHref({ test, result, anchor: `attachment-${attachmentIndex}` })}
189+
style={{ paddingLeft: depth * 22 + 4, textDecoration: 'none' }}
190+
>
191+
<span
192+
style={{ margin: '8px 0 0 8px', padding: '2px 10px', cursor: 'pointer' }}
193+
className='label label-color-gray'
194+
title={`see "${result.attachments[attachmentIndex].name}"`}
195+
>
196+
{icons.attachment()}{result.attachments[attachmentIndex].name}
197+
</span>
198+
</a>
199+
));
200+
return snippet.concat(steps, attachments);
189201
} : undefined} depth={depth}/>;
190202
};

packages/playwright-core/browsers.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
},
2222
{
2323
"name": "firefox-beta",
24-
"revision": "1466",
24+
"revision": "1467",
2525
"installByDefault": false,
2626
"browserVersion": "133.0b9"
2727
},
2828
{
2929
"name": "webkit",
30-
"revision": "2122",
30+
"revision": "2123",
3131
"installByDefault": true,
3232
"revisionOverrides": {
3333
"debian11-x64": "2105",

tests/library/har.spec.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ it('should have browser', async ({ browserName, browser, contextFactory, server
6060
const { page, getLog } = await pageWithHar(contextFactory, testInfo);
6161
await page.goto(server.EMPTY_PAGE);
6262
const log = await getLog();
63-
expect(log.browser!.name.toLowerCase()).toBe(browserName);
63+
64+
// _bidiFirefox and _bidiChromium are initialized with 'bidi' as browser name.
65+
const harBrowserName = browserName.startsWith('_bidi') ? 'bidi' : browserName;
66+
expect(log.browser!.name.toLowerCase()).toBe(harBrowserName);
6467
expect(log.browser!.version).toBe(browser.version());
6568
});
6669

@@ -957,6 +960,9 @@ it('should not hang on slow chunked response', async ({ browserName, browser, co
957960
await page.goto(server.EMPTY_PAGE);
958961
await page.evaluate(() => (window as any).receivedFirstData);
959962
const log = await getLog();
960-
expect(log.browser!.name.toLowerCase()).toBe(browserName);
963+
964+
// _bidiFirefox and _bidiChromium are initialized with 'bidi' as browser name.
965+
const harBrowserName = browserName.startsWith('_bidi') ? 'bidi' : browserName;
966+
expect(log.browser!.name.toLowerCase()).toBe(harBrowserName);
961967
expect(log.browser!.version).toBe(browser.version());
962968
});

tests/playwright-test/reporter-html.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,9 +932,10 @@ for (const useIntermediateMergeReport of [true, false] as const) {
932932
await showReport();
933933
await page.getByRole('link', { name: 'passing' }).click();
934934

935-
const attachment = page.getByText('foo-2', { exact: true });
935+
const attachment = page.getByTestId('attachments').getByText('foo-2', { exact: true });
936936
await expect(attachment).not.toBeInViewport();
937-
await page.getByLabel('attach "foo-2"').getByTitle('link to attachment').click();
937+
await page.getByLabel('attach "foo-2"').click();
938+
await page.getByTitle('see "foo-2"').click();
938939
await expect(attachment).toBeInViewport();
939940

940941
await page.reload();
@@ -961,9 +962,10 @@ for (const useIntermediateMergeReport of [true, false] as const) {
961962
await showReport();
962963
await page.getByRole('link', { name: 'passing' }).click();
963964

964-
const attachment = page.getByText('attachment', { exact: true });
965+
const attachment = page.getByTestId('attachments').getByText('attachment', { exact: true });
965966
await expect(attachment).not.toBeInViewport();
966-
await page.getByLabel('step').getByTitle('link to attachment').click();
967+
await page.getByLabel('step').click();
968+
await page.getByTitle('see "attachment"').click();
967969
await expect(attachment).toBeInViewport();
968970
});
969971

0 commit comments

Comments
 (0)