Skip to content

Commit

Permalink
Fix chromedriver issues (#1548)
Browse files Browse the repository at this point in the history
* Test removing chromedriver

* Remove port

* Try removing it altogether

* Alright, try that

* Attempt to run xvfb directly

* Halfway happy?
  • Loading branch information
Methuselah96 authored Dec 8, 2023
1 parent 8979004 commit a7d612f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"jest-environment-jsdom": "^29.7.0",
"pug": "^3.0.2",
"rimraf": "^5.0.5",
"selenium-webdriver": "^4.15.0",
"selenium-webdriver": "^4.16.0",
"sinon-chrome": "^3.0.1",
"ts-jest": "^29.1.1",
"typescript": "~5.2.2",
Expand Down
12 changes: 4 additions & 8 deletions extension/test/chrome/extension.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
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';

const port = 9515;
const path = resolve(__dirname, '..', '..', 'dist');
const extensionId = 'lmhkpmbekcpmknklioeibfkpmmfibljd';
const actionsPattern =
Expand All @@ -14,20 +12,18 @@ describe('Chrome extension', function () {
let driver;

beforeAll(async () => {
chromedriver.start();
await delay(2000);
driver = new webdriver.Builder()
.usingServer(`http://localhost:${port}`)
.setChromeOptions(
new chrome.Options().addArguments(`load-extension=${path}`),
new chrome.Options()
.setBrowserVersion('stable')
.addArguments(`load-extension=${path}`),
)
.forBrowser('chrome')
.build();
});

afterAll(async () => {
await driver.quit();
chromedriver.stop();
});

it("should open extension's window", async () => {
Expand Down Expand Up @@ -63,7 +59,7 @@ describe('Chrome extension', function () {
);

it('should get actions list', async () => {
const url = 'http://zalmoxisus.github.io/examples/router/';
const url = 'https://zalmoxisus.github.io/examples/router/';
await driver.executeScript(`window.open('${url}')`);
await delay(2000);

Expand Down
3 changes: 1 addition & 2 deletions extension/test/electron/devpanel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import electronPath from 'electron';
import chromedriver from 'chromedriver';
import { switchMonitorTests, delay } from '../utils/e2e';

const port = 9515;
const devPanelPath =
'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/window.html';

Expand All @@ -16,7 +15,7 @@ describe('DevTools panel for Electron', function () {
chromedriver.start();
await delay(1000);
driver = new webdriver.Builder()
.usingServer(`http://localhost:${port}`)
.usingServer('http://localhost:9515')
.setChromeOptions(
new chrome.Options()
.setChromeBinaryPath(electronPath)
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7d612f

Please sign in to comment.