Skip to content

Commit 9672dfd

Browse files
custom changes
1 parent 2a8d643 commit 9672dfd

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

accessibility/scanner/index.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,26 +133,23 @@ function processAccessibilityReport(win){
133133
});
134134
}
135135

136-
Cypress.on('command:start', async (command) => {
137-
if(!command || !command.attributes) return;
138-
if(command.attributes.name == 'window' || command.attributes.name == 'then' || command.attributes.name == 'wrap' || command.attributes.name == 'wait') {
139-
return;
140-
}
141-
142-
if (!commandsToWrap.includes(command.attributes.name)) return;
143-
let isAccessibilityLoaded = Cypress.env("ACCESSIBILITY") || false;
144-
if (!isAccessibilityLoaded){
145-
console.log('log', "accessibility not enabled " + isAccessibilityLoaded);
146-
return;
147-
}
136+
commandsToWrap.forEach((command) => {
137+
Cypress.Commands.overwrite(command, (originalFn, ...args) => {
138+
let isAccessibilityLoaded = Cypress.env("ACCESSIBILITY") || false;
139+
if (!isAccessibilityLoaded) {
140+
console.log('log', "accessibility not enabled " + isAccessibilityLoaded);
141+
return originalFn(...args);
142+
}
148143

144+
console.log('log', "debugging scan for command " + command);
145+
cy.window().then((win) => {
146+
processAccessibilityReport(win);
147+
});
149148

150-
console.log('log', "debugging scan form command " + command.attributes.name);
149+
return originalFn(...args);
150+
});
151+
});
151152

152-
cy.window().then((win) => {
153-
processAccessibilityReport(win);
154-
})
155-
})
156153

157154

158155
Cypress.on('command:end', (command) => {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lambdatest-cypress-cli",
3-
"version": "3.0.34",
3+
"version": "3.0.35-custom",
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]>",

0 commit comments

Comments
 (0)