diff --git a/lib/transport/factory.js b/lib/transport/factory.js index 95092c1b5..84c5be851 100644 --- a/lib/transport/factory.js +++ b/lib/transport/factory.js @@ -48,8 +48,12 @@ module.exports = class TransportFactory { } } + static usingBrowserstackTurboScale(settings) { + return settings.webdriver.host && (settings.webdriver.host.endsWith('.browserstack-ats.com') || settings.webdriver.host.startsWith('browserstack-turboscale-grid')); + } + static usingBrowserstack(settings) { - return settings.webdriver.host && (settings.webdriver.host.endsWith('.browserstack.com') || settings.webdriver.host.endsWith('.browserstack-ats.com') || settings.webdriver.host.startsWith('browserstack-turboscale-grid')); + return settings.webdriver.host && (settings.webdriver.host.endsWith('.browserstack.com') || TransportFactory.usingBrowserstackTurboScale(settings)); } static getBrowserName(nightwatchInstance) { @@ -124,6 +128,12 @@ module.exports = class TransportFactory { return new AppAutomate(nightwatchInstance, browserName); } + if (TransportFactory.usingBrowserstackTurboScale(nightwatchInstance.settings)) { + const AutomateTurboScale = require('./selenium-webdriver/browserstack/automateTurboScale.js'); + + return new AutomateTurboScale(nightwatchInstance, browserName); + } + const Automate = require('./selenium-webdriver/browserstack/automate.js'); return new Automate(nightwatchInstance, browserName); diff --git a/lib/transport/selenium-webdriver/browserstack/automateTurboScale.js b/lib/transport/selenium-webdriver/browserstack/automateTurboScale.js new file mode 100644 index 000000000..791f2fd27 --- /dev/null +++ b/lib/transport/selenium-webdriver/browserstack/automateTurboScale.js @@ -0,0 +1,9 @@ +const Automate = require('./automate.js'); + +class AutomateTurboScale extends Automate { + get productNamespace() { + return 'automate-turboscale/v1'; + } +} + +module.exports = AutomateTurboScale;