The `simple-playwright-framework` (current version 0.0.33) is a lightweight and modular TypeScript-based automation framework built on Microsoft Playwright. It aims to accelerate the setup of scalable UI and API test automation projects by providing a clean architecture, reusable fixtures, and streamlined onboarding processes. Key features include custom Playwright fixtures for authentication and state management, a `scenarioLoader` for environment-driven test data (supporting JSON, API, or DB integration), and a flexible provider registry for various authentication flows. It supports environment-aware configuration, offers reusable helpers for common test scenarios, and integrates with modern reporting tools like Playwright HTML, Allure, and TestRail. The framework also includes a CLI scaffolding tool (`npx init-demo-project`) to generate demo projects with recommended structures, promoting CI/CD readiness through parallel safety and isolated test states. Given its pre-1.0 version, the release cadence is likely agile, with frequent updates that may include API adjustments.
npm install simple-playwright-frameworkVerified import paths — ran on the pinned version, not inferred.
Demonstrates the initial setup by installing dependencies, scaffolding a new project using the CLI, navigating into it, and then running the generated example Playwright tests using the framework's `scenarioLoader`.
Ensure your `tsconfig.json` and build tools correctly resolve modules from `simple-playwright-framework`. Check the latest documentation or scaffold a new project (`npx init-demo-project`) to see the correct import paths and configurations.
Always refer to the framework's documentation and the generated `playwright.config.ts` from the `init-demo-project` CLI for how to properly extend Playwright's base `test` object and import framework utilities.
Exercise caution when upgrading. Review release notes carefully for any breaking changes and pin exact versions in `package.json` for critical projects. Perform thorough regression testing after any update.
Ensure all necessary test state is initialized within individual tests or `beforeEach` hooks provided by Playwright, avoiding mutable global variables or shared resources that are not properly isolated for parallel execution.
Run `npm install simple-playwright-framework`. Verify your `tsconfig.json`'s `moduleResolution` and `baseUrl`/`paths` settings are compatible with an ESM-first package. If using CommonJS, ensure you are using dynamic `import()` or configuring your build tools for ESM compatibility.
Ensure you are using the correct ESM import syntax: `import { scenarioLoader } from 'simple-playwright-framework';`. Avoid CommonJS `require` statements directly. Verify the package is installed and at a version that exports `scenarioLoader`.After scaffolding, navigate into the generated `demo-project` directory (e.g., `cd demo-project`). Confirm that your `playwright.config.ts` has a `testMatch` property that correctly identifies your test files (e.g., `testMatch: '**/*.spec.ts'`).