Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: fix WebView2 tests (#30009)

Max Schmitt911fd204cf18
diff --git a/.github/workflows/tests_webview2.yml b/.github/workflows/tests_webview2.yml
index 425a7bbc8a..26c97f6062 100644
--- a/.github/workflows/tests_webview2.yml
+++ b/.github/workflows/tests_webview2.yml
@@ -38,6 +38,12 @@ jobs:
- run: npm run build
- run: dotnet build
working-directory: tests/webview2/webview2-app/
+ - name: Update to Evergreen WebView2 Runtime
+ shell: pwsh
+ run: |
+ # See here: https://developer.microsoft.com/en-us/microsoft-edge/webview2/
+ Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/p/?LinkId=2124703' -OutFile 'setup.exe'
+ Start-Process -FilePath setup.exe -Verb RunAs -Wait
- run: npm run webview2test
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always()
diff --git a/tests/webview2/globalSetup.ts b/tests/webview2/globalSetup.ts
index 7d8a340d9c..030a10401e 100644
--- a/tests/webview2/globalSetup.ts
+++ b/tests/webview2/globalSetup.ts
@@ -31,6 +31,7 @@ export default async () => {
resolve();
}));
const browser = await playwright.chromium.connectOverCDP(`http://127.0.0.1:${cdpPort}`);
+ console.log(`Using version ${browser.version()} WebView2 runtime`);
const page = browser.contexts()[0].pages()[0];
await page.goto('data:text/html,');
const chromeVersion = await page.evaluate(() => navigator.userAgent.match(/Chrome\/(.*?) /)[1]);