2019-01-30 15:47:03 +00:00
|
|
|
require("chromedriver");
|
|
|
|
import chrome from 'selenium-webdriver/chrome';
|
|
|
|
import SeleniumWebdriver from "selenium-webdriver";
|
|
|
|
|
|
|
|
export default function() {
|
2019-02-04 22:23:59 +00:00
|
|
|
let options = new chrome.Options();
|
|
|
|
|
|
|
|
if (process.env['HEADLESS'] == 'y') {
|
|
|
|
options = options.headless();
|
|
|
|
}
|
2019-01-30 15:47:03 +00:00
|
|
|
|
|
|
|
beforeEach(function() {
|
|
|
|
const driver = new SeleniumWebdriver.Builder()
|
|
|
|
.forBrowser("chrome")
|
2019-02-04 22:23:59 +00:00
|
|
|
.setChromeOptions(options)
|
2019-01-30 15:47:03 +00:00
|
|
|
.build();
|
|
|
|
this.driver = driver;
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(function() {
|
|
|
|
this.driver.quit();
|
|
|
|
});
|
|
|
|
}
|