diff --git a/bin/helpers/capabilityHelper.js b/bin/helpers/capabilityHelper.js index 6ea88ec9..ecbcbeda 100644 --- a/bin/helpers/capabilityHelper.js +++ b/bin/helpers/capabilityHelper.js @@ -121,6 +121,10 @@ const caps = (bsConfig, zip) => { logger.info(`Running your tests in headless mode. Use --headed arg to run in headful mode.`); } + if (bsConfig.run_settings?.accessibility) { + bsConfig.run_settings["accessibilityPlatforms"] = getAccessibilityPlatforms(bsConfig); + } + // send run_settings as is for other capabilities obj.run_settings = JSON.stringify(bsConfig.run_settings); } @@ -142,6 +146,16 @@ const caps = (bsConfig, zip) => { }) } +const getAccessibilityPlatforms = (bsConfig) => { + const browserList = bsConfig.browsers; + const accessibilityPlatforms = Array(browserList.length).fill(false); + browserList.forEach((browserDetails, idx) => { + accessibilityPlatforms[idx] = (browserDetails?.accessibility === undefined) ? true : browserDetails?.accessibility + }); + return accessibilityPlatforms; +} + + const addCypressZipStartLocation = (runSettings) => { let resolvedHomeDirectoryPath = path.resolve(runSettings.home_directory); let resolvedCypressConfigFilePath = path.resolve(runSettings.cypressConfigFilePath);