Skip to content

Commit fc985b7

Browse files
chore: more logs
1 parent b3d79f8 commit fc985b7

File tree

1 file changed

+14
-1
lines changed
  • bin/accessibility-automation/cypress

1 file changed

+14
-1
lines changed

bin/accessibility-automation/cypress/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,18 @@ commandToOverwrite.forEach((command) => {
318318

319319
afterEach(() => {
320320
const attributes = Cypress.mocha.getRunner().suite.ctx.currentTest;
321+
console.log(`--- ENTERING AFTEREACH FOR: ${testTitle} ---`); // Added
322+
console.log(`Timestamp (afterEach start): ${new Date().toISOString()}`)
321323
cy.window().then(async (win) => {
322324
let shouldScanTestForAccessibility = shouldScanForAccessibility(attributes);
323-
if (!shouldScanTestForAccessibility) return cy.wrap({});
325+
if (!shouldScanTestForAccessibility) {
326+
console.log(`Skipping scan for: ${testTitle} (not accessibility session)`); // Added
327+
return cy.wrap({});
328+
}
329+
console.log(`Performing initial scan within afterEach for: ${testTitle}`); // Added
324330

325331
cy.wrap(performScan(win), {timeout: 30000}).then(() => {
332+
console.log(`Initial scan completed within afterEach for: ${testTitle}`); // Added
326333
try {
327334
let os_data;
328335
if (Cypress.env("OS")) {
@@ -355,12 +362,18 @@ afterEach(() => {
355362
}
356363
};
357364
browserStackLog(`Saving accessibility test results`);
365+
console.log(`Timestamp (saveTestResults call): ${new Date().toISOString()}`); // Added
358366
cy.wrap(saveTestResults(win, payloadToSend), {timeout: 30000}).then(() => {
359367
browserStackLog(`Saved accessibility test results`);
368+
console.log(`Timestamp (saveTestResults completed): ${new Date().toISOString()}`); // Added
369+
console.log(`--- EXITING AFTEREACH FOR: ${testTitle} ---`); // Added
370+
360371
})
361372

362373
} catch (er) {
363374
browserStackLog(`Error in saving results with error: ${er.message}`);
375+
console.error(`Error in afterEach for ${testTitle}:`, er); // Added
376+
364377
}
365378
})
366379
});

0 commit comments

Comments
 (0)