A modern UI test automation framework built with Playwright for end-to-end testing.
Generate a Playwright test automation framework in TypeScript. The framework should include:
1. **Project Structure:**
* A `tests` directory for test files.
* A `pages` directory for Page Object Model (POM) files.
* A `fixtures` directory for custom test fixtures.
* A `utils` directory for helper functions.
* A `playwright.config.ts` file with basic configurations (e.g., browser setup for Chromium, Firefox, WebKit, headless mode, base URL, retries, reporting).
- Node.js (version 18 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/drcolburn/ui_test_automation_playwright.git
cd ui_test_automation_playwright
- Install dependencies:
npm install
- Install Playwright browsers:
npx playwright install
Run all tests:
npm test
Run tests in headed mode (see browser):
npm run test:headed
Run tests in debug mode:
npm run test:debug
Run tests in UI mode (interactive):
npm run test:ui
View test report:
npm run test:report
Tests are located in the tests/
directory. Example test structure:
import { test, expect } from '@playwright/test';
test.describe('Feature Name', () => {
test('test description', async ({ page }) => {
await page.goto('https://example.com');
// Your test code here
});
});
ui_test_automation_playwright/
├── tests/ # Test files
├── playwright.config.ts # Playwright configuration
├── package.json # Project dependencies and scripts
└── README.md # This file
The Playwright configuration is in playwright.config.ts
. You can customize:
- Test directory
- Browser settings
- Parallel execution
- Retry logic
- Reporting options
- And more...
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the ISC License.