const {By, until, Key, Builder} = require("selenium-webdriver");
require("chromedriver");
const Options = require("selenium-webdriver/chrome").Options;
const {getUrl} = require('../libs/general/getUrl');
const profilePathApple =
"/Users/asdasdasdasd/Library/Application\\ Support/Google/Chrome/Profile\\ 16";
const profilePathWin = 'C:\\Users\\asdasd\\AppData\\Local\\Google\\Chrome\\Automated';
const profilePath = profilePathApple;
const appPath = "../../crx/asdasd.crx";
const appUrls = [
'https://adadasd.dev/',
'https://casdasdasd/teleport',
'chrome-extension://dmkamcknoasdasdasdsddcghachkejeap/popup.html'
];
let main = async (profile, extension) => {
let chromeOptions = new Options()
.addArguments(`user-data-dir=${profile}`)
.addArguments(`--lang=en`)
.addArguments(`--no-sandbox`)
.addArguments(`disable-infobars`)
.addArguments(`detach=false`)
.addArguments(`--disable-features=ChromeWhatsNewUI`)
.addArguments(`--disable-blink-features=AutomationControlled`)
.addArguments(`--start-maximized`)
.addArguments(`--disable-password-manager-reauthentication`)
.addExtensions(extension);
let driver = await new Builder()
.forBrowser("chrome")
.withCapabilities(chromeOptions)
.build();
await getUrl(appUrls[0]);
}
main(profilePath, appPath);
exports.main.driver = main.driver;