2018-01-18 17:10:53 +01:00
|
|
|
require('chromedriver')
|
2018-05-14 15:30:50 +02:00
|
|
|
require('geckodriver')
|
2017-09-12 23:14:24 +02:00
|
|
|
const webdriver = require('selenium-webdriver')
|
|
|
|
|
|
|
|
exports.delay = function delay (time) {
|
|
|
|
return new Promise(resolve => setTimeout(resolve, time))
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-14 15:30:50 +02:00
|
|
|
exports.buildChromeWebDriver = function buildChromeWebDriver (extPath) {
|
2017-09-12 23:14:24 +02:00
|
|
|
return new webdriver.Builder()
|
|
|
|
.withCapabilities({
|
|
|
|
chromeOptions: {
|
|
|
|
args: [`load-extension=${extPath}`],
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.build()
|
|
|
|
}
|
2018-05-14 15:30:50 +02:00
|
|
|
|
|
|
|
exports.buildFirefoxWebdriver = function buildFirefoxWebdriver (extPath) {
|
|
|
|
return new webdriver.Builder().build()
|
|
|
|
}
|