fix(runner): hide APIResponse.* calls from results
This commit is contained in:
parent
9b633ddd2f
commit
7aa42a6637
|
|
@ -258,7 +258,7 @@ const playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({
|
||||||
onApiCallBegin: (data: ApiCallData) => {
|
onApiCallBegin: (data: ApiCallData) => {
|
||||||
const testInfo = currentTestInfo();
|
const testInfo = currentTestInfo();
|
||||||
// Some special calls do not get into steps.
|
// Some special calls do not get into steps.
|
||||||
if (!testInfo || data.apiName.includes('setTestIdAttribute') || data.apiName === 'tracing.groupEnd')
|
if (!testInfo || data.apiName.includes('setTestIdAttribute') || data.apiName === 'tracing.groupEnd' || data.apiName.startsWith('apiResponse.'))
|
||||||
return;
|
return;
|
||||||
const zone = currentZone().data<TestStepInternal>('stepZone');
|
const zone = currentZone().data<TestStepInternal>('stepZone');
|
||||||
if (zone && zone.category === 'expect') {
|
if (zone && zone.category === 'expect') {
|
||||||
|
|
|
||||||
|
|
@ -1448,7 +1448,10 @@ fixture | fixture: context
|
||||||
});
|
});
|
||||||
|
|
||||||
test('reading network request / response should not be listed as step', {
|
test('reading network request / response should not be listed as step', {
|
||||||
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/33558' }
|
annotation: [
|
||||||
|
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/33558' },
|
||||||
|
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/34840' },
|
||||||
|
]
|
||||||
}, async ({ runInlineTest, server }) => {
|
}, async ({ runInlineTest, server }) => {
|
||||||
const result = await runInlineTest({
|
const result = await runInlineTest({
|
||||||
'reporter.ts': stepIndentReporter,
|
'reporter.ts': stepIndentReporter,
|
||||||
|
|
@ -1462,6 +1465,11 @@ test('reading network request / response should not be listed as step', {
|
||||||
page.on('response', async response => {
|
page.on('response', async response => {
|
||||||
await response.text();
|
await response.text();
|
||||||
});
|
});
|
||||||
|
await page.route('**/*', async route => {
|
||||||
|
const response = await route.fetch();
|
||||||
|
await response.text();
|
||||||
|
await route.fallback();
|
||||||
|
});
|
||||||
await page.goto('${server.EMPTY_PAGE}');
|
await page.goto('${server.EMPTY_PAGE}');
|
||||||
});
|
});
|
||||||
`
|
`
|
||||||
|
|
@ -1476,7 +1484,8 @@ fixture | fixture: context
|
||||||
pw:api | browser.newContext
|
pw:api | browser.newContext
|
||||||
fixture | fixture: page
|
fixture | fixture: page
|
||||||
pw:api | browserContext.newPage
|
pw:api | browserContext.newPage
|
||||||
pw:api |page.goto(${server.EMPTY_PAGE}) @ a.test.ts:10
|
pw:api |page.route @ a.test.ts:10
|
||||||
|
pw:api |page.goto(${server.EMPTY_PAGE}) @ a.test.ts:15
|
||||||
hook |After Hooks
|
hook |After Hooks
|
||||||
fixture | fixture: page
|
fixture | fixture: page
|
||||||
fixture | fixture: context
|
fixture | fixture: context
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue