├── .github/workflows/
│ └── playwright.yml # GitHub Actions workflow with dynamic test config
├── env/
│ └── .env.qa1 # Environment-specific config
├── global/
│ ├── setup.ts # Global setup for context and metadata
│ ├── teardown.ts # Global teardown to enrich test results
├── pages/
│ ├── BasePage.ts # Base class with reusable Playwright actions
│ └── LoginPage.ts # Page Object Model (POM) for Login page
├── playwright-report/ # Allure and JSON report outputs
├── tests/
│ ├── testsetup.ts # Custom test hooks with logger integration
│ └── ui/
│ └── login.spec.ts # Sample test for login validation
├── utils/
│ ├── allureHelper.ts # Helper for tagging tests in Allure
│ ├── config.ts # Typed environment config reader
│ ├── loadEnv.ts # Dynamic .env loader by TEST_ENV
│ └── logger.ts # Winston logger
├── Dockerfile.playwright # Multi-stage Dockerfile with Java + Allure setup
├── package.json
├── playwright.config.ts # Main test runner config
└── run-with-params.sh # Shell script for running tests with dynamic env
- Playwright for browser automation
- TypeScript for type safety and maintainability
- Allure Reporter for rich test visualization
- Docker to encapsulate execution
- GitHub Actions for CI/CD with test param flexibility
-
Configures base test settings, retries, reporters, and project runners.
-
Includes:
- Global hooks (
globalSetup,globalTeardown) jsonreporter for enriching data in teardown- Allure and HTML reports
- Global hooks (
- Loads environment from
.env.{env}usingloadEnv.ts - Initializes metadata like testRunId, startTime
- Writes
test-run-context.json
-
Parses
test-results.json -
Enhances each test case with:
- Duration, tags, retry count
- Failure message + stack trace if applicable
- History stub fields (e.g., flaky count, last failed)
-
Merges data into
enriched-test-results.json
- Adds
beforeEachandafterEachlogging using Winston - Replaces Playwright's default test
-
Multi-stage:
- Stage 1 installs deps and caches builds
- Stage 2 copies node_modules, env, and source
-
Includes Java and Allure CLI for reporting
- Supports inputs:
tag,browser,workers,retries,test_env - Uses
run-with-params.shinside container - Publishes Allure report to GitHub Pages
-
Customizes:
URL=https://saucedemo.comUSERNAME,PASSWORD
- Loads env vars with type safety
- Validates missing values early
- Uses Winston logger with ISO timestamps
- Dynamically runs Playwright with flags like:
npx playwright test \
--project="$BROWSER" \
--workers="$WORKERS" \
--retries="$RETRIES" \
$TAG- 🔍 Store enriched JSON to DynamoDB/Postgres
- 📊 Build custom dashboards from enriched test result metadata
- 📤 Slack/GitHub notification integration
- 🤖 Integrate GPT-based RCA suggestions per failure
- 🔄 Automatic test rerun for flaky failures
TEST_ENV=qa1 npx playwright test(local)docker build -t my-playwright-runner .docker run --rm -e TEST_ENV=qa1 my-playwright-runner- CI: Trigger via GitHub Actions with tag and env
Maintained by @ramjangatisetty with ❤️ for the testing community.