# BlueSky Playwright .NET Setup
Clear-Host
Write-Host "=============================================" -ForegroundColor Cyan
Write-Host " BlueSky Playwright .NET Environment Setup" -ForegroundColor Cyan
Write-Host "=============================================" -ForegroundColor Cyan
function Wait-Step {
Write-Host ""
Read-Host "Press ENTER to continue"
Write-Host ""
}
Write-Host "STEP 1 - Checking PowerShell version..." -ForegroundColor Yellow
$PSVersionTable
Wait-Step
Write-Host "STEP 2 - Installing Visual Studio Code..." -ForegroundColor Yellow
winget install --id Microsoft.VisualStudioCode -e
Wait-Step
Write-Host "STEP 3 - Verifying VS Code installation..." -ForegroundColor Yellow
code --version
Wait-Step
Write-Host "STEP 4 - Creating project folders..." -ForegroundColor Yellow
Set-Location C:\
if (!(Test-Path "C:\blueskycitadel01")) {
New-Item -ItemType Directory -Path "C:\blueskycitadel01" | Out-Null
}
Set-Location "C:\blueskycitadel01"
if (!(Test-Path "testautomation")) {
New-Item -ItemType Directory -Name "testautomation" | Out-Null
}
Set-Location "testautomation"
Write-Host "Current folder: $(Get-Location)"
Wait-Step
Write-Host "STEP 5 - Creating NUnit Playwright project..." -ForegroundColor Yellow
dotnet new nunit -n PlaywrightTests
Wait-Step
Set-Location ".\PlaywrightTests"
Write-Host "STEP 6 - Installing Microsoft.Playwright.NUnit..." -ForegroundColor Yellow
dotnet add package Microsoft.Playwright.NUnit
Wait-Step
Write-Host "STEP 7 - Building project..." -ForegroundColor Yellow
dotnet build
Wait-Step
Write-Host "STEP 8 - Locating build output..." -ForegroundColor Yellow
Set-Location ".\bin\Debug"
$framework = Get-ChildItem -Directory | Where-Object {$_.Name -like "net*"} | Select-Object -First 1
if ($framework) {
Set-Location $framework.FullName
Write-Host "Framework folder found: $($framework.Name)" -ForegroundColor Green
} else {
Write-Host "No framework folder found." -ForegroundColor Red
exit
}
Wait-Step
Write-Host "STEP 9 - Installing Playwright browsers..." -ForegroundColor Yellow
pwsh .\playwright.ps1 install
Wait-Step
Write-Host "STEP 10 - Open Code Gen to record test browsers..." -ForegroundColor Yellow
pwsh .\playwright.ps1 codegen
Wait-Step
Write-Host "=============================================" -ForegroundColor Green
Read-Host "Press ENTER to exit"
Write-Host ""
Write-Host "=============================================" -ForegroundColor Green
Write-Host " Playwright setup completed successfully!" -ForegroundColor Green
Write-Host "=============================================" -ForegroundColor Green
Read-Host "Press ENTER to exit"