lazyscout 0.3.0 → 0.3.1
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 +90 -90
- package/dist/index.js +25 -25
- package/dist/web/assets/{index-2zh7L5nF.js → index-mRd16pSY.js} +9 -9
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
# LazyScout
|
|
2
|
-
|
|
3
|
-
LazyScout is a local-first QA assistant that explores web applications, drafts test cases, and generates automation code for Playwright and Cypress.
|
|
4
|
-
|
|
5
|
-
> Stop rewriting QA work.
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
Requires Node.js 20 or newer and Chrome, Edge or Playwright Chromium.
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npx lazyscout@latest
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
LazyScout starts its UI on `http://localhost:4321` and opens it automatically.
|
|
16
|
-
|
|
17
|
-
If a supported browser is not installed:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npx playwright install chromium
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## CLI scan
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npx lazyscout@latest scan http://localhost:5173
|
|
27
|
-
npx lazyscout@latest scan https://example.com --max-pages 10 --csv report.csv --json raw.json
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
| Option | Purpose |
|
|
31
|
-
| ----------------- | ------------------------------------------------------ |
|
|
32
|
-
| `--csv <file>` | CSV output path; defaults to `lazyscout-testcases.csv` |
|
|
33
|
-
| `--json <file>` | Optional raw exploration output |
|
|
34
|
-
| `--max-pages <n>` | Maximum pages; defaults to 20 |
|
|
35
|
-
| `--max-depth <n>` | Maximum same-origin link depth; defaults to 3 |
|
|
36
|
-
| `--port <n>` | Local UI port; defaults to 4321 |
|
|
37
|
-
| `--workspace <p>` | Project workspace; defaults to `~/LazyScout` |
|
|
38
|
-
| `--no-open` | Start without opening the browser |
|
|
39
|
-
|
|
40
|
-
The current CLI command is `scan`; there is no `analyze` command.
|
|
41
|
-
|
|
42
|
-
## Available Features
|
|
43
|
-
|
|
44
|
-
- Playwright website and form exploration
|
|
45
|
-
- UI control, visible dialog and interaction discovery
|
|
46
|
-
- English/Thai Draft Test Cases and Test Data
|
|
47
|
-
- Test Case review, folders, tags and requirement links
|
|
48
|
-
- CSV/XLSX/JSON import and CSV export
|
|
49
|
-
- Screenshot OCR-assisted import
|
|
50
|
-
- Playwright and Cypress code generation
|
|
51
|
-
- Local Playwright execution with restricted statements, logs and explicit `page.screenshot()` evidence
|
|
52
|
-
- Safe GET/HEAD/OPTIONS API checks
|
|
53
|
-
- Bug Reports with ZIP evidence export
|
|
54
|
-
- HTML/PDF Test Summary
|
|
55
|
-
- Confirmed local GET load test
|
|
56
|
-
|
|
57
|
-
Cypress is code generation only; the built-in local runner uses Playwright.
|
|
58
|
-
|
|
59
|
-
## Local-first Data
|
|
60
|
-
|
|
61
|
-
Browser automation runs on your machine. LazyScout creates `~/LazyScout` before opening the UI and stores each Project's JSON, CSV, automation, screenshots, Bug Reports, reports and logs there. Use `--workspace <path>` to override it. Credentials entered in Project Settings stay in memory for the current tab and are cleared on refresh.
|
|
62
|
-
|
|
63
|
-
Version Center contacts npm Registry to check available releases. LazyScout has no hosted account or Project database in the current version.
|
|
64
|
-
|
|
65
|
-
## Safety
|
|
66
|
-
|
|
67
|
-
Scouting is same-origin, follows links and blocks destructive labels. Edited automation is interpreted through a Playwright statement whitelist; it is not executed as arbitrary JavaScript or shell source.
|
|
68
|
-
|
|
69
|
-
> Never commit real test credentials, production data, browser authentication state, Playwright traces, screenshots, HAR files, or API dumps containing sensitive information.
|
|
70
|
-
|
|
71
|
-
> Use synthetic test data whenever possible.
|
|
72
|
-
|
|
73
|
-
> Review generated test cases and automation code before executing them against critical environments.
|
|
74
|
-
|
|
75
|
-
Generated Test Cases are drafts, not a replacement for QA judgment. Use DEV, UAT, sandbox or another authorized test environment before production.
|
|
76
|
-
|
|
77
|
-
## Documentation
|
|
78
|
-
|
|
79
|
-
- [GitHub repository](https://github.com/nowaa2/lazyscout)
|
|
80
|
-
- [Security policy](https://github.com/nowaa2/lazyscout/blob/main/SECURITY.md)
|
|
81
|
-
- [Thai README](https://github.com/nowaa2/lazyscout/blob/main/README_TH.md)
|
|
82
|
-
- [Issue tracker](https://github.com/nowaa2/lazyscout/issues)
|
|
83
|
-
|
|
84
|
-
## Author
|
|
85
|
-
|
|
86
|
-
Created by **nowzaa** — [GitHub profile](https://github.com/nowaa2)
|
|
87
|
-
|
|
88
|
-
## License
|
|
89
|
-
|
|
90
|
-
MIT
|
|
1
|
+
# LazyScout
|
|
2
|
+
|
|
3
|
+
LazyScout is a local-first QA assistant that explores web applications, drafts test cases, and generates automation code for Playwright and Cypress.
|
|
4
|
+
|
|
5
|
+
> Stop rewriting QA work.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
Requires Node.js 20 or newer and Chrome, Edge or Playwright Chromium.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx lazyscout@latest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
LazyScout starts its UI on `http://localhost:4321` and opens it automatically.
|
|
16
|
+
|
|
17
|
+
If a supported browser is not installed:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx playwright install chromium
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## CLI scan
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx lazyscout@latest scan http://localhost:5173
|
|
27
|
+
npx lazyscout@latest scan https://example.com --max-pages 10 --csv report.csv --json raw.json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Option | Purpose |
|
|
31
|
+
| ----------------- | ------------------------------------------------------ |
|
|
32
|
+
| `--csv <file>` | CSV output path; defaults to `lazyscout-testcases.csv` |
|
|
33
|
+
| `--json <file>` | Optional raw exploration output |
|
|
34
|
+
| `--max-pages <n>` | Maximum pages; defaults to 20 |
|
|
35
|
+
| `--max-depth <n>` | Maximum same-origin link depth; defaults to 3 |
|
|
36
|
+
| `--port <n>` | Local UI port; defaults to 4321 |
|
|
37
|
+
| `--workspace <p>` | Project workspace; defaults to `~/LazyScout` |
|
|
38
|
+
| `--no-open` | Start without opening the browser |
|
|
39
|
+
|
|
40
|
+
The current CLI command is `scan`; there is no `analyze` command.
|
|
41
|
+
|
|
42
|
+
## Available Features
|
|
43
|
+
|
|
44
|
+
- Playwright website and form exploration
|
|
45
|
+
- UI control, visible dialog and interaction discovery
|
|
46
|
+
- English/Thai Draft Test Cases and Test Data
|
|
47
|
+
- Test Case review, folders, tags and requirement links
|
|
48
|
+
- CSV/XLSX/JSON import and CSV export
|
|
49
|
+
- Screenshot OCR-assisted import
|
|
50
|
+
- Playwright and Cypress code generation
|
|
51
|
+
- Local Playwright execution with restricted statements, logs and explicit `page.screenshot()` evidence
|
|
52
|
+
- Safe GET/HEAD/OPTIONS API checks
|
|
53
|
+
- Bug Reports with ZIP evidence export
|
|
54
|
+
- HTML/PDF Test Summary
|
|
55
|
+
- Confirmed local GET load test
|
|
56
|
+
|
|
57
|
+
Cypress is code generation only; the built-in local runner uses Playwright.
|
|
58
|
+
|
|
59
|
+
## Local-first Data
|
|
60
|
+
|
|
61
|
+
Browser automation runs on your machine. LazyScout creates `~/LazyScout` before opening the UI and stores each Project's JSON, CSV, automation, screenshots, Bug Reports, reports and logs there. Use `--workspace <path>` to override it. Credentials entered in Project Settings stay in memory for the current tab and are cleared on refresh.
|
|
62
|
+
|
|
63
|
+
Version Center contacts npm Registry to check available releases. LazyScout has no hosted account or Project database in the current version.
|
|
64
|
+
|
|
65
|
+
## Safety
|
|
66
|
+
|
|
67
|
+
Scouting is same-origin, follows links and blocks destructive labels. Edited automation is interpreted through a Playwright statement whitelist; it is not executed as arbitrary JavaScript or shell source.
|
|
68
|
+
|
|
69
|
+
> Never commit real test credentials, production data, browser authentication state, Playwright traces, screenshots, HAR files, or API dumps containing sensitive information.
|
|
70
|
+
|
|
71
|
+
> Use synthetic test data whenever possible.
|
|
72
|
+
|
|
73
|
+
> Review generated test cases and automation code before executing them against critical environments.
|
|
74
|
+
|
|
75
|
+
Generated Test Cases are drafts, not a replacement for QA judgment. Use DEV, UAT, sandbox or another authorized test environment before production.
|
|
76
|
+
|
|
77
|
+
## Documentation
|
|
78
|
+
|
|
79
|
+
- [GitHub repository](https://github.com/nowaa2/lazyscout)
|
|
80
|
+
- [Security policy](https://github.com/nowaa2/lazyscout/blob/main/SECURITY.md)
|
|
81
|
+
- [Thai README](https://github.com/nowaa2/lazyscout/blob/main/README_TH.md)
|
|
82
|
+
- [Issue tracker](https://github.com/nowaa2/lazyscout/issues)
|
|
83
|
+
|
|
84
|
+
## Author
|
|
85
|
+
|
|
86
|
+
Created by **nowzaa** — [GitHub profile](https://github.com/nowaa2)
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -93,36 +93,36 @@ function isCloudMetadataHostname(hostname) {
|
|
|
93
93
|
function checkTargetUrl(rawUrl, policy = LOCAL_QA_POLICY) {
|
|
94
94
|
const trimmed = rawUrl.trim();
|
|
95
95
|
if (!trimmed) {
|
|
96
|
-
return { ok: false, code: "invalid-url", message: "
|
|
96
|
+
return { ok: false, code: "invalid-url", message: "Provide a URL to analyze." };
|
|
97
97
|
}
|
|
98
98
|
const withProtocol = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `http://${trimmed}`;
|
|
99
99
|
let url;
|
|
100
100
|
try {
|
|
101
101
|
url = new URL(withProtocol);
|
|
102
102
|
} catch {
|
|
103
|
-
return { ok: false, code: "invalid-url", message: "
|
|
103
|
+
return { ok: false, code: "invalid-url", message: "The URL format is invalid." };
|
|
104
104
|
}
|
|
105
105
|
if (!policy.allowedProtocols.includes(url.protocol)) {
|
|
106
106
|
return {
|
|
107
107
|
ok: false,
|
|
108
108
|
code: "blocked-url",
|
|
109
|
-
message:
|
|
109
|
+
message: `Only ${policy.allowedProtocols.join(", ")} is supported (received ${url.protocol}).`
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
if (!url.hostname) {
|
|
113
|
-
return { ok: false, code: "invalid-url", message: "URL
|
|
113
|
+
return { ok: false, code: "invalid-url", message: "The URL has no hostname." };
|
|
114
114
|
}
|
|
115
115
|
if (url.username || url.password) {
|
|
116
|
-
return { ok: false, code: "blocked-url", message: "
|
|
116
|
+
return { ok: false, code: "blocked-url", message: "Credentials in URLs are not allowed." };
|
|
117
117
|
}
|
|
118
118
|
if (!policy.allowCloudMetadata && isCloudMetadataHostname(url.hostname)) {
|
|
119
|
-
return { ok: false, code: "blocked-url", message: "
|
|
119
|
+
return { ok: false, code: "blocked-url", message: "Cloud metadata endpoints are not allowed." };
|
|
120
120
|
}
|
|
121
121
|
if (!policy.allowLoopback && isLoopbackHostname(url.hostname)) {
|
|
122
|
-
return { ok: false, code: "blocked-url", message: "
|
|
122
|
+
return { ok: false, code: "blocked-url", message: "Localhost is not allowed." };
|
|
123
123
|
}
|
|
124
124
|
if (!policy.allowPrivateNetwork && isPrivateHostname(url.hostname)) {
|
|
125
|
-
return { ok: false, code: "blocked-url", message: "
|
|
125
|
+
return { ok: false, code: "blocked-url", message: "Private network addresses are not allowed." };
|
|
126
126
|
}
|
|
127
127
|
return { ok: true, url };
|
|
128
128
|
}
|
|
@@ -634,7 +634,7 @@ var ExplorerError = class extends Error {
|
|
|
634
634
|
// ../../packages/explorer/dist/launchBrowser.js
|
|
635
635
|
import { chromium } from "playwright-core";
|
|
636
636
|
var CANDIDATES = [
|
|
637
|
-
{ channel: void 0, label: "Chromium
|
|
637
|
+
{ channel: void 0, label: "Playwright Chromium" },
|
|
638
638
|
{ channel: "chrome", label: "Google Chrome" },
|
|
639
639
|
{ channel: "msedge", label: "Microsoft Edge" }
|
|
640
640
|
];
|
|
@@ -832,7 +832,7 @@ async function visitPage(page, item, config2) {
|
|
|
832
832
|
if (status !== void 0 && status >= 400) {
|
|
833
833
|
return {
|
|
834
834
|
kind: "issue",
|
|
835
|
-
issue: { url: item.url, code: "http-error", message:
|
|
835
|
+
issue: { url: item.url, code: "http-error", message: `The server returned HTTP ${status}.` }
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
838
|
await page.waitForLoadState("networkidle", { timeout: Math.min(config2.pageTimeoutMs, 5e3) }).catch(() => void 0);
|
|
@@ -1406,8 +1406,8 @@ function toApiError(error) {
|
|
|
1406
1406
|
body: {
|
|
1407
1407
|
error: {
|
|
1408
1408
|
code: "internal-error",
|
|
1409
|
-
message: "
|
|
1410
|
-
hint: "
|
|
1409
|
+
message: "An internal error occurred while analyzing the website.",
|
|
1410
|
+
hint: "Try again, or review the server logs for more details."
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
1413
|
};
|
|
@@ -1419,7 +1419,7 @@ function registerAnalyzeRoute(app) {
|
|
|
1419
1419
|
const body = request.body ?? {};
|
|
1420
1420
|
if (typeof body.url !== "string" || !body.url.trim()) {
|
|
1421
1421
|
return reply.status(400).send({
|
|
1422
|
-
error: { code: "invalid-url", message: "
|
|
1422
|
+
error: { code: "invalid-url", message: "Provide a URL to analyze." }
|
|
1423
1423
|
});
|
|
1424
1424
|
}
|
|
1425
1425
|
const check = checkTargetUrl(body.url, config.urlPolicy);
|
|
@@ -1434,7 +1434,7 @@ function registerAnalyzeRoute(app) {
|
|
|
1434
1434
|
}, config.urlPolicy);
|
|
1435
1435
|
if (result.pages.length === 0) {
|
|
1436
1436
|
const firstIssue = result.issues[0];
|
|
1437
|
-
throw new ExplorerError(firstIssue?.code ?? "navigation-failed", firstIssue?.message ?? "
|
|
1437
|
+
throw new ExplorerError(firstIssue?.code ?? "navigation-failed", firstIssue?.message ?? "Could not open the website.", "Check that the URL is correct and the website is available.");
|
|
1438
1438
|
}
|
|
1439
1439
|
const testCases = generateTestCases(result.pages, { language: body.language ?? "en" });
|
|
1440
1440
|
const runEvents = [
|
|
@@ -1530,7 +1530,7 @@ function registerExportCsvRoute(app) {
|
|
|
1530
1530
|
const body = request.body ?? {};
|
|
1531
1531
|
if (!Array.isArray(body.testCases) || body.testCases.length === 0) {
|
|
1532
1532
|
return reply.status(400).send({
|
|
1533
|
-
error: { code: "empty-export", message: "
|
|
1533
|
+
error: { code: "empty-export", message: "There are no Test Cases to export." }
|
|
1534
1534
|
});
|
|
1535
1535
|
}
|
|
1536
1536
|
const csv = exportTestCasesToCsv(body.testCases, Array.isArray(body.testData) ? body.testData : []);
|
|
@@ -1838,11 +1838,11 @@ function registerAutomationRunRoute(app, workspaceRoot) {
|
|
|
1838
1838
|
const framework = body.framework ?? "playwright";
|
|
1839
1839
|
const runId = body.runId || crypto.randomUUID();
|
|
1840
1840
|
if (!testCase || !Array.isArray(testCase.steps))
|
|
1841
|
-
return reply.status(400).send({ error: { code: "invalid-test-case", message: "
|
|
1841
|
+
return reply.status(400).send({ error: { code: "invalid-test-case", message: "The requested Test Case was not found." } });
|
|
1842
1842
|
if (testCase.steps.length > MAX_STEPS)
|
|
1843
|
-
return reply.status(400).send({ error: { code: "run-limit", message: "
|
|
1843
|
+
return reply.status(400).send({ error: { code: "run-limit", message: "Step count exceeds the limit of " + MAX_STEPS } });
|
|
1844
1844
|
if (typeof body.code === "string" && body.code.length > MAX_SOURCE_LENGTH)
|
|
1845
|
-
return reply.status(400).send({ error: { code: "source-limit", message: "Generated source
|
|
1845
|
+
return reply.status(400).send({ error: { code: "source-limit", message: "Generated source exceeds the size limit." } });
|
|
1846
1846
|
const logs = [];
|
|
1847
1847
|
const secretValues = [
|
|
1848
1848
|
secrets?.email,
|
|
@@ -2280,7 +2280,7 @@ function registerApiCheckRunRoute(app) {
|
|
|
2280
2280
|
const body = request.body;
|
|
2281
2281
|
const check = body.apiCheck;
|
|
2282
2282
|
if (!check?.url)
|
|
2283
|
-
return reply.status(400).send({ error: { code: "invalid-api-check", message: "
|
|
2283
|
+
return reply.status(400).send({ error: { code: "invalid-api-check", message: "API Check was not found." } });
|
|
2284
2284
|
const target = checkTargetUrl(check.url, config.urlPolicy);
|
|
2285
2285
|
if (!target.ok)
|
|
2286
2286
|
return reply.status(400).send({ error: { code: target.code, message: target.message } });
|
|
@@ -2297,7 +2297,7 @@ function registerApiCheckRunRoute(app) {
|
|
|
2297
2297
|
return reply.send({
|
|
2298
2298
|
status: "needs-auth",
|
|
2299
2299
|
durationMs: 0,
|
|
2300
|
-
message: "API
|
|
2300
|
+
message: "This API requires a token. Set LAZYSCOUT_API_TOKEN before running it."
|
|
2301
2301
|
});
|
|
2302
2302
|
const started = Date.now();
|
|
2303
2303
|
try {
|
|
@@ -2655,12 +2655,12 @@ function buildApp(options = {}) {
|
|
|
2655
2655
|
app.register(fastifyStatic, { root: options.staticDir });
|
|
2656
2656
|
app.setNotFoundHandler(async (request, reply) => {
|
|
2657
2657
|
if (request.url.startsWith("/api/")) {
|
|
2658
|
-
return reply.status(404).send({ error: { code: "not-found", message: "
|
|
2658
|
+
return reply.status(404).send({ error: { code: "not-found", message: "Endpoint was not found." } });
|
|
2659
2659
|
}
|
|
2660
2660
|
return reply.sendFile("index.html");
|
|
2661
2661
|
});
|
|
2662
2662
|
} else {
|
|
2663
|
-
app.setNotFoundHandler(async (_request, reply) => reply.status(404).send({ error: { code: "not-found", message: "
|
|
2663
|
+
app.setNotFoundHandler(async (_request, reply) => reply.status(404).send({ error: { code: "not-found", message: "Endpoint was not found." } }));
|
|
2664
2664
|
}
|
|
2665
2665
|
return app;
|
|
2666
2666
|
}
|
|
@@ -2678,7 +2678,7 @@ async function openInBrowser(url) {
|
|
|
2678
2678
|
}
|
|
2679
2679
|
|
|
2680
2680
|
// src/version.ts
|
|
2681
|
-
var VERSION = true ? "0.3.
|
|
2681
|
+
var VERSION = true ? "0.3.1" : "0.0.0-dev";
|
|
2682
2682
|
|
|
2683
2683
|
// src/commands/serve.ts
|
|
2684
2684
|
var DEFAULT_PORT = 4321;
|
|
@@ -2789,7 +2789,7 @@ async function main() {
|
|
|
2789
2789
|
case "scan": {
|
|
2790
2790
|
const url = positionals[1];
|
|
2791
2791
|
if (!url) {
|
|
2792
|
-
console.error("
|
|
2792
|
+
console.error("A URL is required. Example: npx lazyscout scan http://localhost:5173");
|
|
2793
2793
|
process.exitCode = 1;
|
|
2794
2794
|
return;
|
|
2795
2795
|
}
|
|
@@ -2803,7 +2803,7 @@ async function main() {
|
|
|
2803
2803
|
return;
|
|
2804
2804
|
}
|
|
2805
2805
|
default:
|
|
2806
|
-
console.error(
|
|
2806
|
+
console.error(`Unknown command "${command}". Run npx lazyscout --help for usage.`);
|
|
2807
2807
|
process.exitCode = 1;
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|