Skip to content

Conversation

@AakashHotchandani
Copy link
Collaborator

@AakashHotchandani AakashHotchandani commented Oct 16, 2025

Description [Cypress CLI Release] SDK Auto Enable A11y
Body Details of the change: Auto Enable A11y https://browserstack.atlassian.net/browse/SDK-4312 & Release Notes:
Relates To https://browserstack.atlassian.net/browse/SDK-4312 .
Assign To automate-customer-ops (can be checked from help-automate)
Testing Completed Add Testing performedDev TestedRegression PassedQA TestedA TestedA Tested

@AakashHotchandani AakashHotchandani changed the title Sdk unknow Auto Enable A11y fix Oct 17, 2025
@07souravkunda 07souravkunda requested a review from Copilot October 17, 2025 09:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

const userAccessibilityEnabled = testhubUtils.isAccessibilityEnabled(user_config);
const serverAutoEnabled = testhubUtils.isAccessibilityInResponse(response.data);

console.log('[A11Y] C# SDK pattern check:', {
Copy link
Collaborator

@Tanmay-Bstack Tanmay-Bstack Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove 'c# SDK' from the log or is it intentional

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, should be removed thanks for pointing this out

} else {
// If accessibility is undefined, keep default to null
logger.debug('[A11Y] isAccessibilityEnabled from config: accessibility is undefined, returning null');
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we early return null from here then environment variable wont be checked, is that expected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Tanmay-Bstack
Tanmay-Bstack previously approved these changes Oct 17, 2025

// Also store scriptsToRun if available
if (commandsToWrapData.scriptsToRun) {
process.env.ACCESSIBILITY_SCRIPTS_TO_RUN = JSON.stringify(commandsToWrapData.scriptsToRun);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not using this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it

};

// Get accessibility script by name
exports.getAccessibilityScript = (scriptName) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unused remove

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the change

...payloadToSend,
scanMode: isBuildEndOnlyMode ? "comprehensive-build-end" : "incremental",
timestamp: Date.now(),
serverScripts: Cypress.env('ACCESSIBILITY_SCRIPTS') || null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required, it would be a large payload

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the changes

});

// Store server scripts for Cypress to read
process.env.ACCESSIBILITY_SCRIPTS = JSON.stringify(scriptsMap);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this unused

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -0,0 +1,227 @@
const path = require('path');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripts are hardcoded do we need this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

const serverCommands = commandsToWrapData.commands || [];

// Store server commands for Cypress to read
process.env.ACCESSIBILITY_COMMANDS_TO_WRAP = JSON.stringify(serverCommands);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these need to be added at setSystemEnvs, else won't be available in browserstack terminal

Maintain something like OBSERVABILITY_ENV_VARS for a11y as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants