diff --git a/bin/testObservability/cypress/index.js b/bin/testObservability/cypress/index.js index b6e4e5b1..31c8d08e 100644 --- a/bin/testObservability/cypress/index.js +++ b/bin/testObservability/cypress/index.js @@ -2,11 +2,11 @@ /* Used to detect Gherkin steps */ Cypress.on('log:added', (log) => { - cy.now('task', 'test_observability_step', { - log - }, {log: false}).then((res) => { - }).catch((err) => { - }); + return () => { + return cy.now('task', 'test_observability_step', { + log + }, {log: false}) + } }); Cypress.on('command:start', (command) => { diff --git a/bin/testObservability/reporter/index.js b/bin/testObservability/reporter/index.js index d8c0c200..c3e54b79 100644 --- a/bin/testObservability/reporter/index.js +++ b/bin/testObservability/reporter/index.js @@ -309,11 +309,14 @@ class MyReporter { 'failure_type': !failureReason ? null : failureReason.match(/AssertionError/) ? 'AssertionError' : 'UnhandledError', 'retry_of': test.retryOf, 'meta': { - steps: JSON.parse(JSON.stringify(this.currentTestCucumberSteps)) + steps: [] } }; - this.currentTestCucumberSteps = []; + if(eventType.match(/TestRunFinished/) || eventType.match(/TestRunSkipped/)) { + testData['meta'].steps = JSON.parse(JSON.stringify(this.currentTestCucumberSteps)); + this.currentTestCucumberSteps = []; + } const { os, os_version } = await getOSDetailsFromSystem(process.env.observability_product); if(process.env.observability_integration) {