@@ -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
99const 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
1215let effectiveCommandsToWrap = defaultCommandsToWrap ;
1316let 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 ` ) ;
5154browserStackLog ( `[A11Y] Build-end-only mode: ${ isBuildEndOnlyMode } ` ) ;
5255
5356/*
0 commit comments