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
This commit is contained in:
Max Schmitt 2024-03-19 23:18:20 +01:00 committed by GitHub
parent 0a22a86e2e
commit 911fd204cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -38,6 +38,12 @@ jobs:
- run: npm run build - run: npm run build
- run: dotnet build - run: dotnet build
working-directory: tests/webview2/webview2-app/ 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: npm run webview2test
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always() if: always()

View file

@ -31,6 +31,7 @@ export default async () => {
resolve(); resolve();
})); }));
const browser = await playwright.chromium.connectOverCDP(`http://127.0.0.1:${cdpPort}`); 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]; const page = browser.contexts()[0].pages()[0];
await page.goto('data:text/html,'); await page.goto('data:text/html,');
const chromeVersion = await page.evaluate(() => navigator.userAgent.match(/Chrome\/(.*?) /)[1]); const chromeVersion = await page.evaluate(() => navigator.userAgent.match(/Chrome\/(.*?) /)[1]);