Skip to content

Commit d2b191a

Browse files
correct after each
1 parent 1503a43 commit d2b191a

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

accessibility/scanner/index.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const processAccessibilityReport = async (windowNew) => {
127127
needsReview: needsReviewValue
128128
};
129129

130-
console.log('log', "SET SCAN: Payload to send: for url: ", payloadToSend);
130+
console.log('log', "SET SCAN: Payload to send: ", payloadToSend);
131131
try {
132132
let setResult = await setScanConfig(windowNew, payloadToSend);
133133
console.log('SET SCAN: response:', setResult);
@@ -285,8 +285,16 @@ if (overRideCommands) {
285285
oldprocessAccessibilityReport(win);
286286
})
287287
})
288+
}
289+
afterEach(() => {
290+
if(overRideCommands){
291+
cy.window().then(async (win) => {
292+
let isAccessibilityLoaded = Cypress.env("ACCESSIBILITY") || false;
293+
if (!isAccessibilityLoaded) return cy.wrap({});
288294

289-
afterEach(() => {
295+
cy.wrap(processAccessibilityReport(win), {timeout: 30000})
296+
});
297+
}else{
290298
console.log("after each hook")
291299
let isAccessibilityLoaded = Cypress.env("ACCESSIBILITY") || false;
292300
if (!isAccessibilityLoaded){
@@ -296,10 +304,9 @@ if (overRideCommands) {
296304
cy.window().then((win) => {
297305
oldprocessAccessibilityReport(win);
298306
})
307+
}
299308

300-
301-
})
302-
}
309+
})
303310

304311
Cypress.Commands.addQuery('performScanSubjectQuery', function (chaining, setTimeout) {
305312
this.set('timeout', setTimeout);

0 commit comments

Comments
 (0)