chore(html-report): total duration should be selected run duration for test case
This commit is contained in:
parent
4b64c47a25
commit
6755c80172
|
|
@ -59,7 +59,7 @@ const testCase: TestCase = {
|
||||||
],
|
],
|
||||||
tags: [],
|
tags: [],
|
||||||
outcome: 'expected',
|
outcome: 'expected',
|
||||||
duration: 10,
|
duration: 200,
|
||||||
ok: true,
|
ok: true,
|
||||||
results: [result]
|
results: [result]
|
||||||
};
|
};
|
||||||
|
|
@ -212,6 +212,35 @@ test('should correctly render prev and next', async ({ mount }) => {
|
||||||
- text: group
|
- text: group
|
||||||
- link "« previous"
|
- link "« previous"
|
||||||
- link "next »"
|
- link "next »"
|
||||||
- text: "My test test.spec.ts:42 10ms"
|
- text: "My test test.spec.ts:42 100ms"
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const testCaseWithTwoAttempts: TestCase = {
|
||||||
|
...testCase,
|
||||||
|
results: [
|
||||||
|
{
|
||||||
|
...result,
|
||||||
|
errors: ['Error message'],
|
||||||
|
status: 'failed',
|
||||||
|
duration: 50,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
...result,
|
||||||
|
duration: 150,
|
||||||
|
status: 'passed',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
test('total duration is selected run duration', async ({ mount, page }) => {
|
||||||
|
const component = await mount(<TestCaseView projectNames={['chromium', 'webkit']} test={testCaseWithTwoAttempts} prev={undefined} next={undefined} run={0}></TestCaseView>);
|
||||||
|
await expect(component).toMatchAriaSnapshot(`
|
||||||
|
- text: "My test test.spec.ts:42 50ms"
|
||||||
|
`);
|
||||||
|
await page.getByText('Retry #1').click();
|
||||||
|
await expect(component).toMatchAriaSnapshot(`
|
||||||
|
- text: "My test test.spec.ts:42 150ms"
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ export const TestCaseView: React.FC<{
|
||||||
</CopyToClipboardContainer>
|
</CopyToClipboardContainer>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ flex: 'auto' }}></div>
|
<div style={{ flex: 'auto' }}></div>
|
||||||
<div className='test-case-duration'>{msToString(test.duration)}</div>
|
<div className='test-case-duration'>{msToString(test.results[selectedResultIndex]?.duration ?? test.duration)}</div>
|
||||||
</div>}
|
</div>}
|
||||||
{test && (!!test.projectName || labels) && <div className='test-case-project-labels-row'>
|
{test && (!!test.projectName || labels) && <div className='test-case-project-labels-row'>
|
||||||
{test && !!test.projectName && <ProjectLink projectNames={projectNames} projectName={test.projectName}></ProjectLink>}
|
{test && !!test.projectName && <ProjectLink projectNames={projectNames} projectName={test.projectName}></ProjectLink>}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue