Skip to content

Learn and experiment with browser automation using Playwright and TypeScript. Includes modular tests, trace analysis, and support for platforms like AliExpress and Amazon.

License

Notifications You must be signed in to change notification settings

ChatGTHB/PlaywrightTypeScriptLearn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlaywrightTypeScriptLearn

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).
  • 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/ChatGTHB/PlaywrightTypeScriptLearn.git
  2. Navigate to the project directory:
    cd PlaywrightTypeScriptLearn
  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

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

💡 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.

About

Learn and experiment with browser automation using Playwright and TypeScript. Includes modular tests, trace analysis, and support for platforms like AliExpress and Amazon.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published