Skip to content

Latest commit

Β 

History

History
130 lines (97 loc) Β· 2.75 KB

File metadata and controls

130 lines (97 loc) Β· 2.75 KB

Project Name

This project is an automation project that performs API and UI tests using Playwright.

Project Structure

Installation

  1. Clone this repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Install the necessary dependencies:

    npm install

Running Tests

UI Tests

To run UI tests, use the following command:

npx playwright test tests/ui

API Tests

To run API tests, use the following command:

npx playwright test tests/api

πŸ› οΈ Configuration

  • Project Configuration:
    The main configuration is located in the playwright.config.ts file.
  • Environment Variables:
    Environment variables are managed via the .env file.

πŸ“‚ Folder Structure

src

  • config:
    Contains project configuration files.

    • environment.ts: Configures environment variables.
    • global-setup.ts: Executes global setup before tests.
    • global-teardown.ts: Executes global teardown after tests.
  • data:
    Contains test data.

    • testData.json: Stores test data in JSON format.
  • pages:
    Implements Page Object Model (POM).

    • BasePage.ts: The base class for all pages.
    • HomePage.ts: Page object for the home page.
  • utils:
    Contains utility functions and tools.

    • commonUtils.ts: Common utility functions.
    • dataReader.ts: Utility for reading test data.
    • logger.ts: Handles logging functionality.

tests

  • api: Contains API test files.
  • ui: Contains UI test files.
    • home.spec.ts: UI tests for the home page.

πŸ“Š Reporting

  • HTML Reports:
    Test results are generated in the playwright-report folder in HTML format.
    Open the index.html file to view detailed test reports.

🀝 Contributing

  • Submit a pull request for new features or fixes.
  • Open an issue for discussions or bug reporting.

πŸ“œ License

This project is licensed under the MIT License.


πŸ—ΊοΈ Schema Overview

Project
β”‚
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ config
β”‚   β”‚   β”œβ”€β”€ environment.ts
β”‚   β”‚   β”œβ”€β”€ global-setup.ts
β”‚   β”‚   └── global-teardown.ts
β”‚   β”œβ”€β”€ data
β”‚   β”‚   └── testData.json
β”‚   β”œβ”€β”€ pages
β”‚   β”‚   β”œβ”€β”€ BasePage.ts
β”‚   β”‚   └── HomePage.ts
β”‚   └── utils
β”‚       β”œβ”€β”€ commonUtils.ts
β”‚       β”œβ”€β”€ dataReader.ts
β”‚       └── logger.ts
β”‚
β”œβ”€β”€ tests
β”‚   β”œβ”€β”€ api
β”‚   └── ui
β”‚       └── home.spec.ts
β”‚
β”œβ”€β”€ playwright.config.ts
β”œβ”€β”€ .env
β”œβ”€β”€ playwright-report
β”‚   └── index.html
└── LICENSE





# PW-TypeScriptProject