diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..08b618b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + env: + # SauceDemo's password is public; injected here the same way a real CI secret would be. + TestSettings__Password: secret_sauce + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET 10 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration Release + + - name: Install Playwright browsers and OS dependencies + run: pwsh PlaywrightFramework.Tests/bin/Release/net10.0/playwright.ps1 install --with-deps chromium + + - name: Test + run: dotnet test --no-build --configuration Release --logger "trx;LogFileName=test-results.trx" + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results + path: '**/*.trx' diff --git a/README.md b/README.md index 137e92a..270eb5e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # playwright-dotnet-framework +[![CI](https://github.com/SnoxSoft/playwright-dotnet-framework/actions/workflows/ci.yml/badge.svg)](https://github.com/SnoxSoft/playwright-dotnet-framework/actions/workflows/ci.yml) + A small but production-shaped UI test-automation framework in **C# / .NET 10** with **Playwright** and **MSTest**. It shows how I structure a maintainable suite — page objects, component objects, isolated fixtures, layered configuration, and proper secret handling — rather than a flat pile of tests. System under test: [SauceDemo](https://www.saucedemo.com), a stable public demo shop chosen deliberately so the suite stays reliable and CI-green.