Skip to content

Commit

Permalink
Set the chromedriver path explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad-PH committed Jun 8, 2024
1 parent a4ec435 commit c8aa131
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/e2e/seleniumTests.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { WebDriver, Builder, Key, By } = require('selenium-webdriver');
const { expect, test, describe } = require('@jest/globals');
const chromedriver = require('chromedriver');
const express = require('express');
const path = require('path');
const data = require('./data.js');
Expand Down Expand Up @@ -51,10 +52,13 @@ describe('Selenium UI Tests', () => {
const loggingPrefs = new logging.Preferences();
loggingPrefs.setLevel(logging.Type.BROWSER, logging.Level.ALL);

let chromeService = new chrome.ServiceBuilder(chromedriver.path);

driver = await new Builder()
.forBrowser('chrome')
.setChromeOptions(chromeOptions)
.setLoggingPrefs(loggingPrefs)
.setChromeService(chromeService)
.build();

driverUtils = new DriverUtils(driver);
Expand Down Expand Up @@ -107,7 +111,9 @@ describe('Selenium UI Tests', () => {
}
}

afterEach(tearDown);
afterEach(() => {
return tearDown();
});

// Make tests interrupt-friendly:
process.on('SIGINT', tearDown);
Expand Down

0 comments on commit c8aa131

Please sign in to comment.