Skip to main content

No project description provided

Project description

Playwright Project Setup CLI Tool

A Python CLI tool that quickly scaffolds a complete Playwright test automation project with TypeScript, organized structure, and QA best practices.

✨ Features

  • Quick Setup: Instantly bootstraps a full Playwright project
  • Organized Structure: Separates E2E, frontend, backend tests using POM
  • Multi-browser: Pre-configured for Chromium, Firefox, and WebKit
  • Dynamic Test Data: Faker.js for realistic mock data
  • TypeScript Ready: Fully configured for TypeScript and TS-Node
  • Fixtures & Utils: Common helper structures and environment setup
  • Custom Location: Use --path to generate your project anywhere
  • Safe Execution: Preview with --dry-run, force overwrite with --force

🔧 Prerequisites

Make sure the following are installed:

  • Python 3.7+
  • Node.js v18+
  • npm
  • pipx

Install pipx if missing:

sudo apt install pipx
pipx ensurepath

🚀 Installation (Recommended via pipx)

pipx install qa-project-gen

Now you can run the CLI globally:

qa-gen my-playwright-project

🛠️ Command Options

qa-gen <project-name> [options]

Options:
  --force        Overwrite existing files if they exist
  --dry-run      Show what would be created without writing to disk
  --clean        Remove generated folders and files from a project
  --path <dir>   Set the folder where the project should be created

📌 Usage Examples

# Create a new Playwright project
qa-gen my-test-project

# Create at a specific location
qa-gen my-project --path /home/user/qa-projects

# Simulate project creation without making changes
qa-gen temp-project --dry-run

# Overwrite files in an existing project folder
qa-gen demo-project --force

# Clean up an old project
qa-gen demo-project --clean --path /home/user/old-projects

📁 Generated Project Structure

my-test-project/
├── playwright.config.ts           # Playwright configuration
├── tsconfig.json                  # TypeScript configuration
├── package.json                   # Node.js metadata
├── .gitignore                     # Ignore rules
├── README.md                      # Template documentation
└── tests/
    ├── e2e/                       # End-to-end specs
    ├── front_end/feature_one/     # UI/FE tests
    ├── back_end/feature_one/      # API/BE tests
    └── support/
        ├── POMs/feature_one/      # Page Object Models
        └── utils/                 # Shared test utilities
            ├── helpers.ts
            ├── test-data.ts
            └── fixtures.ts

📦 What Gets Installed (via npm)

The CLI installs and configures:

  • playwright — Browser automation
  • @playwright/test — Test runner and assertion library
  • typescript — TypeScript language support
  • ts-node — TypeScript execution in Node
  • @faker-js/faker — Fake test data
  • dotenv — Environment variable support

✅ Running Tests

Once your project is generated:

cd my-test-project

# Run all tests
npx playwright test

# Run specific suite
npx playwright test tests/front_end

# Run with browser UI
npx playwright test --headed

# View test results
npx playwright show-report

🧠 Notes

  • If using Linux or WSL and venv is missing:
    sudo apt install python3-venv
    
  • If you’re in a restricted environment (like Debian or Ubuntu), use pipx instead of global pip to avoid permission issues.
  • Avoid sudo pip install to prevent breaking system packages.

Built with ❤️ to help QA Engineers get started faster and test better.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qa_project_gen-0.2.4.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qa_project_gen-0.2.4-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file qa_project_gen-0.2.4.tar.gz.

File metadata

  • Download URL: qa_project_gen-0.2.4.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for qa_project_gen-0.2.4.tar.gz
Algorithm Hash digest
SHA256 405ed91b7bb9f174cdf37cd1d3d71c03506d7e580ef959cf54f1d9e2d81f1f92
MD5 9ad6780c2d183f6084927f9d7b2519af
BLAKE2b-256 d27f9ffa4e11171f32096660e5db6c6fd6ab23ff66b771ddd8a3d6c751751c62

See more details on using hashes here.

File details

Details for the file qa_project_gen-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: qa_project_gen-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for qa_project_gen-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7fe3c5a938b85034c3f567eaedcac7c206415dd5f1eeb1c268c06aac62d6b672
MD5 4d247dc1008040b5f2bc61ac71b4c4a0
BLAKE2b-256 dc723279c8bd94df1415a632a2adfcd1557fac94fd81f6bf8a9bfcb15a8efb0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page