A TypeScript-based Playwright project for learning and experimenting with browser automation. This repository includes tests for platforms like AliExpress and Amazon, with modular test organization and trace results for debugging.
- Playwright Tests: TypeScript implementation of Playwright for browser automation.
- Trace Results: Includes Playwright trace files for debugging and analysis.
- Organized Structure: Modular test cases for different platforms (e.g., AliExpress, Amazon).
- Step-by-Step Learning: Focused on exploring automation through examples.
- Node.js (v16 or later)
- npm (bundled with Node.js)
- Visual Studio Code
- Clone the repository:
git clone https://github.com/ChatGTHB/PlaywrightTypeScriptLearn.git
- Navigate to the project directory:
cd PlaywrightTypeScriptLearn
- Install dependencies:
npm install
- Open the project in VS Code:
code .
To run all Playwright tests:
npx playwright test
To run a specific test file:
npx playwright test tests/training/typescript.spec.ts
- After running tests, trace files are generated in the
test-results
folder. - To open and debug the trace:
npx playwright show-trace test-results/<trace-folder-name>/trace.zip
PlaywrightTypeScriptLearn/
├── node_modules/ # Project dependencies
├── test-results/ # Playwright test trace files
│ ├── tests-aliexpress... # Trace results for AliExpress tests
│ ├── trace.zip # Example trace file
├── tests/ # Test files
│ ├── training/ # Training-focused test files
│ │ ├── testgenerator.spec.ts
│ │ ├── typescript.spec.ts
│ │ ├── writetest.spec.ts
│ ├── aliexpress.spec.ts # AliExpress-specific tests
│ ├── amazon.spec.js # Amazon-specific tests
├── package.json # Dependencies and scripts
├── package-lock.json # Dependency lockfile
- Visual Studio Code
- Extensions:
- Playwright Test: Debug and run Playwright tests directly from VS Code.
- ESLint: For TypeScript linting.
- Prettier: For consistent code formatting.
- Fork this repository.
- Create a new branch:
git checkout -b feature-branch
- Commit your changes:
git commit -m "Add new feature"
- Push the branch:
git push origin feature-branch
- Submit a Pull Request.
This project is licensed under the MIT License.
For questions or issues, open an issue in this repository.