From 1a106558e25528b321cbf81fc5ec1dbd06a26eab Mon Sep 17 00:00:00 2001
From: 07souravkunda <souravkunda00@gmail.com>
Date: Tue, 21 Jan 2025 21:04:25 +0530
Subject: [PATCH 1/2] fix: filename for retries a11y

---
 bin/accessibility-automation/cypress/index.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/accessibility-automation/cypress/index.js b/bin/accessibility-automation/cypress/index.js
index 994cdaaf..dceafefa 100644
--- a/bin/accessibility-automation/cypress/index.js
+++ b/bin/accessibility-automation/cypress/index.js
@@ -333,6 +333,8 @@ afterEach(() => {
             let filePath = '';
             if (attributes.invocationDetails !== undefined && attributes.invocationDetails.relativeFile !== undefined) {
                 filePath = attributes.invocationDetails.relativeFile;
+            } else if (attributes.prevAttempts && attributes.prevAttempts.length > 0) {
+                filePath = attributes.prevAttempts[0].invocationDetails.relativeFile
             }
             const payloadToSend = {
                 "saveResults": shouldScanTestForAccessibility,

From 87eafae1c6aa3f7e2c3b6bb1002eef7914eb26af Mon Sep 17 00:00:00 2001
From: 07souravkunda <souravkunda00@gmail.com>
Date: Mon, 27 Jan 2025 12:33:46 +0530
Subject: [PATCH 2/2] fix: undefined

---
 bin/accessibility-automation/cypress/index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/accessibility-automation/cypress/index.js b/bin/accessibility-automation/cypress/index.js
index dceafefa..613e3a35 100644
--- a/bin/accessibility-automation/cypress/index.js
+++ b/bin/accessibility-automation/cypress/index.js
@@ -334,7 +334,7 @@ afterEach(() => {
             if (attributes.invocationDetails !== undefined && attributes.invocationDetails.relativeFile !== undefined) {
                 filePath = attributes.invocationDetails.relativeFile;
             } else if (attributes.prevAttempts && attributes.prevAttempts.length > 0) {
-                filePath = attributes.prevAttempts[0].invocationDetails.relativeFile
+                filePath = (attributes.prevAttempts[0].invocationDetails && attributes.prevAttempts[0].invocationDetails.relativeFile) || '';
             }
             const payloadToSend = {
                 "saveResults": shouldScanTestForAccessibility,