Skip to content

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

feat: do not rely on chocolatey to install Google Chrome Beta (#6735)

Andrey Lushnikovc60974d92273
diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.yml
index a7d75ec332..c677a73b5b 100644
--- a/.github/workflows/tests_secondary.yml
+++ b/.github/workflows/tests_secondary.yml
@@ -476,13 +476,12 @@ jobs:
name: "Chrome Beta (Win)"
runs-on: windows-latest
steps:
+ - uses: actions/checkout@v2
+ - name: Install Chrome Beta
+ run: pwsh -command ".\$GITHUB_WORKSPACE\utils\install-chrome-beta\reinstall_win.ps1"
- name: Install Media Pack
shell: powershell
run: Install-WindowsFeature Server-Media-Foundation
- - name: Install Chrome Beta
- shell: powershell
- run: choco install -y googlechromebeta --pre --force
- - uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
diff --git a/utils/install-chrome-beta/reinstall_win.ps1 b/utils/install-chrome-beta/reinstall_win.ps1
new file mode 100644
index 0000000000..e3aaafbcc3
--- /dev/null
+++ b/utils/install-chrome-beta/reinstall_win.ps1
@@ -0,0 +1,20 @@
+$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise.msi';
+
+if ([Environment]::Is64BitProcess) {
+ $url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi'
+}
+
+$app = Get-WmiObject -Class Win32_Product | Where-Object {
+ $_.Name -match "Google Chrome Beta"
+}
+if ($app) {
+ $app.Uninstall()
+}
+
+$wc = New-Object net.webclient
+$msiInstaller = "$env:temp\google-chrome-beta.msi"
+Remove-Item $msiInstaller
+$wc.Downloadfile($url, $msiInstaller)
+
+$arguments = "/i `"$msiInstaller`" /quiet"
+Start-Process msiexec.exe -ArgumentList $arguments -Wait