Skip to content

Commit

Permalink
chore: log canary times
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Mar 27, 2024
1 parent 087725a commit a54d970
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/laboratory/tests/canary.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const ENV = process.env['ENVIRONMENT'] || 'dev'
const REGION = process.env['REGION'] || 'eu-central-1'

testConnectedMW.beforeEach(async ({ modalValidator, walletValidator }) => {
console.time("beforeEach expectConnection")
await expectConnection(modalValidator, walletValidator)
console.timeEnd("beforeEach expectConnection")
})

testConnectedMW.afterEach(async ({ browserName }, testInfo) => {
Expand All @@ -15,6 +17,7 @@ testConnectedMW.afterEach(async ({ browserName }, testInfo) => {
}

if (ENV !== 'dev') {
console.time("uploadCanaryResultsToCloudWatch")
const duration: number = testInfo.duration
await uploadCanaryResultsToCloudWatch(
ENV,
Expand All @@ -24,18 +27,33 @@ testConnectedMW.afterEach(async ({ browserName }, testInfo) => {
testInfo.status === 'passed',
duration
)
console.timeEnd("uploadCanaryResultsToCloudWatch")
}
})

testConnectedMW(
'it should sign',
async ({ modalPage, walletPage, modalValidator, walletValidator }) => {
console.time("modalPage.sign()")
await modalPage.sign()
console.timeEnd("modalPage.sign()")
console.time("walletValidator.expectReceivedSign")
await walletValidator.expectReceivedSign({})
console.timeEnd("walletValidator.expectReceivedSign")
console.time("walletPage.handleRequest")
await walletPage.handleRequest({ accept: true })
console.timeEnd("walletPage.handleRequest")
console.time("modalValidator.expectAcceptedSign")
await modalValidator.expectAcceptedSign()
console.timeEnd("modalValidator.expectAcceptedSign")
console.time("modalPage.disconnect")
await modalPage.disconnect()
console.timeEnd("modalPage.disconnect")
console.time("modalValidator.expectDisconnected")
await modalValidator.expectDisconnected()
console.timeEnd("modalValidator.expectDisconnected")
console.time("walletValidator.expectDisconnected")
await walletValidator.expectDisconnected()
console.timeEnd("walletValidator.expectDisconnected")
}
)

0 comments on commit a54d970

Please sign in to comment.