@zhiweiliu/playwright-generator 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -110,6 +110,8 @@ The installed module will have amazing features to facilitate your day-to-day te
|
|
|
110
110
|
project-root/
|
|
111
111
|
├── tests/ # Natural language test cases
|
|
112
112
|
│ └── *.test.md
|
|
113
|
+
├── samples/ # Sample test cases for reference
|
|
114
|
+
│ └── *.test.md
|
|
113
115
|
├── generated/ # Generated Playwright test code
|
|
114
116
|
│ └── generated.test.ts
|
|
115
117
|
├── page-objects/ # Page Object Models (optional)
|
|
@@ -168,6 +170,24 @@ And clicks the login button
|
|
|
168
170
|
Then the user should be redirected to the dashboard
|
|
169
171
|
```
|
|
170
172
|
|
|
173
|
+
### Sample Test Cases
|
|
174
|
+
|
|
175
|
+
For reference and testing purposes, sample test cases are provided in the `samples/` folder:
|
|
176
|
+
|
|
177
|
+
- `samples/saucedemo-samples.test.md`: Comprehensive test cases for the SauceDemo e-commerce website (https://saucedemo.com), including complete purchase flow and product browsing scenarios with detailed step-by-step descriptions.
|
|
178
|
+
|
|
179
|
+
You can use these samples to:
|
|
180
|
+
|
|
181
|
+
1. Test the generator with real-world e-commerce scenarios
|
|
182
|
+
2. Understand the level of detail needed in natural language descriptions
|
|
183
|
+
3. Generate Playwright code for immediate use and validation
|
|
184
|
+
|
|
185
|
+
To generate code from a sample test case:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npx playwright-generator generate --tc TC-SAMPLE-0001
|
|
189
|
+
```
|
|
190
|
+
|
|
171
191
|
### Generation
|
|
172
192
|
|
|
173
193
|
Playwright test automation code is generated by running a command, with generated code placed in the `generated/` folder under the project root.
|