lazyscout 0.1.0
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/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/index.js +1360 -0
- package/dist/web/assets/index-Bvjimfib.css +1 -0
- package/dist/web/assets/index-CX5TV5gQ.js +12 -0
- package/dist/web/index.html +13 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LazyScout contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# LazyScout
|
|
2
|
+
|
|
3
|
+
เครื่องมือช่วย Software Tester วิเคราะห์เว็บไซต์แล้วสร้าง **Draft Test Case** และ **Test Data**
|
|
4
|
+
อัตโนมัติ พร้อม export เป็น CSV เปิดใน Excel / Google Sheets ได้ทันที
|
|
5
|
+
|
|
6
|
+
**ทำงานในเครื่องคุณเอง** — ไม่ต้องสมัครสมาชิก ไม่ต้องล็อกอิน ไม่ส่งข้อมูลออกไปไหน
|
|
7
|
+
จึงสแกน `http://localhost` และระบบภายในองค์กรได้
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx lazyscout
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ใช้งาน
|
|
16
|
+
|
|
17
|
+
### เปิดหน้าเว็บ (แนะนำ)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx lazyscout
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
เปิดหน้าจอที่ `http://localhost:4321` ให้อัตโนมัติ → ใส่ URL → กด **Analyze Website**
|
|
24
|
+
→ แก้ไข test case ในตาราง → **Export CSV**
|
|
25
|
+
|
|
26
|
+
### โหมดบรรทัดคำสั่ง (เหมาะกับ CI)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx lazyscout scan http://localhost:5173
|
|
30
|
+
npx lazyscout scan https://example.com --max-pages 10 --csv report.csv --json raw.json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| ตัวเลือก | ความหมาย |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `--csv <ไฟล์>` | บันทึก test case + test data เป็น CSV (ค่าเริ่มต้น `lazyscout-testcases.csv`) |
|
|
36
|
+
| `--json <ไฟล์>` | บันทึกผลดิบทั้งหมด (page model + test case + test data) |
|
|
37
|
+
| `--max-pages <n>` | จำนวนหน้าสูงสุด (ค่าเริ่มต้น 20) |
|
|
38
|
+
| `--max-depth <n>` | ความลึกสูงสุด (ค่าเริ่มต้น 3) |
|
|
39
|
+
| `--port <n>` | พอร์ตของหน้าเว็บ (ค่าเริ่มต้น 4321) |
|
|
40
|
+
| `--no-open` | ไม่ต้องเปิดเบราว์เซอร์ให้อัตโนมัติ |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## ได้อะไรออกมา
|
|
45
|
+
|
|
46
|
+
**Test Cases** — สร้างจากสิ่งที่ตรวจพบจริงบนหน้าเว็บ
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
TC-LOGIN-001 positive/ready Login page displays required controls
|
|
50
|
+
TC-LOGIN-002 validation/needs-review Email is required
|
|
51
|
+
TC-LOGIN-003 validation/needs-review Password is required
|
|
52
|
+
TC-LOGIN-004 positive/needs-data Submit Login form with valid data
|
|
53
|
+
TC-LOGIN-005 positive/ready Navigate to Register
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Test Data** — ค่าที่ควรผ่าน/ควรถูกปฏิเสธของแต่ละช่องกรอก
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
TD-LOGIN-001 Email email required qa.tester@example.com invalid-email
|
|
60
|
+
TD-LOGIN-002 Password password required Passw0rd!23 123
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**CSV** — ไฟล์เดียวมีทั้งสองส่วน มี UTF-8 BOM ภาษาไทยไม่เพี้ยนใน Excel
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
TC_ID, Module, Title, Preconditions, Test_Steps, Expected_Result, Type, Priority, Automation_Status, Source_URL
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## ความปลอดภัย
|
|
72
|
+
|
|
73
|
+
เครื่องมือนี้ออกแบบให้ยิงใส่ระบบที่กำลังพัฒนาได้อย่างปลอดภัย
|
|
74
|
+
|
|
75
|
+
- **ไม่คลิกปุ่มและไม่ submit form** — เดินทางด้วยลิงก์ (`href`) เท่านั้น จึงไม่เปลี่ยนแปลงข้อมูลของระบบ
|
|
76
|
+
- **ตรวจพบ action อันตราย แต่ไม่แตะ** — Delete, Payment, Logout ฯลฯ จะถูกบันทึกเป็น test case แบบ `manual` ให้ทดสอบด้วยมือ
|
|
77
|
+
- **สำรวจเฉพาะ origin เดียวกัน** ไม่ออกไปโดเมนอื่น
|
|
78
|
+
- จำกัด 20 หน้า / ลึก 3 ชั้น / มี timeout และกันการวนลูป
|
|
79
|
+
|
|
80
|
+
## ไม่เดา expected result
|
|
81
|
+
|
|
82
|
+
ถ้าระบบไม่มีหลักฐานว่า behavior จริงคืออะไร จะไม่แต่งขึ้นมาเอง แต่จะเขียนว่า
|
|
83
|
+
|
|
84
|
+
> Verify that the result is displayed according to application requirements (needs review by tester).
|
|
85
|
+
|
|
86
|
+
แล้วตั้งสถานะเป็น `needs-review` — **ผลลัพธ์คือ Draft ที่ Tester ต้องตรวจ ไม่ใช่ test case ที่ถูกต้อง 100%**
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ความต้องการของระบบ
|
|
91
|
+
|
|
92
|
+
- **Node.js 20 ขึ้นไป**
|
|
93
|
+
- **Google Chrome หรือ Microsoft Edge** อย่างใดอย่างหนึ่ง (เครื่องส่วนใหญ่มีอยู่แล้ว)
|
|
94
|
+
|
|
95
|
+
แพ็กเกจนี้ใช้ `playwright-core` จึงไม่ดาวน์โหลดเบราว์เซอร์ 150MB ตอนติดตั้ง แต่จะหาเบราว์เซอร์
|
|
96
|
+
ในเครื่องคุณตามลำดับ: Chromium ของ Playwright → Chrome → Edge
|
|
97
|
+
|
|
98
|
+
ถ้าไม่มีสักตัว ติดตั้งด้วย:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx playwright install chromium
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
> **Windows:** ถ้าใช้ `cmd.exe` รุ่นเก่าแล้วภาษาไทยแสดงไม่ถูก ให้พิมพ์ `chcp 65001` ก่อน
|
|
105
|
+
> หรือใช้ Windows Terminal / PowerShell 7 ซึ่งรองรับ UTF-8 อยู่แล้ว
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## แผนในอนาคต
|
|
110
|
+
|
|
111
|
+
โครงสร้างภายในแยก Test Case Model ออกจาก Playwright โดยสิ้นเชิง จึงเพิ่มสิ่งเหล่านี้ได้
|
|
112
|
+
โดยไม่ต้องแก้ตัวสำรวจเว็บ:
|
|
113
|
+
|
|
114
|
+
- `TestCase[]` → Playwright `.spec.ts`
|
|
115
|
+
- `TestCase[]` → Cypress `.cy.ts`
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
MIT
|