This commit is contained in:
Nathan Bierema 2021-10-21 09:53:49 -04:00
parent 503aa58eb0
commit 8b32405da2
2 changed files with 11 additions and 16 deletions

View File

@ -1,5 +1,6 @@
import { resolve } from 'path';
import webdriver from 'selenium-webdriver';
import chrome from 'selenium-webdriver/chrome';
import chromedriver from 'chromedriver';
import { switchMonitorTests, delay } from '../utils/e2e';
@ -17,11 +18,9 @@ describe('Chrome extension', function () {
await delay(2000);
driver = new webdriver.Builder()
.usingServer(`http://localhost:${port}`)
.withCapabilities({
chromeOptions: {
args: [`load-extension=${path}`],
},
})
.setChromeOptions(
new chrome.Options().addArguments(`load-extension=${path}`)
)
.forBrowser('chrome')
.build();
});
@ -72,7 +71,6 @@ describe('Chrome extension', function () {
await driver.switchTo().window(tabs[1]);
expect(await driver.getCurrentUrl()).toMatch(url);
await driver.manage().timeouts().pageLoadTimeout(5000);
await driver.switchTo().window(tabs[0]);

View File

@ -1,5 +1,6 @@
import { join } from 'path';
import webdriver from 'selenium-webdriver';
import chrome from 'selenium-webdriver/chrome';
import electronPath from 'electron';
import chromedriver from 'chromedriver';
import { switchMonitorTests, delay } from '../utils/e2e';
@ -16,15 +17,13 @@ describe('DevTools panel for Electron', function () {
await delay(1000);
driver = new webdriver.Builder()
.usingServer(`http://localhost:${port}`)
.withCapabilities({
chromeOptions: {
binary: electronPath,
args: [`app=${join(__dirname, 'fixture')}`],
},
})
.forBrowser('electron')
.setChromeOptions(
new chrome.Options()
.setChromeBinaryPath(electronPath)
.addArguments(`app=${join(__dirname, 'fixture')}`)
)
.forBrowser('chrome')
.build();
await driver.manage().timeouts().setScriptTimeout(10000);
});
afterAll(async () => {
@ -48,8 +47,6 @@ describe('DevTools panel for Electron', function () {
/devtools:\/\/devtools\/bundled\/devtools_app.html/
);
await driver.manage().timeouts().pageLoadTimeout(5000);
const id = await driver.executeAsyncScript(function (callback) {
let attempts = 5;
function showReduxPanel() {