chore(trace): do not nest API actions based on time (#31990)
They should be properly nested based on Node.js zones now.
This commit is contained in:
parent
5c9ce6b9d9
commit
fef27395a5
|
|
@ -261,7 +261,6 @@ const playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({
|
|||
title: renderApiCall(apiName, params),
|
||||
apiName,
|
||||
params,
|
||||
canNestByTime: true,
|
||||
});
|
||||
userData.userObject = step;
|
||||
out.stepId = step.stepId;
|
||||
|
|
|
|||
|
|
@ -44,9 +44,6 @@ export interface TestStepInternal {
|
|||
infectParentStepsWithError?: boolean;
|
||||
box?: boolean;
|
||||
isStage?: boolean;
|
||||
// TODO: this сould be decided based on the category, but pw:api
|
||||
// is from a different abstraction layer.
|
||||
canNestByTime?: boolean;
|
||||
}
|
||||
|
||||
export type TestStage = {
|
||||
|
|
@ -255,11 +252,6 @@ export class TestInfoImpl implements TestInfo {
|
|||
parentStep = this._findLastStageStep();
|
||||
} else {
|
||||
parentStep = zones.zoneData<TestStepInternal>('stepZone');
|
||||
if (!parentStep && data.canNestByTime) {
|
||||
// API steps (but not test.step calls) can be nested by time, instead of by stack.
|
||||
// However, do not nest chains of route.continue by checking the title.
|
||||
parentStep = this._findLastNonFinishedStep(step => step.title !== data.title);
|
||||
}
|
||||
if (!parentStep) {
|
||||
// If no parent step on stack, assume the current stage as parent.
|
||||
parentStep = this._findLastStageStep();
|
||||
|
|
|
|||
|
|
@ -1217,8 +1217,8 @@ test('should not nest top level expect into unfinished api calls ', {
|
|||
'page.route',
|
||||
'page.goto',
|
||||
'route.fetch',
|
||||
' page.unrouteAll',
|
||||
'expect.toBeVisible',
|
||||
'page.unrouteAll',
|
||||
'After Hooks',
|
||||
' fixture: page',
|
||||
' fixture: context',
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ fixture | fixture: browser
|
|||
`);
|
||||
});
|
||||
|
||||
test('should nest page.continue inside page.goto steps', async ({ runInlineTest }) => {
|
||||
test('should not nest page.continue inside page.goto steps', async ({ runInlineTest }) => {
|
||||
const result = await runInlineTest({
|
||||
'reporter.ts': stepIndentReporter,
|
||||
'playwright.config.ts': `module.exports = { reporter: './reporter', };`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue