Skip to content

Files

Latest commit

9f62a46 · Jan 1, 2025

History

History
133 lines (99 loc) · 3.49 KB

File metadata and controls

133 lines (99 loc) · 3.49 KB

Playwright TypeScript Learning Path

Playwright TypeScript Node.js Visual Studio Code

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.


🚀 Features

  • 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, GitHub).
  • Step-by-Step Learning: Focused on exploring automation through examples.

📥 Installation

Prerequisites

  • Node.js (v16 or later)
  • npm (bundled with Node.js)
  • Visual Studio Code

Steps

  1. Clone the repository:
    git clone https://github.com/cihat-kose/playwright-typescript-learning-path.git
  2. Navigate to the project directory:
    cd playwright-typescript-learning-path
  3. Install dependencies:
    npm install
  4. Open the project in VS Code:
    code .

⚙️ Usage

Running Tests

To run all Playwright tests:

npx playwright test

To run a specific test file:

npx playwright test tests/training/typescript.spec.ts

Trace Analysis

  1. After running tests, trace files are generated in the test-results folder.
  2. To open and debug the trace:
    npx playwright show-trace test-results/<trace-folder-name>/trace.zip

📂 Project Structure

playwright-typescript-learning-path/
├── 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

💡 Recommended Tools

  • Visual Studio Code
  • Extensions:
    • Playwright Test: Debug and run Playwright tests directly from VS Code.
    • ESLint: For TypeScript linting.
    • Prettier: For consistent code formatting.

🙌 Contributing

  1. Fork this repository.
  2. Create a new branch:
    git checkout -b feature-branch
  3. Commit your changes:
    git commit -m "Add new feature"
  4. Push the branch:
    git push origin feature-branch
  5. Submit a Pull Request.

📜 License

This project is licensed under the MIT License.


❓ Contact

For questions or issues, open an issue in this repository.