From 911fd204cf18aaca4d09a4018755dc7dc6d4a03d Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 19 Mar 2024 23:18:20 +0100 Subject: [PATCH] devops: fix WebView2 tests (#30009) Turns out we were using version 119.0.2151.58 before where the tests are failing. After this change we are using 122.0.2365.92. Fixes https://github.com/microsoft/playwright/issues/29695 Relates https://github.com/actions/runner-images/issues/9538 --- .github/workflows/tests_webview2.yml | 6 ++++++ tests/webview2/globalSetup.ts | 1 + 2 files changed, 7 insertions(+) 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]);