Skip to content

Commit d90ac44

Browse files
committed
removed debugging code
1 parent 3af740b commit d90ac44

File tree

1 file changed

+2
-15
lines changed
  • bin/accessibility-automation/cypress

1 file changed

+2
-15
lines changed

bin/accessibility-automation/cypress/index.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
const fs = require('fs');
2-
const path = require('path');
1+
32
/* Event listeners + custom commands for Cypress */
43

54
const browserStackLog = (message) => {
6-
// if (!Cypress.env('BROWSERSTACK_LOGS')) return;
7-
if (typeof cy === 'undefined') {
8-
console.warn('Cypress is not defined. Ensure that this code is running in a Cypress environment.');
9-
} else {
5+
if (!Cypress.env('BROWSERSTACK_LOGS')) return;
106
cy.task('browserstack_log', message);
117
}
12-
}
138

149
const commandsToWrap = ['visit', 'click', 'type', 'request', 'dblclick', 'rightclick', 'clear', 'check', 'uncheck', 'select', 'trigger', 'selectFile', 'scrollIntoView', 'scroll', 'scrollTo', 'blur', 'focus', 'go', 'reload', 'submit', 'viewport', 'origin'];
1510
// scroll is not a default function in cypress.
@@ -324,14 +319,6 @@ commandToOverwrite.forEach((command) => {
324319

325320
afterEach(() => {
326321

327-
try {
328-
throw new Error('Deliberate exception thrown for testing purposes');
329-
} catch (error) {
330-
if (error && error.stack) {
331-
browserStackLog(error.stack);
332-
}
333-
}
334-
335322
const attributes = Cypress.mocha.getRunner().suite.ctx.currentTest;
336323
cy.window().then(async (win) => {
337324
let shouldScanTestForAccessibility = shouldScanForAccessibility(attributes);

0 commit comments

Comments
 (0)