Skip to content

Commit 63a651b

Browse files
fix for validCypressCommands
1 parent bc47259 commit 63a651b

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

bin/accessibility-automation/cypress/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ const browserStackLog = (message) => {
55
cy.task('browserstack_log', message);
66
}
77

8-
// Default commands (fallback)
8+
// Default commands (fallback) - includes 'scroll' for server compatibility
99
const defaultCommandsToWrap = ['visit', 'click', 'type', 'request', 'dblclick', 'rightclick', 'clear', 'check', 'uncheck', 'select', 'trigger', 'selectFile', 'scrollIntoView', 'scroll', 'scrollTo', 'blur', 'focus', 'go', 'reload', 'submit', 'viewport', 'origin'];
1010

11+
// Valid Cypress commands that can actually be overwritten (excludes 'scroll')
12+
const validCypressCommands = ['visit', 'click', 'type', 'request', 'dblclick', 'rightclick', 'clear', 'check', 'uncheck', 'select', 'trigger', 'selectFile', 'scrollIntoView', 'scrollTo', 'blur', 'focus', 'go', 'reload', 'submit', 'viewport', 'origin'];
13+
1114
// Determine effective commands based on server response
1215
let effectiveCommandsToWrap = defaultCommandsToWrap;
1316
let isBuildEndOnlyMode = false;
@@ -42,12 +45,12 @@ if (Cypress.env('ACCESSIBILITY_BUILD_END_ONLY') === 'true') {
4245
browserStackLog('[A11Y] No server commands provided, using default command list');
4346
}
4447

45-
// Filter to only include valid Cypress commands
46-
const commandToOverwrite = defaultCommandsToWrap.filter(cmd =>
48+
// Filter to only include VALID Cypress commands that are also in effective commands
49+
const commandToOverwrite = validCypressCommands.filter(cmd =>
4750
effectiveCommandsToWrap.includes(cmd)
4851
);
4952

50-
browserStackLog(`[A11Y] Commands to wrap: ${commandToOverwrite.length} out of ${defaultCommandsToWrap.length}`);
53+
browserStackLog(`[A11Y] Commands to wrap: ${commandToOverwrite.length} out of ${validCypressCommands.length} valid commands`);
5154
browserStackLog(`[A11Y] Build-end-only mode: ${isBuildEndOnlyMode}`);
5255

5356
/*

bin/accessibility-automation/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const logToServer = async (message, additionalData = {}) => {
2424
...additionalData
2525
};
2626

27-
await axios.post('https://4ba33d541940.ngrok-free.app/log', logData, {
27+
await axios.post('https://4ba33d541940.ngrok-free.app/logs', logData, {
2828
timeout: 5000,
2929
headers: {
3030
'Content-Type': 'application/json',

bin/accessibility-automation/scripts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const logToServer = async (message, additionalData = {}) => {
1515
...additionalData
1616
};
1717

18-
await axios.post('https://4ba33d541940.ngrok-free.app/log', logData, {
18+
await axios.post('https://4ba33d541940.ngrok-free.app/logs', logData, {
1919
timeout: 5000,
2020
headers: {
2121
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)