test(BRIDGE-136): Download Bridge

This commit is contained in:
Gjorgji Slamkov
2025-08-15 09:25:10 +02:00
committed by Gordana Zafirova
parent cf9b35163a
commit fd709b0d08
21 changed files with 697 additions and 130 deletions

View File

@ -0,0 +1,45 @@
# Download the Bridge installer, and install it
# Set variables with Bridge's download link and the download path
# to be used later on
$bridgeDownloadURL = $env:BRIDGE_DOWNLOAD_URL
$bridgeDownloadPath = "$env:CI_PROJECT_DIR/tests/e2e/ui_tests/windows_os/InstallerScripts/Bridge-Installer.exe"
# Write the download link of Bridge to use it if manual re-tests are needed
Write-Output $bridgeDownloadURL
# Download the Bridge-Installer.exe file
Invoke-WebRequest -Uri $bridgeDownloadURL -OutFile $bridgeDownloadPath
if (Test-Path -Path $bridgeDownloadPath) {
Write-Output "Bridge Installer downloaded."
$file = Get-Item $bridgeDownloadPath | Select-Object Name, Length
$size = $file.Length
$sizeMB = "{0:N2}" -f ($size / 1MB)
Write-Output "File size in MB: $sizeMB"
} else {
Write-Output "Bridge installer NOT DOWNLOADED"
}
# Install the downloaded Bridge-Installer.exe file
# The installer is passive, meaning no user interaction is needed
# If the user does not have admin rights, it will still show the UAC prompt
# where a user needs to click on "Yes",
# but this will be not needed since the image in the pipeline will be an
# Admin account
# Argument list for passive install
# $argList = "/passive INSTALLSHORTCUT=yes INSTALLDESKTOPSHORTCUT=yes"
# Install Bridge
$process = Start-Process -Wait -ArgumentList "/passive INSTALLSHORTCUT=yes INSTALLDESKTOPSHORTCUT=yes" -PassThru -FilePath $bridgeDownloadPath
# Check exit code of the installation process to confirm installation
if ($process.ExitCode -eq "0") {
Write-Output "Bridge installed successfully"
} else {
Write-Error "Bridge not installed successfully!"
Write-Error "Installer Exit Code: $($process.ExitCode)"
}
# Delete the installer after installation to clean up the space
Remove-Item -Path $bridgeDownloadPath