chore(trace): do not nest API actions based on time
This commit is contained in:
parent
d0c840f639
commit
4889d56b79
|
|
@ -261,7 +261,6 @@ const playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({
|
||||||
title: renderApiCall(apiName, params),
|
title: renderApiCall(apiName, params),
|
||||||
apiName,
|
apiName,
|
||||||
params,
|
params,
|
||||||
canNestByTime: true,
|
|
||||||
});
|
});
|
||||||
userData.userObject = step;
|
userData.userObject = step;
|
||||||
out.stepId = step.stepId;
|
out.stepId = step.stepId;
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,6 @@ export interface TestStepInternal {
|
||||||
infectParentStepsWithError?: boolean;
|
infectParentStepsWithError?: boolean;
|
||||||
box?: boolean;
|
box?: boolean;
|
||||||
isStage?: 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 = {
|
export type TestStage = {
|
||||||
|
|
@ -255,11 +252,6 @@ export class TestInfoImpl implements TestInfo {
|
||||||
parentStep = this._findLastStageStep();
|
parentStep = this._findLastStageStep();
|
||||||
} else {
|
} else {
|
||||||
parentStep = zones.zoneData<TestStepInternal>('stepZone');
|
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 (!parentStep) {
|
||||||
// If no parent step on stack, assume the current stage as parent.
|
// If no parent step on stack, assume the current stage as parent.
|
||||||
parentStep = this._findLastStageStep();
|
parentStep = this._findLastStageStep();
|
||||||
|
|
|
||||||
|
|
@ -1216,9 +1216,9 @@ test('should not nest top level expect into unfinished api calls ', {
|
||||||
' browserContext.newPage',
|
' browserContext.newPage',
|
||||||
'page.route',
|
'page.route',
|
||||||
'page.goto',
|
'page.goto',
|
||||||
' route.fetch',
|
'route.fetch',
|
||||||
' page.unrouteAll',
|
|
||||||
'expect.toBeVisible',
|
'expect.toBeVisible',
|
||||||
|
'page.unrouteAll',
|
||||||
'After Hooks',
|
'After Hooks',
|
||||||
' fixture: page',
|
' fixture: page',
|
||||||
' fixture: context',
|
' fixture: context',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue