Skip to content

Commit

Permalink
Rename getSeleniumGrid => getBrowserstackConfig
Browse files Browse the repository at this point in the history
 🐿 v2.10.3
  • Loading branch information
adgad committed Oct 2, 2018
1 parent 83d1066 commit 47506f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions lib/smoke/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);
};

Expand Down
6 changes: 3 additions & 3 deletions lib/smoke/smoke-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/smoke/webdriver-page.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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;
Expand Down

0 comments on commit 47506f1

Please sign in to comment.