Windows Klaatu Tests #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow that is manually triggered | |
name: Windows Klaatu Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Experiment Branch' | |
default: 'control' | |
required: true | |
type: string | |
slug: | |
description: 'Experiment Slug' | |
default: 'an-awesome-experiment' | |
required: true | |
type: string | |
user-facing-name: | |
description: 'The user facing name' | |
default: "An Awesome Experiment" | |
required: false | |
type: string | |
env: | |
MOZ_HEADLESS: 1 | |
jobs: | |
klaatu-tests: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
firefox: ['latest-beta', 'latest-nightly', 'latest' ] | |
name: windows-klaatu-firefox-${{ matrix.firefox }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup firefox | |
id: setup-firefox | |
uses: ./.github/actions/setup_firefox/ | |
with: | |
firefox-version: ${{ matrix.firefox }} | |
- run: | | |
echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install Chocolatey | |
shell: pwsh | |
run: Set-ExecutionPolicy Bypass -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | |
- name: Install Dependencies | |
shell: pwsh | |
run: choco install jdk8 selenium selenium-gecko-driver | |
- name: Uninstall default Firefox | |
shell: pwsh | |
run: | | |
$firefoxKey = Get-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' | Where-Object { $_.DisplayName -eq 'Mozilla Firefox' } | |
if ($firefoxKey) { | |
$uninstallString = $firefoxKey.UninstallString | |
if ($uninstallString) { | |
$uninstallString = $uninstallString -replace '\/I','\/X' # Change /I to /X to uninstall | |
Write-Host "Uninstalling Mozilla Firefox..." | |
$uninstallString = $uninstallString.Trim() # Trim extra spaces | |
Start-Process -FilePath "cmd.exe" -ArgumentList "/c $uninstallString /S" -Wait | |
Write-Host "Mozilla Firefox has been uninstalled." | |
} else { | |
Write-Host "Uninstall string not found." | |
exit 1 | |
} | |
} else { | |
Write-Host "Mozilla Firefox is not installed." | |
exit 1 | |
} | |
- name: Setup tests | |
shell: bash | |
run: ./setup_script.sh | |
- name: Run Tests | |
run: tox -e bdd-tests -- --experiment-branch ${{ inputs.branch }} --experiment-slug ${{ inputs.slug }} --private-browsing-enabled |