-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (27 loc) · 845 Bytes
/
index.js
File metadata and controls
34 lines (27 loc) · 845 Bytes
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
'use strict';
const Path = require('path');
const Fs = require('fs');
require('chromedriver');
const Webdriver = require('selenium-webdriver');
const [By, until] = [Webdriver.By, Webdriver.until];
const extPath = Path.join(__dirname, './extension');
const chromeCapabilities = Webdriver.Capabilities.chrome();
chromeCapabilities.set('chromeOptions', {
'args': [
`--binary=/usr/bin/google-chrome-unstable`,
`--load-extension=${extPath}`,
'--js-flags=--expose-gc',
],
});
const driver = new Webdriver.Builder()
.forBrowser('chrome')
.withCapabilities(chromeCapabilities)
.build();
const extId = 'mejjkoaohhllibjejhochmagfabjfmle';
const benchUrl = `chrome-extension://${extId}/pages/bench/index.html`;
driver.get(benchUrl);
/*
driver.wait(until.alertIsPresent());
driver.switchTo().alert().accept();
driver.quit();
*/