Skip to content

Commit 74e31a9

Browse files
committed
ci: install matching EdgeDriver for Windows E2E
The windows-latest runner image can have a msedgedriver version that doesn't match the installed Edge browser. Dynamically download the EdgeDriver matching the installed Edge version to prevent "session not created" failures. Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent fad63f7 commit 74e31a9

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/e2e-desktop.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ jobs:
127127
xvfb-run --auto-servernum pnpm test:e2e
128128
'
129129
130+
- name: Install matching EdgeDriver (Windows)
131+
if: matrix.os == 'windows-latest'
132+
shell: pwsh
133+
run: |
134+
$edgePath = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
135+
if (-not (Test-Path $edgePath)) { $edgePath = "C:\Program Files\Microsoft\Edge\Application\msedge.exe" }
136+
$edgeVersion = (Get-Item $edgePath).VersionInfo.ProductVersion
137+
Write-Host "Edge version: $edgeVersion"
138+
$driverUrl = "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/$edgeVersion/edgedriver_win64.zip"
139+
$zipPath = "$env:TEMP\edgedriver.zip"
140+
$extractDir = "$env:TEMP\edgedriver"
141+
Invoke-WebRequest -Uri $driverUrl -OutFile $zipPath
142+
Expand-Archive -Path $zipPath -DestinationPath $extractDir -Force
143+
$driverDir = "$extractDir\edgedriver_win64"
144+
if (-not (Test-Path "$driverDir\msedgedriver.exe")) { $driverDir = $extractDir }
145+
Write-Host "EdgeDriver path: $driverDir"
146+
echo "$driverDir" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH
147+
130148
- name: Run desktop E2E tests (Windows)
131149
if: matrix.os == 'windows-latest'
132150
run: pnpm test:e2e

0 commit comments

Comments
 (0)