Loading video player...
In this video, you’ll learn how to set up Continuous Integration (CI) for your Playwright automation tests using GitHub Actions. We start by fixing a common Git mistake, then connect a local Playwright project to GitHub, and finally create a CI pipeline that automatically runs tests on every commit. You’ll also learn how to: ✔ Initialize Git in the correct project folder ✔ Push your Playwright project to GitHub ✔ Create a GitHub Actions workflow file ✔ Run Playwright tests automatically in the cloud ✔ Execute tests on a specific browser (Chromium) ✔ Run a specific test file in CI for faster pipelines This setup is widely used in real-world automation projects and is an essential skill for QA engineers 🛠 Tech Used Playwright Git & GitHub GitHub Actions Node.js If this video helped you, like, share, and subscribe for more Playwright automation tutorials 🚀 New videos every week on Playwright, testing, and QA career growth! Playwright.yml file code: name: Playwright Tests on: push: branches: [ main ] pull_request: branches: [ main ] workflow_dispatch: # 👈 allows manual trigger with inputs inputs: testFile: description: 'Test file to run (e.g. tests/example.spec.ts)' required: false default: '' grep: description: 'Test title pattern (e.g. "should login")' required: false default: '' jobs: test: runs-on: windows-latest # 👈 using Windows runner steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependencies run: npm install - name: Install Playwright Browsers run: npx playwright install --with-deps - name: Run Playwright tests run: | $cmd = "npx playwright test example.spec.js --project=chromium" if ("${{ github.event.inputs.testFile }}" -ne "") { $cmd = "$cmd ${{ github.event.inputs.testFile }}" } if ("${{ github.event.inputs.grep }}" -ne "") { $cmd = "$cmd -g '${{ github.event.inputs.grep }}'" } echo "Running: $cmd" Invoke-Expression $cmd - name: Upload Playwright HTML Report if: always() uses: actions/upload-artifact@v4 with: name: playwright-report path: playwright-report/ retention-days: 7