WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 859ab1d

Browse files
merge actual main
2 parents 5a6c9e1 + cd489ca commit 859ab1d

File tree

6 files changed

+242
-499
lines changed

6 files changed

+242
-499
lines changed

README.md

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,91 @@
1-
# petstore_playwright
1+
# Read me for Swagger Petstore API project
2+
3+
## Overview
4+
5+
This project uses Playwright for API testing. Playwright enables fast and reliable browser automation across different browsers and devices.
6+
7+
## Prerequisites
8+
9+
Ensure you have the following installed before running the tests:
10+
11+
- **Node.js** (v16 or later recommended)
12+
- **Visual Studio**
13+
- **npm or yarn**
14+
15+
## Installation
16+
17+
Clone the repository and install playwright dependencies:
18+
19+
- git clone [email protected]:auto-qa-hub/petstore_playwright.git
20+
- npm init playwright
21+
22+
## Playwright Installation
23+
24+
Ensure Playwright dependencies are installed:
25+
26+
- npx playwright install
27+
28+
## Running Tests
29+
30+
To execute tests, use the following commands:
31+
32+
### Run All Tests
33+
34+
- npx playwright test
35+
36+
### Run a Specific Test File
37+
38+
- npx playwright test tests/example.spec.js
39+
40+
### Run Tests in Headed Mode
41+
42+
- npx playwright test --headed
43+
44+
### Run Tests with UI Mode
45+
46+
- npx playwright test --ui
47+
48+
## Test Reporting
49+
50+
Generate and view test reports:
51+
52+
- npx playwright show-report
53+
54+
## Writing Tests
55+
56+
Playwright tests are located in the tests/ directory. Example structure:
57+
58+
/tests
59+
├── storeTests.spec.ts
60+
├── userTests.spec.ts
61+
├── petTests.spec.js
62+
63+
Refer to the Playwright documentation - https://playwright.dev/docs/intro for writing and structuring tests.
64+
65+
## CI/CD Integration
66+
67+
To integrate Playwright with CI/CD pipelines, configure .github/workflows/playwright.yml or relevant CI scripts. Example:
68+
69+
name: Playwright Tests
70+
on: [push, pull_request]
71+
72+
jobs:
73+
test:
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: Checkout code
77+
uses: actions/checkout@v3
78+
- name: Install dependencies
79+
run: npm install
80+
- name: Install Playwright Browsers
81+
run: npx playwright install --with-deps
82+
- name: Run tests
83+
run: npx playwright test
84+
85+
## Troubleshooting
86+
87+
- Ensure all dependencies are installed (npm install)
88+
89+
- Verify Playwright browsers are installed (npx playwright install)
90+
91+
- Run tests in debug mode: npx playwright test --debug

test-data/test.data.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"id": 11229,
3+
"username": "DKTestUpdateUser",
4+
"firstName": "TestAuto",
5+
"lastName": "DKTesting",
6+
"email": "[email protected]",
7+
"password": "12345678919Aa!",
8+
"phone": "069911122",
9+
"userStatus": 0
10+
}

0 commit comments

Comments
 (0)