This repository contains a comprehensive Playwright automation suite using TypeScript, covering UI, API, and Mobile Emulation testing.
npx playwright testnpx playwright test tests/Basic_UI_Tests.spec.tsnpx playwright test --grep @SmokeTestingnpx playwright test --headednpx playwright show-reportdocker build -t playwright-suite .docker run -it --rm playwright-suitedocker run -it --rm playwright-suite npx playwright test tests/API_Testing.spec.tsThe test suite covers several web applications and API platforms for real-world scenarios:
- Demoblaze: Primary e-commerce site for UI, POM, and Cart workflows.
- AutomationExercise: Used for complex web interactions like dropdowns, checkboxes, and radio buttons.
- The Internet HerokuApp: Used for Iframes and Drag-and-Drop tests.
- Restful-Booker: Used for full API automation (CRUD operations).
- Playwright API Mocking Demo: Used for request/response mocking.
- Page Object Model (POM): Organized and maintainable page classes.
- Custom Fixtures: Enhanced Playwright's base test with custom page objects and data loaders.
- Data-Driven Testing (DDT): Running tests against external data sources:
- JSON: Simple and integrated data management.
- CSV: Scalable data handling using
csv-parse. - Excel: Enterprise-level data management using
xlsx.
- API Automation: Full lifecycle testing (GET, POST, PUT, PATCH, DELETE) with authentication tokens.
- Mocking & Interception: Mocking API requests, responses, and using HAR files.
- Advanced Actions: Handling Iframes, Alerts, Keyboard actions, Mouse hovers, and Drag-and-Drop.
- Test Management: Using Tags (
@SmokeTesting,@RegressionTesting), Annotations (test.skip,test.fail), and Serial mode. - Reporting & Screenshots: Visual testing with snapshots and automatic artifact generation.
tests/: Consolidated test suites:Basic_UI_Tests.spec.ts: Core UI interactions and assertions.Test_Management.spec.ts: Annotations, tags, grouping, and browser context.Advanced_Framework.spec.ts: POM, Fixtures, and Data-driven tests.API_Testing.spec.ts: Extensive API automation and Mocking.
src/: Core framework components (Pages, Fixtures, Utils, Interfaces).test-data/: Static and dynamic data files for UI and API tests.
Based on the Playwright TypeScript Full Course by Deepak Kumar.
