This project is an automation project that performs API and UI tests using Playwright.
-
Clone this repository:
git clone <repository-url> cd <repository-directory>
-
Install the necessary dependencies:
npm install
To run UI tests, use the following command:
npx playwright test tests/uiTo run API tests, use the following command:
npx playwright test tests/api- Project Configuration:
The main configuration is located in theplaywright.config.tsfile. - Environment Variables:
Environment variables are managed via the.envfile.
-
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.
api: Contains API test files.ui: Contains UI test files.home.spec.ts: UI tests for the home page.
- HTML Reports:
Test results are generated in theplaywright-reportfolder in HTML format.
Open theindex.htmlfile to view detailed test reports.
- Submit a pull request for new features or fixes.
- Open an issue for discussions or bug reporting.
This project is licensed under the MIT License.
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