@msalaam/xray-qe-toolkit 1.3.3 → 1.3.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/commands/genPipeline.js +6 -3
- package/commands/init.js +3 -3
- package/package.json +1 -1
- package/templates/README.template.md +6 -12
- package/templates/azure-pipelines.yml +31 -12
package/commands/genPipeline.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Command: xray-qe gen-pipeline [--output <path>]
|
|
3
3
|
*
|
|
4
4
|
* Copies the Azure Pipelines YAML template into the consuming project.
|
|
5
|
-
* The template runs
|
|
5
|
+
* The template runs Playwright and imports JSON results — no QE logic in CI.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import fs from "node:fs";
|
|
@@ -34,8 +34,11 @@ export default async function genPipeline(opts = {}) {
|
|
|
34
34
|
console.log(" 1. Set pipeline variables in Azure DevOps:");
|
|
35
35
|
console.log(" XRAY_ID, XRAY_SECRET, JIRA_PROJECT_KEY, JIRA_URL,");
|
|
36
36
|
console.log(" JIRA_API_TOKEN, JIRA_EMAIL, TEST_EXEC_KEY");
|
|
37
|
-
console.log(" 2.
|
|
38
|
-
console.log(" 3.
|
|
37
|
+
console.log(" 2. Optionally set API_BASE_URL for Playwright tests");
|
|
38
|
+
console.log(" 3. Commit the generated file to your repo");
|
|
39
|
+
console.log(" 4. Create a pipeline in Azure DevOps pointing to this YAML");
|
|
40
|
+
console.log(" 5. Playwright tests must have xray annotations to map results:");
|
|
41
|
+
console.log(" test.info().annotations.push({ type: 'xray', description: 'PROJ-123' })");
|
|
39
42
|
console.log("");
|
|
40
43
|
console.log("⚠️ Remember: edit-json and QE review gates are NOT part of CI.");
|
|
41
44
|
console.log(" Run those steps locally before committing.\n");
|
package/commands/init.js
CHANGED
|
@@ -114,7 +114,7 @@ export default async function init(opts = {}) {
|
|
|
114
114
|
const xrayrc = {
|
|
115
115
|
testsPath: "tests.json",
|
|
116
116
|
mappingPath: "xray-mapping.json",
|
|
117
|
-
|
|
117
|
+
playwrightResultsPath: "playwright-results.json",
|
|
118
118
|
knowledgePath: "knowledge",
|
|
119
119
|
playwrightDir: "playwright-tests",
|
|
120
120
|
};
|
|
@@ -136,7 +136,7 @@ export default async function init(opts = {}) {
|
|
|
136
136
|
console.log(" 4. Generate test cases: npx xray-qe gen-tests --ai (or edit tests.json manually)");
|
|
137
137
|
console.log(" 5. Review tests: npx xray-qe edit-json");
|
|
138
138
|
console.log(" 6. Push tests to Xray: npx xray-qe push-tests");
|
|
139
|
-
console.log(" 7. Generate
|
|
140
|
-
console.log(" 8.
|
|
139
|
+
console.log(" 7. Generate CI pipeline: npx xqt gen-pipeline");
|
|
140
|
+
console.log(" 8. Run Playwright tests and import results: npx xqt import-results --file playwright-results.json");
|
|
141
141
|
console.log("");
|
|
142
142
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@msalaam/xray-qe-toolkit",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Full QE workflow toolkit for Xray Cloud integration — test management, Postman generation, CI pipeline scaffolding, and browser-based review gates for API regression projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -63,13 +63,7 @@ npx xqt edit-json
|
|
|
63
63
|
npx xqt push-tests
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
### 5.
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npx xqt gen-postman
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### 6. Set Up CI Pipeline
|
|
66
|
+
### 5. Set Up CI Pipeline
|
|
73
67
|
|
|
74
68
|
```bash
|
|
75
69
|
# Generate Azure Pipelines template
|
|
@@ -84,10 +78,9 @@ npx xqt gen-pipeline
|
|
|
84
78
|
| `npx xqt gen-tests` | Generate test cases from knowledge/ |
|
|
85
79
|
| `npx xqt edit-json` | Review/edit tests in browser |
|
|
86
80
|
| `npx xqt push-tests` | Push tests to Xray Cloud |
|
|
87
|
-
| `npx xqt gen-postman` | Generate Postman collection |
|
|
88
81
|
| `npx xqt gen-pipeline` | Generate CI pipeline template |
|
|
89
82
|
| `npx xqt create-execution` | Create Test Execution issue |
|
|
90
|
-
| `npx xqt import-results` | Import
|
|
83
|
+
| `npx xqt import-results` | Import Playwright JSON results (CI) |
|
|
91
84
|
|
|
92
85
|
Run any command with `--help` for details:
|
|
93
86
|
```bash
|
|
@@ -101,8 +94,9 @@ npx xqt gen-tests --help
|
|
|
101
94
|
2. Generate tests (AI or manual)
|
|
102
95
|
3. Review in edit-json
|
|
103
96
|
4. Push to Xray
|
|
104
|
-
5. Generate
|
|
105
|
-
6. Run in CI
|
|
97
|
+
5. Generate CI pipeline: npx xqt gen-pipeline
|
|
98
|
+
6. Run Playwright tests in CI
|
|
99
|
+
7. Import results: npx xqt import-results --file playwright-results.json
|
|
106
100
|
```
|
|
107
101
|
|
|
108
102
|
## Files
|
|
@@ -111,7 +105,7 @@ npx xqt gen-tests --help
|
|
|
111
105
|
|------|---------|
|
|
112
106
|
| `tests.json` | Test definitions (source of truth) |
|
|
113
107
|
| `xray-mapping.json` | Maps test IDs to JIRA keys |
|
|
114
|
-
| `
|
|
108
|
+
| `playwright-results.json` | Playwright JSON report (CI output) |
|
|
115
109
|
| `.env` | Credentials (DO NOT COMMIT) |
|
|
116
110
|
| `.xrayrc` | Project config |
|
|
117
111
|
| `knowledge/` | API specs and requirements |
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# Generated by @msalaam/xray-qe-toolkit
|
|
4
4
|
# ──────────────────────────────────────────────────────────────
|
|
5
5
|
#
|
|
6
|
-
# This pipeline runs
|
|
7
|
-
#
|
|
6
|
+
# This pipeline runs Playwright tests and imports the JSON results
|
|
7
|
+
# into Xray Cloud via xqt import-results.
|
|
8
8
|
#
|
|
9
9
|
# IMPORTANT: edit-json and QE review gates are NOT part of CI.
|
|
10
10
|
# Those steps must be run locally before committing.
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
# Required pipeline variables (set in Azure DevOps UI → Variables):
|
|
13
13
|
# XRAY_ID, XRAY_SECRET, JIRA_PROJECT_KEY, JIRA_URL,
|
|
14
14
|
# JIRA_API_TOKEN, JIRA_EMAIL, TEST_EXEC_KEY
|
|
15
|
+
#
|
|
16
|
+
# Optional pipeline variables:
|
|
17
|
+
# API_BASE_URL — base URL passed to Playwright tests
|
|
15
18
|
# ──────────────────────────────────────────────────────────────
|
|
16
19
|
|
|
17
20
|
trigger:
|
|
@@ -24,7 +27,7 @@ pool:
|
|
|
24
27
|
vmImage: "ubuntu-latest"
|
|
25
28
|
|
|
26
29
|
variables:
|
|
27
|
-
NODE_VERSION: "
|
|
30
|
+
NODE_VERSION: "20.x"
|
|
28
31
|
|
|
29
32
|
steps:
|
|
30
33
|
- task: NodeTool@0
|
|
@@ -37,17 +40,24 @@ steps:
|
|
|
37
40
|
displayName: "Install dependencies"
|
|
38
41
|
|
|
39
42
|
- script: |
|
|
40
|
-
npx
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
npx playwright install --with-deps chromium
|
|
44
|
+
displayName: "Install Playwright browsers"
|
|
45
|
+
|
|
46
|
+
- script: |
|
|
47
|
+
npx playwright test \
|
|
48
|
+
--reporter=list,json \
|
|
49
|
+
--output=playwright-results
|
|
50
|
+
displayName: "Run Playwright tests"
|
|
51
|
+
continueOnError: true
|
|
52
|
+
env:
|
|
53
|
+
PLAYWRIGHT_JSON_OUTPUT_NAME: playwright-results.json
|
|
54
|
+
API_BASE_URL: $(API_BASE_URL)
|
|
45
55
|
|
|
46
56
|
- script: |
|
|
47
57
|
npx xqt import-results \
|
|
48
|
-
--file results.
|
|
58
|
+
--file playwright-results.json \
|
|
49
59
|
--testExecKey $(TEST_EXEC_KEY)
|
|
50
|
-
displayName: "Import results to Xray"
|
|
60
|
+
displayName: "Import Playwright results to Xray"
|
|
51
61
|
env:
|
|
52
62
|
XRAY_ID: $(XRAY_ID)
|
|
53
63
|
XRAY_SECRET: $(XRAY_SECRET)
|
|
@@ -57,9 +67,18 @@ steps:
|
|
|
57
67
|
JIRA_EMAIL: $(JIRA_EMAIL)
|
|
58
68
|
|
|
59
69
|
- task: PublishTestResults@2
|
|
60
|
-
displayName: "Publish JUnit results"
|
|
70
|
+
displayName: "Publish Playwright JUnit results"
|
|
71
|
+
condition: always()
|
|
61
72
|
inputs:
|
|
62
73
|
testResultsFormat: "JUnit"
|
|
63
|
-
testResultsFiles: "results.xml"
|
|
74
|
+
testResultsFiles: "playwright-results/results.xml"
|
|
64
75
|
mergeTestResults: true
|
|
65
76
|
failTaskOnFailedTests: true
|
|
77
|
+
|
|
78
|
+
- task: PublishPipelineArtifact@1
|
|
79
|
+
displayName: "Upload Playwright HTML report"
|
|
80
|
+
condition: always()
|
|
81
|
+
inputs:
|
|
82
|
+
targetPath: "playwright-report"
|
|
83
|
+
artifact: "playwright-report"
|
|
84
|
+
publishLocation: "pipeline"
|