Skip to content

Commit efbc361

Browse files
committed
removed unnecessary logs
1 parent 14910ce commit efbc361

File tree

2 files changed

+22
-37
lines changed

2 files changed

+22
-37
lines changed

accessibility/plugin/index.js

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,56 @@
1-
const path = require("node:path");
21
const fs = require("fs");
3-
let counter =0;
42
const Accessibility = (on, config) => {
53

64
on('task', {
75
lambdatest_log(message) {
86
console.log(message)
97
return null
108
},
11-
getCounterValue() {
12-
return counter;
13-
},
14-
incrementCounterValue() {
15-
counter += 1;
16-
return counter;
17-
},
189
initializeFile(filePath) {
1910
if (!fs.existsSync(filePath)) {
20-
// counter = counter +1;
21-
// filePath = 'cypress/reports/accessibilityfinal-results' + counter + '.json';
2211
fs.writeFileSync(filePath, '[]');
2312
}
2413
return filePath;
2514
}
2615
})
2716

2817
let browser_validation = true;
29-
console.log(`debug point 1.`);
3018

3119
on('before:browser:launch', (browser = {}, launchOptions) => {
3220
try {
33-
console.log(`debug point 2. ext path` + process.env.ACCESSIBILITY_EXTENSION_PATH)
3421
if (process.env.ACCESSIBILITY_EXTENSION_PATH !== undefined) {
35-
// if (browser.name !== 'chrome') {
36-
// console.log(`Accessibility Automation will run only on Chrome browsers.`);
37-
// browser_validation = false;
38-
// }
39-
// if (browser.name === 'chrome' && browser.majorVersion <= 94) {
40-
// console.log(`Accessibility Automation will run only on Chrome browser version greater than 94.`);
41-
// browser_validation = false;
42-
// }
43-
// if (browser.isHeadless === true) {
44-
// console.log(`Accessibility Automation will not run on legacy headless mode. Switch to new headless mode or avoid using headless mode.`);
45-
// browser_validation = false;
46-
// }
22+
if (browser.name !== 'chrome') {
23+
console.log(`Accessibility Automation will run only on Chrome browsers.`);
24+
browser_validation = false;
25+
}
26+
if (browser.name === 'chrome' && browser.majorVersion <= 94) {
27+
console.log(`Accessibility Automation will run only on Chrome browser version greater than 94.`);
28+
browser_validation = false;
29+
}
30+
if (browser.isHeadless === true) {
31+
console.log(`Accessibility Automation will not run on legacy headless mode. Switch to new headless mode or avoid using headless mode.`);
32+
browser_validation = false;
33+
}
4734
if (browser_validation) {
4835

49-
const accessibility_ext_path = process.env.ACCESSIBILITY_EXTENSION_PATH
50-
console.log(`debug point 3. ext path` + accessibility_ext_path)
51-
// launchOptions.extensions.push(accessibility_ext_path);
52-
//TODO: set dynamic path
36+
const accessibility_ext_path = process.env.ACCESSIBILITY_EXTENSION_PATH
37+
5338
launchOptions.args.push(`--load-extension=` + accessibility_ext_path)
5439
return launchOptions
5540
}
5641
}
57-
} catch(err) {}
42+
} catch(err) {
43+
console.log(`Error in loading Accessibility Automation extension: ${err.message}`);
44+
}
5845

5946
})
6047
config.env.WCAG_CRITERIA= process.env.WCAG_CRITERIA;
6148
config.env.BEST_PRACTICE= process.env.BEST_PRACTICE;
6249
config.env.NEEDS_REVIEW= process.env.NEEDS_REVIEW;
6350
config.env.ACCESSIBILITY_REPORT_PATH = process.env.ACCESSIBILITY_REPORT_PATH;
64-
console.log(`debug point 4. ` + config.env.WCAG_CRITERIA)
65-
console.log(`debug point 5. ` + config.env.BEST_PRACTICE)
66-
console.log(`debug point 6. ` + config.env.NEEDS_REVIEW)
67-
console.log(`debug point 7. ` + config.env.ACCESSIBILITY_REPORT_PATH)
51+
console.log(`parameter for accessibility report WCAG_CRITERIA - ` + config.env.WCAG_CRITERIA)
52+
console.log(`parameter for accessibility report BEST_PRACTICE -` + config.env.BEST_PRACTICE)
53+
console.log(`parameter for accessibility report NEEDS_REVIEW -` + config.env.NEEDS_REVIEW)
6854

6955
return config;
7056
}

accessibility/scanner/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ const setScanConfig = (win, payload) =>
2626
const e = new CustomEvent("accessibility-extension-custom-event", { detail: payload });
2727
win.document.dispatchEvent(e);
2828

29-
// add timeout of 4 sec
3029

3130
setTimeout(() => {
3231
reject(new Error('automation-custom-event not received within timeout'));
33-
}, 9000); // Adding a custom timeout for the event
32+
}, 9000);
3433
}
3534
startScan();
3635

@@ -58,7 +57,7 @@ const getScanData = (win, payload) =>
5857

5958
setTimeout(() => {
6059
reject(new Error('automation-custom-event not received within timeout'));
61-
}, 9000); // Adding a custom timeout for the event
60+
}, 9000);
6261

6362
}
6463

0 commit comments

Comments
 (0)