make parent step ID explicit
This commit is contained in:
parent
0e9eaf2134
commit
2d4d402297
|
|
@ -192,7 +192,7 @@ export class TestInfoImpl implements TestInfo {
|
||||||
this._attachmentsPush = this.attachments.push.bind(this.attachments);
|
this._attachmentsPush = this.attachments.push.bind(this.attachments);
|
||||||
this.attachments.push = (...attachments: TestInfo['attachments']) => {
|
this.attachments.push = (...attachments: TestInfo['attachments']) => {
|
||||||
for (const a of attachments)
|
for (const a of attachments)
|
||||||
this._attach(a);
|
this._attach(a, undefined);
|
||||||
return this.attachments.length;
|
return this.attachments.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -292,6 +292,9 @@ export class TestInfoImpl implements TestInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const attachment of result.attachments ?? [])
|
||||||
|
this._attach(attachment, stepId);
|
||||||
|
|
||||||
const payload: StepEndPayload = {
|
const payload: StepEndPayload = {
|
||||||
testId: this.testId,
|
testId: this.testId,
|
||||||
stepId,
|
stepId,
|
||||||
|
|
@ -404,11 +407,10 @@ export class TestInfoImpl implements TestInfo {
|
||||||
category: 'attach',
|
category: 'attach',
|
||||||
});
|
});
|
||||||
const attachment = await normalizeAndSaveAttachment(this.outputPath(), name, options);
|
const attachment = await normalizeAndSaveAttachment(this.outputPath(), name, options);
|
||||||
this._attach(attachment);
|
|
||||||
step.complete({ attachments: [attachment] });
|
step.complete({ attachments: [attachment] });
|
||||||
}
|
}
|
||||||
|
|
||||||
private _attach(attachment: TestInfo['attachments'][0]) {
|
private _attach(attachment: TestInfo['attachments'][0], stepId: string | undefined) {
|
||||||
this._attachmentsPush(attachment);
|
this._attachmentsPush(attachment);
|
||||||
this._onAttach({
|
this._onAttach({
|
||||||
testId: this.testId,
|
testId: this.testId,
|
||||||
|
|
@ -416,7 +418,7 @@ export class TestInfoImpl implements TestInfo {
|
||||||
contentType: attachment.contentType,
|
contentType: attachment.contentType,
|
||||||
path: attachment.path,
|
path: attachment.path,
|
||||||
body: attachment.body?.toString('base64'),
|
body: attachment.body?.toString('base64'),
|
||||||
stepId: this._parentStep()?.stepId,
|
stepId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue