mirror of
https://github.com/microsoft/playwright.git
synced 2024-11-28 17:44:33 +03:00
chore(trace-viewer): do not shrink metadata view (#31938)
Avoids the following effect: ![image](https://github.com/user-attachments/assets/694de773-acc0-4266-87f2-eab67a3c7ce2)
This commit is contained in:
parent
ecd384212d
commit
0217defab4
@ -24,7 +24,8 @@ export const MetadataView: React.FunctionComponent<{
|
||||
}> = ({ model }) => {
|
||||
if (!model)
|
||||
return <></>;
|
||||
return <div className='metadata-view vbox'>
|
||||
|
||||
return <div data-testid='metadata-view' className='vbox' style={{ flexShrink: 0 }}>
|
||||
<div className='call-section' style={{ paddingTop: 2 }}>Time</div>
|
||||
{!!model.wallTime && <div className='call-line'>start time:<span className='call-value datetime' title={new Date(model.wallTime).toLocaleString()}>{new Date(model.wallTime).toLocaleString()}</span></div>}
|
||||
<div className='call-line'>duration:<span className='call-value number' title={msToString(model.endTime - model.startTime)}>{msToString(model.endTime - model.startTime)}</span></div>
|
||||
|
@ -58,7 +58,7 @@ class TraceViewerPage {
|
||||
this.stackFrames = page.getByTestId('stack-trace-list').locator('.list-view-entry');
|
||||
this.networkRequests = page.getByTestId('network-list').locator('.list-view-entry');
|
||||
this.snapshotContainer = page.locator('.snapshot-container iframe.snapshot-visible[name=snapshot]');
|
||||
this.metadataTab = page.locator('.metadata-view');
|
||||
this.metadataTab = page.getByTestId('metadata-view');
|
||||
}
|
||||
|
||||
async actionIconsText(action: string) {
|
||||
|
@ -804,7 +804,7 @@ test('should follow redirects', async ({ page, runAndTrace, server, asset }) =>
|
||||
test('should include metainfo', async ({ showTraceViewer }) => {
|
||||
const traceViewer = await showTraceViewer([traceFile]);
|
||||
await traceViewer.page.locator('text=Metadata').click();
|
||||
const callLine = traceViewer.page.locator('.metadata-view .call-line');
|
||||
const callLine = traceViewer.metadataTab.locator('.call-line');
|
||||
await expect(callLine.getByText('start time')).toHaveText(/start time:[\d/,: ]+/);
|
||||
await expect(callLine.getByText('duration')).toHaveText(/duration:[\dms]+/);
|
||||
await expect(callLine.getByText('engine')).toHaveText(/engine:[\w]+/);
|
||||
|
@ -83,7 +83,7 @@ for (const useIntermediateMergeReport of [false] as const) {
|
||||
await expect(page.getByTestId('overall-duration'), 'should contain humanized total time with at most 1 decimal place').toContainText(/^Total time: \d+(\.\d)?(ms|s|m)$/);
|
||||
await expect(page.getByTestId('project-name'), 'should contain project name').toContainText('project-name');
|
||||
|
||||
await expect(page.locator('.metadata-view')).not.toBeVisible();
|
||||
await expect(page.getByTestId('metadata-view')).not.toBeVisible();
|
||||
});
|
||||
|
||||
test('should allow navigating to testId=test.id', async ({ runInlineTest, page, showReport }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user