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