@@ -1406,16 +1406,50 @@ pw:api |page.setContent @ a.test.ts:5
14061406test.step |custom step @ a.test.ts:6
14071407pw:api | page.waitForResponse @ a.test.ts:7
14081408pw:api | page.click(div) @ a.test.ts:13
1409- pw:api | response.text @ a.test.ts:8
14101409expect | expect.toBeTruthy @ a.test.ts:9
1411- pw:api | response.text @ a.test.ts:15
14121410expect |expect.toBe @ a.test.ts:17
14131411hook |After Hooks
14141412fixture | fixture: page
14151413fixture | fixture: context
14161414` ) ;
14171415} ) ;
14181416
1417+ test ( 'reading network request / response should not be listed as step' , {
1418+ annotation : { type : 'issue' , description : 'https://github.com/microsoft/playwright/issues/33558' }
1419+ } , async ( { runInlineTest, server } ) => {
1420+ const result = await runInlineTest ( {
1421+ 'reporter.ts' : stepIndentReporter ,
1422+ 'playwright.config.ts' : `module.exports = { reporter: './reporter' };` ,
1423+ 'a.test.ts' : `
1424+ import { test, expect } from '@playwright/test';
1425+ test('waitForResponse step nesting', async ({ page }) => {
1426+ page.on('request', async request => {
1427+ await request.allHeaders();
1428+ });
1429+ page.on('response', async response => {
1430+ await response.text();
1431+ });
1432+ await page.goto('${ server . EMPTY_PAGE } ');
1433+ });
1434+ `
1435+ } , { reporter : '' , workers : 1 , timeout : 3000 } ) ;
1436+
1437+ expect ( result . exitCode ) . toBe ( 0 ) ;
1438+ expect ( stripAnsi ( result . output ) ) . toBe ( `
1439+ hook |Before Hooks
1440+ fixture | fixture: browser
1441+ pw:api | browserType.launch
1442+ fixture | fixture: context
1443+ pw:api | browser.newContext
1444+ fixture | fixture: page
1445+ pw:api | browserContext.newPage
1446+ pw:api |page.goto(${ server . EMPTY_PAGE } ) @ a.test.ts:10
1447+ hook |After Hooks
1448+ fixture | fixture: page
1449+ fixture | fixture: context
1450+ ` ) ;
1451+ } ) ;
1452+
14191453test ( 'calls from page.route callback should be under its parent step' , {
14201454 annotation : { type : 'issue' , description : 'https://github.com/microsoft/playwright/issues/33186' }
14211455} , async ( { runInlineTest, server } ) => {
0 commit comments