Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion bin/testObservability/reporter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,16 @@ class MyReporter {

uploadTestSteps = async (shouldClearCurrentSteps = true, cypressSteps = null) => {
const currentTestSteps = cypressSteps ? cypressSteps : JSON.parse(JSON.stringify(this.currentTestSteps));

// This prevents subsequent Mocha events from grabbing the same stale steps.
if(shouldClearCurrentSteps && !cypressSteps) {
this.currentTestSteps = [];
}

if (!currentTestSteps || currentTestSteps.length === 0) {
return;
}

/* TODO - Send as test logs */
const allStepsAsLogs = [];
currentTestSteps.forEach(step => {
Expand All @@ -350,11 +360,11 @@ class MyReporter {
};
allStepsAsLogs.push(currentStepAsLog);
});

await uploadEventData({
event_type: 'LogCreated',
logs: allStepsAsLogs
});
if(shouldClearCurrentSteps) this.currentTestSteps = [];
}

sendTestRunEvent = async (test, err = undefined, customFinished=false, eventType = "TestRunFinished") => {
Expand Down