var WebDriver = require('selenium-webdriver');

function runWebdriver() {
  var webdriver;
  if (process.env.REMOTE_SELENIUM_URL) {
    webdriver = new WebDriver.Builder()
      .forBrowser('chrome')
      .usingServer(process.env.REMOTE_SELENIUM_URL)
      .build();
  } else {
    webdriver = new WebDriver.Builder().forBrowser('chrome').build();
  }

  return webdriver;
}

module.exports = runWebdriver;

@@ -44,50 +44,364 @@
 ');%0A
-%0Afunction runWebdriver() %7B%0A  var webdriver
+var chromeCapabilities = WebDriver.Capabilities.chrome();%0A%0Afunction runWebdriver() %7B%0A  var webdriver;%0A  // Adding this should fix the weird CI failing issue%0A  // https://github.com/SeleniumHQ/selenium/issues/4961%0A  var chromeOptions = %7B%0A    args: %5B'--no-sandbox', '--headless', '--disable-gpu'%5D%0A  %7D;%0A  chromeCapabilities.set('chromeOptions', chromeOptions)
 ;%0A  
@@ -625,16 +625,67 @@
 uilder()
+%0A      .withCapabilities(chromeCapabilities)%0A      
 .forBrow
@@ -697,16 +697,23 @@
 chrome')
+%0A      
 .build()

fix issue with failing test in CI (#148)