Skip to content

Commit 5ca902e

Browse files
committed
fix(e2e): install matching chromedriver for system Chrome on Linux CI
ubuntu-latest has Chrome 146 but no matching chromedriver exists for WDIO to auto-download. Use @puppeteer/browsers to install chromedriver matching the system Chrome major version, and pass the path to WDIO via wdio:chromedriverOptions. Keeps system Chrome for WebGL support.
1 parent f61610e commit 5ca902e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/e2e.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ jobs:
2626
- name: Install xvfb (linux)
2727
if: matrix.os == 'ubuntu-latest'
2828
run: sudo apt-get install xvfb
29+
- name: Install matching ChromeDriver (linux)
30+
if: matrix.os == 'ubuntu-latest'
31+
run: |
32+
CHROME_MAJOR=$(google-chrome --version | grep -oP '\d+' | head -1)
33+
npx @puppeteer/browsers install chromedriver@$CHROME_MAJOR
34+
echo "CHROMEDRIVER_PATH=$(find . -path "*/chromedriver-linux64/chromedriver" -type f | head -1)" >> $GITHUB_ENV
2935
- name: Run E2E on chrome (linux)
3036
if: matrix.os == 'ubuntu-latest'
3137
run: xvfb-run --server-args="-screen 0, 1400x1000x24" --auto-servernum npm run test:e2e:chrome

wdio.chrome.conf.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ if (process.env.CI || process.env.GITHUB_ACTIONS) {
66
chromeArgs.push(
77
'--no-sandbox',
88
'--disable-dev-shm-usage',
9-
'--disable-infobars',
10-
'--disable-gpu'
9+
'--disable-infobars'
1110
);
1211
}
1312

@@ -16,8 +15,12 @@ export const config = {
1615
capabilities: [
1716
{
1817
browserName: 'chrome',
19-
browserVersion: 'stable',
2018
// this overrides the default chrome download directory with our temporary one
19+
...(process.env.CHROMEDRIVER_PATH && {
20+
'wdio:chromedriverOptions': {
21+
binary: process.env.CHROMEDRIVER_PATH,
22+
},
23+
}),
2124
'goog:chromeOptions': {
2225
args: chromeArgs,
2326
prefs: {

0 commit comments

Comments
 (0)