Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daroshchanka/playwright-typescript-starter
Playwright typescript test automation project boilerplate including packages structure, reporting, logging, multi-env run configuration for WEB and API test automation.
https://github.com/daroshchanka/playwright-typescript-starter
api-automation-testing boilerplate playwright qa-automation test-automation test-automation-framework typescript web-automation-testing
Last synced: about 18 hours ago
JSON representation
Playwright typescript test automation project boilerplate including packages structure, reporting, logging, multi-env run configuration for WEB and API test automation.
- Host: GitHub
- URL: https://github.com/daroshchanka/playwright-typescript-starter
- Owner: daroshchanka
- License: mit
- Created: 2024-09-11T23:14:13.000Z (15 days ago)
- Default Branch: main
- Last Pushed: 2024-09-21T09:55:34.000Z (6 days ago)
- Last Synced: 2024-09-22T23:02:41.664Z (4 days ago)
- Topics: api-automation-testing, boilerplate, playwright, qa-automation, test-automation, test-automation-framework, typescript, web-automation-testing
- Language: TypeScript
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## playwright-typescript-starter
Test automation project boilerplate including packages structure, reporting, logging, multi-env run configuration for WEB and API test automation.
Pure Playwright APIs wrapped a little to add more logs/traceability to test execution and to make theirs usage less-verbose in tests.
Optionally Database and Email utils added as the example how the project can be extended.
### Project Structure
- `src/core` - project-agnostic code, common for any product/project to be automated
- `src/project` - project-specific base code, including objects and utils for the particular project (pageobjects for web, services for api, utils, datagenerators, etc.)
- `src/test` - project test specs, grouped by directories, components, etc. also test config definition is there (base urls, etc.)### Quick Start
Do 4 steps:
- `npm install` - install dependencies
- `npm run install-playwright` - install playwright browsers + dependencies
- `npm run health-check` - run `test/health-check.spec.ts` spec
- `npm run show-report-playwright` or `npm run show-report-allure` - show reportsExplore examples:
- WEB automation: `project/booking/`, `test/booking/`
- API automation: `project/httpbin/`, `test/httpbin/`
- HYBRID WEB+API spec: `test/hybrid-web-api.spec.ts`#### Multi-env configuration
In the examples `process.env.npm_config_ENV` variable used to figure out the proper test configs.
```
static instance: TestConfig = new TestConfig(process.env.npm_config_ENV == undefined ? 'dev' : process.env.npm_config_ENV);
```So, to switch env just provide `--ENV` in command-line.
- `npm run test-httpbin --ENV=dev`
- `npm run test-httpbin --ENV=stage`Unknown or missing env value will be mapped to `dev`.
#### Generate/Show Reports
- `npm run show-report-playwright` - Default playwright report
- `npm run show-report-allure` - Allure report (which is optional)### Other Implementations
- [playwright-groovy-starter](https://github.com/daroshchanka/playwright-groovy-starter)