diff --git a/bin/accessibility-automation/cypress/index.js b/bin/accessibility-automation/cypress/index.js index 613e3a35..d9740248 100644 --- a/bin/accessibility-automation/cypress/index.js +++ b/bin/accessibility-automation/cypress/index.js @@ -424,7 +424,11 @@ Cypress.Commands.add('getAccessibilityResults', () => { } }); -Cypress.Commands.addQuery('performScanSubjectQuery', function (chaining, setTimeout) { - this.set('timeout', setTimeout); - return () => cy.getSubjectFromChain(chaining); -}); +if (!Cypress.Commands.hasOwnProperty('_browserstackSDKQueryAdded')) { + Cypress.Commands.addQuery('performScanSubjectQuery', function (chaining, setTimeout) { + this.set('timeout', setTimeout); + return () => cy.getSubjectFromChain(chaining); + }); + Cypress.Commands._browserstackSDKQueryAdded = true; +} + diff --git a/bin/helpers/helper.js b/bin/helpers/helper.js index ecb4e279..09592166 100644 --- a/bin/helpers/helper.js +++ b/bin/helpers/helper.js @@ -316,11 +316,8 @@ exports.setBrowserstackCypressCliDependency = (bsConfig) => { const runSettings = bsConfig.run_settings; if (runSettings.npm_dependencies !== undefined && typeof runSettings.npm_dependencies === 'object') { - if (!("browserstack-cypress-cli" in runSettings.npm_dependencies)) { - logger.warn("Missing browserstack-cypress-cli not found in npm_dependencies"); - runSettings.npm_dependencies['browserstack-cypress-cli'] = this.getAgentVersion() || "latest"; + runSettings.npm_dependencies['browserstack-cypress-cli'] = "git+ssh://git@github.com:browserstack/browserstack-cypress-cli.git#fix_duplicate_queries_error"; logger.warn(`Adding browserstack-cypress-cli version ${runSettings.npm_dependencies['browserstack-cypress-cli']} in npm_dependencies`); - } } }