@glubean/cli 0.1.2
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/bin/gb.js +2 -0
- package/dist/commands/init.d.ts +19 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +842 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +10 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +75 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/patch.d.ts +8 -0
- package/dist/commands/patch.d.ts.map +1 -0
- package/dist/commands/patch.js +73 -0
- package/dist/commands/patch.js.map +1 -0
- package/dist/commands/run.d.ts +26 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +1093 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/scan.d.ts +6 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +62 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/spec_split.d.ts +5 -0
- package/dist/commands/spec_split.d.ts.map +1 -0
- package/dist/commands/spec_split.js +56 -0
- package/dist/commands/spec_split.js.map +1 -0
- package/dist/commands/sync.d.ts +13 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +252 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/trigger.d.ts +13 -0
- package/dist/commands/trigger.d.ts.map +1 -0
- package/dist/commands/trigger.js +213 -0
- package/dist/commands/trigger.js.map +1 -0
- package/dist/commands/validate_metadata.d.ts +6 -0
- package/dist/commands/validate_metadata.d.ts.map +1 -0
- package/dist/commands/validate_metadata.js +103 -0
- package/dist/commands/validate_metadata.js.map +1 -0
- package/dist/commands/worker.d.ts +14 -0
- package/dist/commands/worker.d.ts.map +1 -0
- package/dist/commands/worker.js +10 -0
- package/dist/commands/worker.js.map +1 -0
- package/dist/lib/auth.d.ts +39 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +82 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/ci.d.ts +12 -0
- package/dist/lib/ci.d.ts.map +1 -0
- package/dist/lib/ci.js +42 -0
- package/dist/lib/ci.js.map +1 -0
- package/dist/lib/config.d.ts +116 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +264 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/constants.d.ts +6 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +6 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/env.d.ts +19 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/env.js +40 -0
- package/dist/lib/env.js.map +1 -0
- package/dist/lib/git.d.ts +8 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js +68 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/openapi_patch.d.ts +23 -0
- package/dist/lib/openapi_patch.d.ts.map +1 -0
- package/dist/lib/openapi_patch.js +232 -0
- package/dist/lib/openapi_patch.js.map +1 -0
- package/dist/lib/openapi_split.d.ts +16 -0
- package/dist/lib/openapi_split.d.ts.map +1 -0
- package/dist/lib/openapi_split.js +188 -0
- package/dist/lib/openapi_split.js.map +1 -0
- package/dist/lib/upload.d.ts +44 -0
- package/dist/lib/upload.d.ts.map +1 -0
- package/dist/lib/upload.js +297 -0
- package/dist/lib/upload.js.map +1 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +319 -0
- package/dist/main.js.map +1 -0
- package/dist/metadata.d.ts +17 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +61 -0
- package/dist/metadata.js.map +1 -0
- package/dist/update_check.d.ts +14 -0
- package/dist/update_check.d.ts.map +1 -0
- package/dist/update_check.js +130 -0
- package/dist/update_check.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +11 -0
- package/dist/version.js.map +1 -0
- package/package.json +34 -0
- package/templates/AI-INSTRUCTIONS.md +163 -0
- package/templates/README.md +226 -0
- package/templates/claude-skill-glubean-test.md +382 -0
- package/templates/data/create-user.json +14 -0
- package/templates/data/endpoints.csv +5 -0
- package/templates/data/scenarios.yaml +19 -0
- package/templates/data/search-examples.json +14 -0
- package/templates/data/users.json +17 -0
- package/templates/data-driven.test.ts.tpl +118 -0
- package/templates/demo.test.result.json +398 -0
- package/templates/demo.test.ts.tpl +226 -0
- package/templates/explore-api.test.result.json +79 -0
- package/templates/minimal/README.md +42 -0
- package/templates/minimal-api.test.ts.tpl +42 -0
- package/templates/minimal-auth.test.ts.tpl +45 -0
- package/templates/minimal-search.test.ts.tpl +34 -0
- package/templates/openapi.sample.json +97 -0
- package/templates/pick.test.result.json +165 -0
- package/templates/pick.test.ts.tpl +126 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data-driven API tests — generate many tests from external data files.
|
|
3
|
+
*
|
|
4
|
+
* Three patterns are shown:
|
|
5
|
+
*
|
|
6
|
+
* 1. JSON import (native) — simplest, no SDK helper needed
|
|
7
|
+
* 2. CSV loader — use fromCsv() for spreadsheet-style data
|
|
8
|
+
* 3. YAML loader — use fromYaml() for human-friendly data
|
|
9
|
+
*
|
|
10
|
+
* Each row in the data file becomes an independent test case.
|
|
11
|
+
* Use filter and tagFields for runtime control.
|
|
12
|
+
*
|
|
13
|
+
* Run: glubean run data-driven.test.ts
|
|
14
|
+
*/
|
|
15
|
+
import { fromCsv, fromYaml, test } from "@glubean/sdk";
|
|
16
|
+
|
|
17
|
+
// Import JSON data natively (recommended for JSON files)
|
|
18
|
+
import users from "../data/users.json" with { type: "json" };
|
|
19
|
+
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Pattern 1: JSON import → test.each
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* One test per user in users.json.
|
|
26
|
+
* tagFields auto-generates "role:admin", "role:user" etc. for filtering.
|
|
27
|
+
*
|
|
28
|
+
* Run only admin tests: glubean run data-driven.test.ts --tag role:admin
|
|
29
|
+
*/
|
|
30
|
+
export const userTests = test.each(users)(
|
|
31
|
+
{
|
|
32
|
+
id: "get-user-$id",
|
|
33
|
+
name: "GET /users/$id → $expected",
|
|
34
|
+
tags: "smoke",
|
|
35
|
+
tagFields: "role",
|
|
36
|
+
},
|
|
37
|
+
async (ctx, { id, expected }) => {
|
|
38
|
+
const baseUrl = ctx.vars.require("BASE_URL");
|
|
39
|
+
const res = await ctx.http.get(`${baseUrl}/users/${id}`);
|
|
40
|
+
|
|
41
|
+
// Fluent assertion — guard status before parsing body
|
|
42
|
+
ctx.expect(res.status).toBe(expected).orFail();
|
|
43
|
+
|
|
44
|
+
if (expected === 200) {
|
|
45
|
+
const data = await res.json();
|
|
46
|
+
|
|
47
|
+
// Soft assertions — all run even if one fails
|
|
48
|
+
ctx.expect(data.id).toBe(id);
|
|
49
|
+
ctx.expect(data).toHaveProperty("firstName");
|
|
50
|
+
ctx.expect(data).toHaveProperty("email");
|
|
51
|
+
|
|
52
|
+
ctx.log(`User: ${data.firstName} ${data.lastName} (${data.email})`);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// Pattern 2: CSV loader → test.each
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* One test per row in endpoints.csv.
|
|
63
|
+
* CSV values are always strings — cast as needed.
|
|
64
|
+
*/
|
|
65
|
+
export const endpointTests = test.each(
|
|
66
|
+
await fromCsv("./data/endpoints.csv"),
|
|
67
|
+
)(
|
|
68
|
+
{
|
|
69
|
+
id: "endpoint-$method-$path",
|
|
70
|
+
name: "$method $path → $expected",
|
|
71
|
+
tags: ["smoke", "endpoints"],
|
|
72
|
+
},
|
|
73
|
+
async (ctx, { method, path, expected }) => {
|
|
74
|
+
const baseUrl = ctx.vars.require("BASE_URL");
|
|
75
|
+
const res = await ctx.http.get(`${baseUrl}${path}`);
|
|
76
|
+
|
|
77
|
+
ctx.assert(
|
|
78
|
+
res.status === Number(expected),
|
|
79
|
+
`${method} ${path} should return ${expected}`,
|
|
80
|
+
{ actual: res.status, expected: Number(expected) },
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
// Pattern 3: YAML loader → test.each (builder mode)
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Multi-step test per scenario in scenarios.yaml.
|
|
91
|
+
* Builder mode gives you setup/steps/teardown with full metadata.
|
|
92
|
+
*/
|
|
93
|
+
export const scenarioTests = test.each(
|
|
94
|
+
await fromYaml("./data/scenarios.yaml"),
|
|
95
|
+
)(
|
|
96
|
+
{
|
|
97
|
+
id: "scenario-$id",
|
|
98
|
+
name: "$description",
|
|
99
|
+
tags: "scenario",
|
|
100
|
+
filter: (row) => !!row.path && !!row.expected,
|
|
101
|
+
},
|
|
102
|
+
)
|
|
103
|
+
.step("send request", async (ctx, _state, row) => {
|
|
104
|
+
const baseUrl = ctx.vars.require("BASE_URL");
|
|
105
|
+
const res = await ctx.http.get(`${baseUrl}${row.path}`);
|
|
106
|
+
|
|
107
|
+
ctx.assert(
|
|
108
|
+
res.status === row.expected,
|
|
109
|
+
`${row.method} ${row.path} should return ${row.expected}`,
|
|
110
|
+
{ actual: res.status, expected: row.expected },
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
return { status: res.status };
|
|
114
|
+
})
|
|
115
|
+
// deno-lint-ignore require-await
|
|
116
|
+
.step("log result", async (ctx, state, row) => {
|
|
117
|
+
ctx.log(`${row.method} ${row.path} → ${state.status}`);
|
|
118
|
+
});
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
{
|
|
2
|
+
"target": "/Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts",
|
|
3
|
+
"files": [
|
|
4
|
+
"packages/cli/templates/demo.test.ts"
|
|
5
|
+
],
|
|
6
|
+
"runAt": "2026-02-16 13:46:18",
|
|
7
|
+
"summary": {
|
|
8
|
+
"total": 6,
|
|
9
|
+
"passed": 0,
|
|
10
|
+
"failed": 6,
|
|
11
|
+
"skipped": 0,
|
|
12
|
+
"durationMs": 216,
|
|
13
|
+
"stats": {
|
|
14
|
+
"httpRequestTotal": 0,
|
|
15
|
+
"httpErrorTotal": 0,
|
|
16
|
+
"assertionTotal": 0,
|
|
17
|
+
"assertionFailed": 0,
|
|
18
|
+
"warningTotal": 0,
|
|
19
|
+
"warningTriggered": 0,
|
|
20
|
+
"stepTotal": 5,
|
|
21
|
+
"stepPassed": 0,
|
|
22
|
+
"stepFailed": 2
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"tests": [
|
|
26
|
+
{
|
|
27
|
+
"testId": "auth-flow",
|
|
28
|
+
"testName": "Authentication Flow",
|
|
29
|
+
"tags": [
|
|
30
|
+
"auth"
|
|
31
|
+
],
|
|
32
|
+
"success": false,
|
|
33
|
+
"durationMs": 39,
|
|
34
|
+
"events": [
|
|
35
|
+
{
|
|
36
|
+
"type": "log",
|
|
37
|
+
"message": "Loading test module: file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "start",
|
|
41
|
+
"id": "auth-flow",
|
|
42
|
+
"name": "Authentication Flow",
|
|
43
|
+
"tags": [
|
|
44
|
+
"auth"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "step_start",
|
|
49
|
+
"index": 0,
|
|
50
|
+
"name": "login",
|
|
51
|
+
"total": 3
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "step_end",
|
|
55
|
+
"index": 0,
|
|
56
|
+
"name": "login",
|
|
57
|
+
"status": "failed",
|
|
58
|
+
"durationMs": 0,
|
|
59
|
+
"assertions": 0,
|
|
60
|
+
"failedAssertions": 0,
|
|
61
|
+
"error": "Missing required var: BASE_URL"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"type": "step_end",
|
|
65
|
+
"index": 1,
|
|
66
|
+
"name": "get profile",
|
|
67
|
+
"status": "skipped",
|
|
68
|
+
"durationMs": 0,
|
|
69
|
+
"assertions": 0,
|
|
70
|
+
"failedAssertions": 0
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "step_end",
|
|
74
|
+
"index": 2,
|
|
75
|
+
"name": "refresh token",
|
|
76
|
+
"status": "skipped",
|
|
77
|
+
"durationMs": 0,
|
|
78
|
+
"assertions": 0,
|
|
79
|
+
"failedAssertions": 0
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"type": "summary",
|
|
83
|
+
"data": {
|
|
84
|
+
"httpRequestTotal": 0,
|
|
85
|
+
"httpErrorTotal": 0,
|
|
86
|
+
"httpErrorRate": 0,
|
|
87
|
+
"assertionTotal": 0,
|
|
88
|
+
"assertionFailed": 0,
|
|
89
|
+
"warningTotal": 0,
|
|
90
|
+
"warningTriggered": 0,
|
|
91
|
+
"schemaValidationTotal": 0,
|
|
92
|
+
"schemaValidationFailed": 0,
|
|
93
|
+
"schemaValidationWarnings": 0,
|
|
94
|
+
"stepTotal": 3,
|
|
95
|
+
"stepPassed": 0,
|
|
96
|
+
"stepFailed": 1,
|
|
97
|
+
"stepSkipped": 2
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "status",
|
|
102
|
+
"status": "failed",
|
|
103
|
+
"error": "One or more steps failed",
|
|
104
|
+
"stack": "Error: One or more steps failed\n at executeNewTest (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:1329:15)\n at async file:///Users/peisong/glubean/oss/packages/runner/harness.ts:971:5"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "error",
|
|
108
|
+
"message": "Process exited with code 1"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"testId": "cart-integrity",
|
|
114
|
+
"testName": "Cart Data Integrity",
|
|
115
|
+
"tags": [
|
|
116
|
+
"data-integrity"
|
|
117
|
+
],
|
|
118
|
+
"success": false,
|
|
119
|
+
"durationMs": 37,
|
|
120
|
+
"events": [
|
|
121
|
+
{
|
|
122
|
+
"type": "log",
|
|
123
|
+
"message": "Loading test module: file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "start",
|
|
127
|
+
"id": "cart-integrity",
|
|
128
|
+
"name": "Cart Data Integrity",
|
|
129
|
+
"tags": [
|
|
130
|
+
"data-integrity"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"type": "summary",
|
|
135
|
+
"data": {
|
|
136
|
+
"httpRequestTotal": 0,
|
|
137
|
+
"httpErrorTotal": 0,
|
|
138
|
+
"httpErrorRate": 0,
|
|
139
|
+
"assertionTotal": 0,
|
|
140
|
+
"assertionFailed": 0,
|
|
141
|
+
"warningTotal": 0,
|
|
142
|
+
"warningTriggered": 0,
|
|
143
|
+
"schemaValidationTotal": 0,
|
|
144
|
+
"schemaValidationFailed": 0,
|
|
145
|
+
"schemaValidationWarnings": 0,
|
|
146
|
+
"stepTotal": 0,
|
|
147
|
+
"stepPassed": 0,
|
|
148
|
+
"stepFailed": 0,
|
|
149
|
+
"stepSkipped": 0
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"type": "status",
|
|
154
|
+
"status": "failed",
|
|
155
|
+
"error": "Missing required var: BASE_URL",
|
|
156
|
+
"stack": "Error: Missing required var: BASE_URL\n at Object.require (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:360:15)\n at Object.fn (file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts:128:30)\n at executeNewTest (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:1192:18)\n at file:///Users/peisong/glubean/oss/packages/runner/harness.ts:971:11"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"type": "error",
|
|
160
|
+
"message": "Process exited with code 1"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"testId": "list-products",
|
|
166
|
+
"testName": "List Products",
|
|
167
|
+
"tags": [
|
|
168
|
+
"smoke"
|
|
169
|
+
],
|
|
170
|
+
"success": false,
|
|
171
|
+
"durationMs": 39,
|
|
172
|
+
"events": [
|
|
173
|
+
{
|
|
174
|
+
"type": "log",
|
|
175
|
+
"message": "Loading test module: file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"type": "start",
|
|
179
|
+
"id": "list-products",
|
|
180
|
+
"name": "List Products",
|
|
181
|
+
"tags": [
|
|
182
|
+
"smoke"
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"type": "summary",
|
|
187
|
+
"data": {
|
|
188
|
+
"httpRequestTotal": 0,
|
|
189
|
+
"httpErrorTotal": 0,
|
|
190
|
+
"httpErrorRate": 0,
|
|
191
|
+
"assertionTotal": 0,
|
|
192
|
+
"assertionFailed": 0,
|
|
193
|
+
"warningTotal": 0,
|
|
194
|
+
"warningTriggered": 0,
|
|
195
|
+
"schemaValidationTotal": 0,
|
|
196
|
+
"schemaValidationFailed": 0,
|
|
197
|
+
"schemaValidationWarnings": 0,
|
|
198
|
+
"stepTotal": 0,
|
|
199
|
+
"stepPassed": 0,
|
|
200
|
+
"stepFailed": 0,
|
|
201
|
+
"stepSkipped": 0
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"type": "status",
|
|
206
|
+
"status": "failed",
|
|
207
|
+
"error": "Missing required var: BASE_URL",
|
|
208
|
+
"stack": "Error: Missing required var: BASE_URL\n at Object.require (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:360:15)\n at Object.fn (file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts:21:30)\n at executeNewTest (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:1192:18)\n at file:///Users/peisong/glubean/oss/packages/runner/harness.ts:971:11"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "error",
|
|
212
|
+
"message": "Process exited with code 1"
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"testId": "pagination-check",
|
|
218
|
+
"testName": "Pagination Consistency",
|
|
219
|
+
"tags": [
|
|
220
|
+
"data"
|
|
221
|
+
],
|
|
222
|
+
"success": false,
|
|
223
|
+
"durationMs": 35,
|
|
224
|
+
"events": [
|
|
225
|
+
{
|
|
226
|
+
"type": "log",
|
|
227
|
+
"message": "Loading test module: file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"type": "start",
|
|
231
|
+
"id": "pagination-check",
|
|
232
|
+
"name": "Pagination Consistency",
|
|
233
|
+
"tags": [
|
|
234
|
+
"data"
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"type": "summary",
|
|
239
|
+
"data": {
|
|
240
|
+
"httpRequestTotal": 0,
|
|
241
|
+
"httpErrorTotal": 0,
|
|
242
|
+
"httpErrorRate": 0,
|
|
243
|
+
"assertionTotal": 0,
|
|
244
|
+
"assertionFailed": 0,
|
|
245
|
+
"warningTotal": 0,
|
|
246
|
+
"warningTriggered": 0,
|
|
247
|
+
"schemaValidationTotal": 0,
|
|
248
|
+
"schemaValidationFailed": 0,
|
|
249
|
+
"schemaValidationWarnings": 0,
|
|
250
|
+
"stepTotal": 0,
|
|
251
|
+
"stepPassed": 0,
|
|
252
|
+
"stepFailed": 0,
|
|
253
|
+
"stepSkipped": 0
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"type": "status",
|
|
258
|
+
"status": "failed",
|
|
259
|
+
"error": "Missing required var: BASE_URL",
|
|
260
|
+
"stack": "Error: Missing required var: BASE_URL\n at Object.require (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:360:15)\n at Object.fn (file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts:163:30)\n at executeNewTest (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:1192:18)\n at file:///Users/peisong/glubean/oss/packages/runner/harness.ts:971:11"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"type": "error",
|
|
264
|
+
"message": "Process exited with code 1"
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"testId": "search-products",
|
|
270
|
+
"testName": "Search Products",
|
|
271
|
+
"tags": [
|
|
272
|
+
"smoke"
|
|
273
|
+
],
|
|
274
|
+
"success": false,
|
|
275
|
+
"durationMs": 33,
|
|
276
|
+
"events": [
|
|
277
|
+
{
|
|
278
|
+
"type": "log",
|
|
279
|
+
"message": "Loading test module: file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"type": "start",
|
|
283
|
+
"id": "search-products",
|
|
284
|
+
"name": "Search Products",
|
|
285
|
+
"tags": [
|
|
286
|
+
"smoke"
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"type": "summary",
|
|
291
|
+
"data": {
|
|
292
|
+
"httpRequestTotal": 0,
|
|
293
|
+
"httpErrorTotal": 0,
|
|
294
|
+
"httpErrorRate": 0,
|
|
295
|
+
"assertionTotal": 0,
|
|
296
|
+
"assertionFailed": 0,
|
|
297
|
+
"warningTotal": 0,
|
|
298
|
+
"warningTriggered": 0,
|
|
299
|
+
"schemaValidationTotal": 0,
|
|
300
|
+
"schemaValidationFailed": 0,
|
|
301
|
+
"schemaValidationWarnings": 0,
|
|
302
|
+
"stepTotal": 0,
|
|
303
|
+
"stepPassed": 0,
|
|
304
|
+
"stepFailed": 0,
|
|
305
|
+
"stepSkipped": 0
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"type": "status",
|
|
310
|
+
"status": "failed",
|
|
311
|
+
"error": "Missing required var: BASE_URL",
|
|
312
|
+
"stack": "Error: Missing required var: BASE_URL\n at Object.require (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:360:15)\n at Object.fn (file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts:42:30)\n at executeNewTest (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:1192:18)\n at file:///Users/peisong/glubean/oss/packages/runner/harness.ts:971:11"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"type": "error",
|
|
316
|
+
"message": "Process exited with code 1"
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"testId": "user-todos-integrity",
|
|
322
|
+
"testName": "User Todos Cross-Resource",
|
|
323
|
+
"tags": [
|
|
324
|
+
"data-integrity"
|
|
325
|
+
],
|
|
326
|
+
"success": false,
|
|
327
|
+
"durationMs": 33,
|
|
328
|
+
"events": [
|
|
329
|
+
{
|
|
330
|
+
"type": "log",
|
|
331
|
+
"message": "Loading test module: file:///Users/peisong/glubean/oss/packages/cli/templates/demo.test.ts"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"type": "start",
|
|
335
|
+
"id": "user-todos-integrity",
|
|
336
|
+
"name": "User Todos Cross-Resource",
|
|
337
|
+
"tags": [
|
|
338
|
+
"data-integrity"
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"type": "step_start",
|
|
343
|
+
"index": 0,
|
|
344
|
+
"name": "fetch user",
|
|
345
|
+
"total": 2
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"type": "step_end",
|
|
349
|
+
"index": 0,
|
|
350
|
+
"name": "fetch user",
|
|
351
|
+
"status": "failed",
|
|
352
|
+
"durationMs": 0,
|
|
353
|
+
"assertions": 0,
|
|
354
|
+
"failedAssertions": 0,
|
|
355
|
+
"error": "Missing required var: BASE_URL"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"type": "step_end",
|
|
359
|
+
"index": 1,
|
|
360
|
+
"name": "verify todos",
|
|
361
|
+
"status": "skipped",
|
|
362
|
+
"durationMs": 0,
|
|
363
|
+
"assertions": 0,
|
|
364
|
+
"failedAssertions": 0
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"type": "summary",
|
|
368
|
+
"data": {
|
|
369
|
+
"httpRequestTotal": 0,
|
|
370
|
+
"httpErrorTotal": 0,
|
|
371
|
+
"httpErrorRate": 0,
|
|
372
|
+
"assertionTotal": 0,
|
|
373
|
+
"assertionFailed": 0,
|
|
374
|
+
"warningTotal": 0,
|
|
375
|
+
"warningTriggered": 0,
|
|
376
|
+
"schemaValidationTotal": 0,
|
|
377
|
+
"schemaValidationFailed": 0,
|
|
378
|
+
"schemaValidationWarnings": 0,
|
|
379
|
+
"stepTotal": 2,
|
|
380
|
+
"stepPassed": 0,
|
|
381
|
+
"stepFailed": 1,
|
|
382
|
+
"stepSkipped": 1
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"type": "status",
|
|
387
|
+
"status": "failed",
|
|
388
|
+
"error": "One or more steps failed",
|
|
389
|
+
"stack": "Error: One or more steps failed\n at executeNewTest (file:///Users/peisong/glubean/oss/packages/runner/harness.ts:1329:15)\n at async file:///Users/peisong/glubean/oss/packages/runner/harness.ts:971:5"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"type": "error",
|
|
393
|
+
"message": "Process exited with code 1"
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
]
|
|
398
|
+
}
|