diff --git a/.github/workflows/ci-tests-e2e-cloud.yaml b/.github/workflows/ci-tests-e2e-cloud.yaml new file mode 100644 index 000000000..1f8152b74 --- /dev/null +++ b/.github/workflows/ci-tests-e2e-cloud.yaml @@ -0,0 +1,52 @@ +name: "CI: Tests E2E Cloud" +description: "Cloud E2E testing with Playwright against stagingcloud.comfy.org" + +on: + workflow_dispatch: # Manual trigger for now + # Uncomment to enable on push/PR: + # push: + # branches: [cloud/*, main] + # pull_request: + # branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + playwright-tests-cloud: + runs-on: ubuntu-latest + timeout-minutes: 20 + permissions: + contents: read + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup frontend + uses: ./.github/actions/setup-frontend + with: + include_build_step: false # Cloud tests don't need build + + - name: Setup Playwright + uses: ./.github/actions/setup-playwright + + - name: Run Playwright cloud tests + id: playwright + env: + CLOUD_TEST_EMAIL: ${{ secrets.CLOUD_TEST_EMAIL }} + CLOUD_TEST_PASSWORD: ${{ secrets.CLOUD_TEST_PASSWORD }} + run: | + PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \ + pnpm exec playwright test --config=playwright.cloud.config.ts \ + --reporter=list \ + --reporter=html \ + --reporter=json + + - name: Upload Playwright report + uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report-cloud + path: ./playwright-report/ + retention-days: 30 diff --git a/browser_tests/tests/CLOUD_TESTS.md b/browser_tests/tests/CLOUD_TESTS.md new file mode 100644 index 000000000..a48f4504f --- /dev/null +++ b/browser_tests/tests/CLOUD_TESTS.md @@ -0,0 +1,36 @@ +# Cloud E2E Tests + +## Setup + +Cloud tests run against `https://stagingcloud.comfy.org` with Firebase authentication. + +### Required GitHub Secrets + +Add these to repository settings → Secrets → Actions: + +- `CLOUD_TEST_EMAIL`: Firebase test account email +- `CLOUD_TEST_PASSWORD`: Firebase test account password + +### Running Locally + +```bash +# Set environment variables +export CLOUD_TEST_EMAIL="your-test-email@example.com" +export CLOUD_TEST_PASSWORD="your-password" + +# Run cloud tests +pnpm exec playwright test --config=playwright.cloud.config.ts +``` + +### Running in CI + +Workflow: `.github/workflows/ci-tests-e2e-cloud.yaml` + +Trigger manually via Actions tab → "CI: Tests E2E Cloud" → Run workflow + +### Test Structure + +- Tests tagged with `@cloud` run only in cloud config +- Auth handled once in `globalSetupCloud.ts` +- Auth state saved to `browser_tests/.auth/cloudUser.json` +- Cloud fixture in `fixtures/ComfyPageCloud.ts`