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