@msalaam/xray-qe-toolkit 1.4.0 → 1.5.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@msalaam/xray-qe-toolkit",
3
- "version": "1.4.0",
4
- "description": "Full QE workflow toolkit for Xray Cloud integration — test management, Playwright integration, CI pipeline scaffolding, and browser-based review gates for API regression projects.",
3
+ "version": "1.5.0",
4
+ "description": "QE toolkit for Xray Cloud — test management, tests.json standardisation, Playwright result import, and CI pipeline integration.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "xqt": "./bin/cli.js"
@@ -23,22 +23,20 @@
23
23
  "xray-cloud",
24
24
  "test-automation",
25
25
  "jira-integration",
26
- "postman",
27
- "newman",
28
26
  "qe-toolkit",
29
27
  "regression"
30
28
  ],
31
29
  "author": "@Muhaymien96 <muhaymien96@gmail.com>",
32
30
  "license": "UNLICENSED",
33
31
  "dependencies": {
32
+ "@modelcontextprotocol/sdk": "^1.27.1",
34
33
  "axios": "^1.13.4",
35
34
  "commander": "^13.1.0",
36
35
  "dotenv": "^17.2.3",
37
36
  "express": "^5.1.0",
38
- "fs-extra": "^11.3.3",
39
- "open": "^10.1.2",
40
- "openapi-diff": "^0.24.1",
41
- "yaml": "^2.8.2"
37
+ "form-data": "^4.0.1",
38
+ "js-yaml": "^4.1.1",
39
+ "open": "^10.1.2"
42
40
  },
43
41
  "devDependencies": {
44
42
  "ajv": "^8.17.1"
@@ -0,0 +1,110 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://schemas.xqt.io/business-rules.yaml",
4
+ "title": "XQT Business Rules",
5
+ "description": "Schema for business-rules.yaml files used as input to the spec-driven test generation pipeline.",
6
+ "type": "object",
7
+ "required": ["service", "version", "features"],
8
+ "properties": {
9
+ "service": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "description": "Service or microservice name. Should match the repository/package name."
13
+ },
14
+ "version": {
15
+ "type": "string",
16
+ "description": "Semantic version of this rules document (e.g. '1.0' or '1.2.3')."
17
+ },
18
+ "features": {
19
+ "type": "array",
20
+ "minItems": 1,
21
+ "description": "List of features/modules in this service.",
22
+ "items": {
23
+ "type": "object",
24
+ "required": ["name", "rules"],
25
+ "properties": {
26
+ "name": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "description": "Feature or module name (e.g. 'Authentication', 'Order Management')."
30
+ },
31
+ "endpoints": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string",
35
+ "description": "HTTP method + path (e.g. 'GET /api/v1/orders', 'POST /auth/login')."
36
+ },
37
+ "description": "API endpoints covered by the rules in this feature."
38
+ },
39
+ "rules": {
40
+ "type": "array",
41
+ "minItems": 1,
42
+ "description": "Individual business rules. Each rule should produce one or more test cases.",
43
+ "items": {
44
+ "type": "object",
45
+ "required": ["id", "description", "given", "when", "then", "category", "priority"],
46
+ "properties": {
47
+ "id": {
48
+ "type": "string",
49
+ "pattern": "^BR-[0-9]{3,}$",
50
+ "description": "Unique rule identifier (e.g. BR-001). Used to trace rules ↔ tests."
51
+ },
52
+ "description": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "description": "Brief description of what this rule enforces."
56
+ },
57
+ "given": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "description": "Precondition / system state before the test action."
61
+ },
62
+ "when": {
63
+ "type": "string",
64
+ "minLength": 1,
65
+ "description": "The action performed (API call, user interaction, event)."
66
+ },
67
+ "then": {
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "description": "Expected outcome / assertion."
71
+ },
72
+ "category": {
73
+ "type": "string",
74
+ "enum": ["validation", "authorization", "business-logic", "edge-case", "integration", "security", "performance"],
75
+ "description": "Rule category for grouping and filtering."
76
+ },
77
+ "priority": {
78
+ "type": "string",
79
+ "enum": ["Highest", "High", "Medium", "Low", "Lowest"],
80
+ "description": "Test priority — maps directly to JIRA/Xray priority field."
81
+ },
82
+ "tags": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "string",
86
+ "enum": ["regression", "smoke", "edge", "critical", "integration", "e2e", "security", "performance"]
87
+ },
88
+ "description": "Tags to apply to the generated test case."
89
+ },
90
+ "requirementKeys": {
91
+ "type": "array",
92
+ "items": {
93
+ "type": "string",
94
+ "pattern": "^[A-Z][A-Z0-9_]+-[0-9]+$"
95
+ },
96
+ "description": "JIRA requirement keys this rule covers. Propagated to the generated test's requirementKeys."
97
+ },
98
+ "skip": {
99
+ "type": "boolean",
100
+ "default": false,
101
+ "description": "If true, this rule will not generate a test case."
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
@@ -1,24 +1,23 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://oldmutual.com/schemas/xray-qe-toolkit/tests.json",
3
+ "$id": "https://schemas.xqt.io/tests.json",
4
4
  "title": "XQT Test Configuration",
5
- "description": "Schema for @msalaam/xray-qe-toolkit tests.json files. Defines test cases to push to Xray Cloud.",
5
+ "description": "Schema for @msalaam/xray-qe-toolkit tests.json files. Defines test cases to push to Xray Cloud. Execution is decoupled — tests are organised under a Test Plan; each CI run creates a new Test Execution.",
6
6
  "type": "object",
7
7
  "required": ["tests"],
8
8
  "properties": {
9
- "testExecution": {
9
+ "testPlan": {
10
10
  "type": "object",
11
- "description": "Configuration for the Test Execution issue created in JIRA.",
12
- "required": ["summary"],
11
+ "description": "The Xray Test Plan that owns all tests in this file. Tests pushed via push-tests will be added to this plan automatically.",
13
12
  "properties": {
14
- "summary": {
13
+ "key": {
15
14
  "type": "string",
16
- "minLength": 1,
17
- "description": "Summary/title for the Test Execution issue."
15
+ "pattern": "^[A-Z][A-Z0-9_]+-[0-9]+$",
16
+ "description": "Existing Xray Test Plan issue key (e.g. PROJ-42). Leave empty and run create-plan to generate one."
18
17
  },
19
- "description": {
18
+ "summary": {
20
19
  "type": "string",
21
- "description": "Description for the Test Execution issue."
20
+ "description": "Human-readable name for this test plan (used when displaying status)."
22
21
  }
23
22
  }
24
23
  },
@@ -39,21 +38,38 @@
39
38
  "skip": {
40
39
  "type": "boolean",
41
40
  "default": false,
42
- "description": "If true, this test will be excluded from push-tests."
41
+ "description": "If true, this test will be excluded from push-tests and import-results."
43
42
  },
44
43
  "tags": {
45
44
  "type": "array",
46
45
  "items": {
47
46
  "type": "string",
48
- "enum": ["regression", "smoke", "edge", "critical", "integration", "e2e", "security", "performance"]
47
+ "enum": ["regression", "smoke", "edge", "critical", "integration", "e2e", "security", "performance", "contract", "functional", "negative", "positive", "boundary", "acceptance", "sanity", "data-driven", "exploratory", "accessibility"]
49
48
  },
50
- "description": "QE-assigned tags for categorisation. Set via edit-json UI."
49
+ "description": "QE-assigned tags for categorisation. Also used as labels on the Xray Test issue."
51
50
  },
52
51
  "type": {
53
52
  "type": "string",
54
53
  "enum": ["api", "ui", "e2e"],
55
54
  "default": "api",
56
- "description": "Test type: 'api' for API tests (Postman), 'ui' for UI tests (Playwright), 'e2e' for end-to-end. Determines which generator applies."
55
+ "description": "Test type: api | ui | e2e. Informational used for filtering and generation."
56
+ },
57
+ "folder": {
58
+ "type": "string",
59
+ "description": "Xray Test Repository folder path for this test (e.g. /API/Auth or /API/Payments). Synced by sync-folders command.",
60
+ "pattern": "^/"
61
+ },
62
+ "testSet": {
63
+ "type": "string",
64
+ "description": "Name of the Xray Test Set this test belongs to. Tests sharing the same value are grouped into a single Test Set issue in JIRA. xqt push creates the Test Set automatically if it doesn't exist and adds the test to it. Test Set → JIRA key mappings are stored in xray-mapping.json under _testSets."
65
+ },
66
+ "requirementKeys": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "string",
70
+ "pattern": "^[A-Z][A-Z0-9_]+-[0-9]+$"
71
+ },
72
+ "description": "JIRA issue keys of requirements covered by this test (e.g. [\"PROJ-10\", \"PROJ-11\"]). Creates coverage links in Xray."
57
73
  },
58
74
  "xray": {
59
75
  "type": "object",
@@ -69,6 +85,16 @@
69
85
  "type": "string",
70
86
  "description": "JIRA issue description."
71
87
  },
88
+ "testType": {
89
+ "type": "string",
90
+ "enum": ["Generic", "Manual", "Cucumber"],
91
+ "default": "Generic",
92
+ "description": "Xray test type. Generic = automated/unstructured. Manual = step-by-step. Cucumber = BDD."
93
+ },
94
+ "definition": {
95
+ "type": "string",
96
+ "description": "Generic/automated test definition (fully-qualified test name or description). Used for Generic type tests."
97
+ },
72
98
  "priority": {
73
99
  "type": "string",
74
100
  "enum": ["Highest", "High", "Medium", "Low", "Lowest"],
@@ -77,11 +103,11 @@
77
103
  "labels": {
78
104
  "type": "array",
79
105
  "items": { "type": "string" },
80
- "description": "JIRA labels for the test issue."
106
+ "description": "JIRA labels for the test issue. Tags are automatically merged into this list."
81
107
  },
82
108
  "steps": {
83
109
  "type": "array",
84
- "description": "Ordered test steps.",
110
+ "description": "Ordered test steps. Dual purpose: (1) uploaded to Xray as Manual test steps visible in JIRA, (2) used by code generators to scaffold Playwright test bodies. Required when testType is Manual.",
85
111
  "items": {
86
112
  "type": "object",
87
113
  "required": ["action", "expected_result"],
@@ -89,21 +115,121 @@
89
115
  "action": {
90
116
  "type": "string",
91
117
  "minLength": 1,
92
- "description": "What action to perform."
118
+ "description": "Human-readable description of the action (e.g. 'Send GET /v1/path/{param} with a valid value'). Used as the step title in Xray and as a generation hint."
93
119
  },
94
120
  "data": {
95
121
  "type": "string",
96
- "description": "Input data or parameters for the step."
122
+ "description": "Input data or environment variable references for the step (e.g. 'clientNo: env.TEST_CLIENT_NO')."
97
123
  },
98
124
  "expected_result": {
99
125
  "type": "string",
100
126
  "minLength": 1,
101
- "description": "Expected outcome of the step."
127
+ "description": "Expected outcome (e.g. 'HTTP 200, Content-Type: application/json, body matches MySchema')."
102
128
  }
103
129
  }
104
130
  }
105
131
  }
106
132
  }
133
+ },
134
+ "spec": {
135
+ "type": "object",
136
+ "description": "Structured test specification used for Playwright test code generation. Contains the operation, expected response values, and input data hints.",
137
+ "properties": {
138
+ "operation": {
139
+ "type": "object",
140
+ "required": ["method", "path"],
141
+ "properties": {
142
+ "method": {
143
+ "type": "string",
144
+ "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"],
145
+ "description": "HTTP method."
146
+ },
147
+ "path": {
148
+ "type": "string",
149
+ "description": "API path, with path parameters in {curly} notation (e.g. /v1/resource/{id})."
150
+ },
151
+ "operationId": {
152
+ "type": "string",
153
+ "description": "OpenAPI operationId for traceability."
154
+ }
155
+ }
156
+ },
157
+ "expectations": {
158
+ "type": "object",
159
+ "description": "Expected response values used to generate assertions.",
160
+ "properties": {
161
+ "statusCodes": {
162
+ "type": "array",
163
+ "items": { "type": "integer" },
164
+ "description": "List of acceptable HTTP status codes."
165
+ },
166
+ "contentType": {
167
+ "type": "string",
168
+ "description": "Expected Content-Type header value."
169
+ },
170
+ "responseSchemaHints": {
171
+ "type": "array",
172
+ "items": { "type": "string" },
173
+ "description": "OpenAPI schema refs for the expected response body (e.g. ['#/components/schemas/MyResponse'])."
174
+ }
175
+ }
176
+ },
177
+ "dataHints": {
178
+ "type": "object",
179
+ "description": "Input data hints used to scaffold test fixtures and parameter substitution.",
180
+ "properties": {
181
+ "pathParams": {
182
+ "type": "array",
183
+ "items": { "type": "string" },
184
+ "description": "Names of path parameters (matched to env[] values by convention)."
185
+ },
186
+ "queryParams": {
187
+ "type": "array",
188
+ "items": { "type": "string" },
189
+ "description": "Names of query parameters."
190
+ },
191
+ "body": {
192
+ "type": "string",
193
+ "description": "Request body description or JSON schema ref (empty string for no body)."
194
+ },
195
+ "env": {
196
+ "type": "array",
197
+ "items": { "type": "string" },
198
+ "description": "Environment variable names required to run the test (e.g. ['TEST_CLIENT_NO'])."
199
+ }
200
+ }
201
+ }
202
+ }
203
+ },
204
+ "contract": {
205
+ "type": "object",
206
+ "description": "OpenAPI contract validation specifics. Only required when testKind is 'contract'.",
207
+ "properties": {
208
+ "operationId": {
209
+ "type": "string",
210
+ "description": "OpenAPI operationId this contract test covers."
211
+ },
212
+ "expectedStatus": {
213
+ "type": "integer",
214
+ "description": "HTTP status code the contract expects."
215
+ },
216
+ "expectedContentType": {
217
+ "type": "string",
218
+ "description": "Expected Content-Type header."
219
+ },
220
+ "responseSchemaRef": {
221
+ "type": "string",
222
+ "description": "OpenAPI schema $ref for the response body (e.g. '#/components/schemas/MyResponse')."
223
+ },
224
+ "validationScope": {
225
+ "type": "array",
226
+ "items": {
227
+ "type": "string",
228
+ "enum": ["status-code", "content-type", "required-fields", "type-checks", "headers"]
229
+ },
230
+ "description": "Which contract assertions to enforce."
231
+ }
232
+ }
107
233
  }
108
234
  }
109
235
  }