Skip to content

Commit e79f94d

Browse files
Merge pull request #455 from saksharoralambdatest/AT-841
Fix for capture screenshot capability in accessibility
2 parents 6f5fafc + 6568554 commit e79f94d

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

accessibility/scanner/index.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,19 +194,16 @@ const processAccessibilityReport = async (windowNew) => {
194194
if (captureScreenshot) {
195195
if (scanData && scanData.data && scanData.data.length > 0 && globalScreenshots) {
196196
const firstDataItem = scanData.data[0];
197+
198+
// Extension always provides screenshotId and screenBound in each issue
199+
// Get screenshotId from the first issue to use the extension's ID
197200
if (firstDataItem.events && firstDataItem.events.length > 0) {
198201
const firstEvent = firstDataItem.events[0];
199-
if (firstEvent.issues && firstEvent.issues.length > 0) {
200-
// Update screenshotId with the actual screenshotId
201-
globalScreenshots[0].screenshotId=firstEvent.issues[0].screenshotId;
202-
}
203-
}
204-
for (let i = 0; i < scanData.data.length; i++) {
205-
if (scanData.data[i].screenshots && Array.isArray(scanData.data[i].screenshots)) {
206-
scanData.data[i].screenshots = globalScreenshots;
207-
break;
202+
if (firstEvent.issues && firstEvent.issues.length > 0 && firstEvent.issues[0].screenshotId) {
203+
globalScreenshots[0].screenshotId = firstEvent.issues[0].screenshotId;
208204
}
209205
}
206+
scanData.data[0].screenshots = globalScreenshots;
210207
}
211208
globalScreenshots = null;
212209
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lambdatest-cypress-cli",
3-
"version": "3.0.46",
3+
"version": "3.0.47",
44
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
55
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
66
"author": "LambdaTest <[email protected]>",
@@ -29,7 +29,7 @@
2929
"ws": "^7.4.3",
3030
"yaml": "^2.4.1",
3131
"yargs": "^16.1.0",
32-
"uuid": "^11.1.0"
32+
"uuid": "^11.1.0"
3333
},
3434
"license": "MIT",
3535
"preferGlobal": true,

0 commit comments

Comments
 (0)