Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Persistent Logs (#1407)
Browse files Browse the repository at this point in the history
Changed the naming convention for log files so that it helps evaluate test failures. Applying this change first and quickly so once I introduce the web page app it will work with the most recent builds.
  • Loading branch information
SDESkowronski committed Dec 9, 2019
1 parent cfbeaad commit b9d0dde
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cypress/support/PersistentLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

(function () {
let suiteTitle
let test
let logFileName
let logEntries = ''
Expand Down Expand Up @@ -79,10 +78,9 @@ beforeEach(function() {
console.log(`******************** ${GetFullTestSuiteTitle(this.currentTest)} ************************************************************`)

test = this.currentTest
const title = GetSuiteRootTitle(this.currentTest)
if (title !== suiteTitle) {
suiteTitle = title
logFileName = `./results/cypress/${suiteTitle}.${Cypress.moment().format("YY.MM.DD.HH.mm.ss..SSS")}.log`
if (!logFileName) {
const specFileId = Cypress.spec.name.replace(/\/|\\/g, "-")
logFileName = `./results/cypress/${specFileId}.${Cypress.moment().format("YY.MM.DD.HH.mm.ss..SSS")}.log`
}
})

Expand All @@ -107,7 +105,7 @@ function LogTestState()
console.log(message)
console.log("'".repeat(message.length))
if (failureMessage != '') {
console.log(`Failure Message: "${failureMessage}"`)
console.log(`Failure Message: ${failureMessage}`)
}
}

Expand Down

0 comments on commit b9d0dde

Please sign in to comment.