From 47506f14885990c38b4326017966ddcf2e25b419 Mon Sep 17 00:00:00 2001 From: Arjun Gadhia Date: Tue, 2 Oct 2018 14:19:37 +0100 Subject: [PATCH] =?UTF-8?q?Rename=20getSeleniumGrid=20=3D>=20getBrowsersta?= =?UTF-8?q?ckConfig=20=20=F0=9F=90=BF=20v2.10.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{get-selenium-grid.js => get-browserstack-config.js} | 0 lib/smoke/screenshot.js | 6 +++--- lib/smoke/smoke-test.js | 6 +++--- lib/smoke/webdriver-page.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename lib/smoke/{get-selenium-grid.js => get-browserstack-config.js} (100%) diff --git a/lib/smoke/get-selenium-grid.js b/lib/smoke/get-browserstack-config.js similarity index 100% rename from lib/smoke/get-selenium-grid.js rename to lib/smoke/get-browserstack-config.js diff --git a/lib/smoke/screenshot.js b/lib/smoke/screenshot.js index 9f2b8ce..b6773e0 100644 --- a/lib/smoke/screenshot.js +++ b/lib/smoke/screenshot.js @@ -8,7 +8,7 @@ const filterConfigs = require('./filter-configs'); const setupPage = require('./setup-page'); const PuppeteerPage = require('./puppeteer-page'); const WebdriverPage = require('./webdriver-page'); -const getSeleniumGrid = require('./get-selenium-grid'); +const getBrowserstackConfig = require('./get-browserstack-config'); const takeScreenshot = (pageOpts, browser, headlessBrowser, viewingBrowser) => async () => { const pageInstance = browser === 'chrome' ? new PuppeteerPage(pageOpts) : new WebdriverPage(pageOpts, browser); @@ -59,7 +59,7 @@ module.exports = async (globalOpts, sets) => { Object.keys(suiteOpts.urls).forEach(async (path) => { let urlOpts = suiteOpts.urls[path]; const pageOpts = setupPage(path, urlOpts, Object.assign({ browsers: true }, suiteOpts), globalOpts); - const canRunCrossBrowser = await getSeleniumGrid(this.enabledBrowsers); + const canRunCrossBrowser = await getBrowserstackConfig(this.enabledBrowsers); if(pageOpts.browsersToRun.filter(browser => browser.toLowerCase() !== 'chrome').length && !canRunCrossBrowser) { console.warn('Please set environment variables for Browserstack to run cross browser tests.'); return; @@ -81,7 +81,7 @@ module.exports = async (globalOpts, sets) => { const cleanup = async (code) => { viewingBrowser && viewingBrowser.close(); headlessBrowser && headlessBrowser.close(); - await getSeleniumGrid.cleanup(); + await getBrowserstackConfig.cleanup(); process.exit(code); }; diff --git a/lib/smoke/smoke-test.js b/lib/smoke/smoke-test.js index 27338d9..b48afec 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -12,7 +12,7 @@ const setupPage = require('./setup-page'); const verifyUrl =require('./verify-url'); const PuppeteerPage = require('./puppeteer-page'); const WebdriverPage = require('./webdriver-page'); -const getSeleniumGrid = require('./get-selenium-grid'); +const getBrowserstackConfig = require('./get-browserstack-config'); const ERROR_THRESHOLD=2; @@ -49,12 +49,12 @@ class SmokeTest { async cleanup () { this.browser && this.browser.close(); - return await getSeleniumGrid.cleanup(); + return await getBrowserstackConfig.cleanup(); } async compileTests (sets) { const configsToRun = await filterConfigs(this.configFile, sets, this.isInteractive); - const canRunCrossBrowser = await getSeleniumGrid(this.enabledBrowsers); + const canRunCrossBrowser = await getBrowserstackConfig(this.enabledBrowsers); const globalOptions = { headers: this.globalHeaders, browsers: this.browsers, diff --git a/lib/smoke/webdriver-page.js b/lib/smoke/webdriver-page.js index 9559fa0..1f7c7a7 100644 --- a/lib/smoke/webdriver-page.js +++ b/lib/smoke/webdriver-page.js @@ -1,5 +1,5 @@ const webdriverio = require('webdriverio'); -const getSeleniumGrid = require('./get-selenium-grid'); +const getBrowserstackConfig = require('./get-browserstack-config'); const DIMENSIONS = require('../helpers/dimensions'); @@ -26,7 +26,7 @@ class WebdriverPage { async init () { - this.browserOptions = await getSeleniumGrid(this.type, this.url.host.startsWith('local')); + this.browserOptions = await getBrowserstackConfig(this.type, this.url.host.startsWith('local')); if(!this.browserOptions || //skip if no environment variables this.isAutomatedTest && !(this.check.elements || this.check.screenshot)) { return;