Paste #264431

   
pasted on 25.08.2022 15:25
  • Edit to this paste
  • Print
  • Raw
  • Compare with paste
    #  
  • Toggle line numbers
  • Syntax highlighting  
Text paste
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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;
Add Comment
Author