@testcollab/cli 1.3.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/DEVELOPMENT.md +1 -1
- package/README.md +7 -7
- package/package.json +1 -1
- package/src/commands/createTestPlan.js +14 -8
package/DEVELOPMENT.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Command-line tools for syncing Gherkin feature files, running test plans, and uploading results to [TestCollab](https://testcollab.com).
|
|
4
4
|
|
|
5
5
|
```
|
|
6
|
-
npm install -g testcollab
|
|
6
|
+
npm install -g @testcollab/cli
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
@@ -232,7 +232,7 @@ jobs:
|
|
|
232
232
|
with:
|
|
233
233
|
node-version: '22'
|
|
234
234
|
|
|
235
|
-
- run: npm install -g testcollab
|
|
235
|
+
- run: npm install -g @testcollab/cli && npm ci
|
|
236
236
|
|
|
237
237
|
# Step 1: Create test plan with CI-tagged cases
|
|
238
238
|
- run: |
|
|
@@ -279,7 +279,7 @@ jobs:
|
|
|
279
279
|
with:
|
|
280
280
|
node-version: '22'
|
|
281
281
|
|
|
282
|
-
- run: npm install -g testcollab
|
|
282
|
+
- run: npm install -g @testcollab/cli
|
|
283
283
|
|
|
284
284
|
- run: tc sync --project ${{ secrets.TC_PROJECT_ID }}
|
|
285
285
|
env:
|
|
@@ -299,7 +299,7 @@ test-and-report:
|
|
|
299
299
|
variables:
|
|
300
300
|
TESTCOLLAB_TOKEN: $TESTCOLLAB_TOKEN
|
|
301
301
|
before_script:
|
|
302
|
-
- npm install -g testcollab
|
|
302
|
+
- npm install -g @testcollab/cli && npm ci
|
|
303
303
|
script:
|
|
304
304
|
- tc createTestPlan --project $TC_PROJECT_ID --ci-tag-id $TC_CI_TAG_ID --assignee-id $TC_ASSIGNEE_ID
|
|
305
305
|
- export $(cat tmp/tc_test_plan)
|
|
@@ -314,7 +314,7 @@ sync-features:
|
|
|
314
314
|
stage: test
|
|
315
315
|
image: node:22
|
|
316
316
|
before_script:
|
|
317
|
-
- npm install -g testcollab
|
|
317
|
+
- npm install -g @testcollab/cli
|
|
318
318
|
script:
|
|
319
319
|
- tc sync --project $TC_PROJECT_ID
|
|
320
320
|
variables:
|
|
@@ -357,11 +357,11 @@ sync-features:
|
|
|
357
357
|
|
|
358
358
|
```bash
|
|
359
359
|
# Global (recommended)
|
|
360
|
-
npm install -g testcollab
|
|
360
|
+
npm install -g @testcollab/cli
|
|
361
361
|
tc sync --project 123
|
|
362
362
|
|
|
363
363
|
# Local (per-project)
|
|
364
|
-
npm install testcollab
|
|
364
|
+
npm install @testcollab/cli --save-dev
|
|
365
365
|
npx tc sync --project 123
|
|
366
366
|
```
|
|
367
367
|
|
package/package.json
CHANGED
|
@@ -118,18 +118,25 @@ export async function createTestPlan(options) {
|
|
|
118
118
|
|
|
119
119
|
console.log('validating project and other details...');
|
|
120
120
|
try {
|
|
121
|
-
const projectResponse = await projectsApi.
|
|
122
|
-
|
|
123
|
-
id: parsedProjectId
|
|
124
|
-
})
|
|
121
|
+
const projectResponse = await projectsApi.getProject({
|
|
122
|
+
id: parsedProjectId
|
|
125
123
|
});
|
|
126
|
-
if(!projectResponse || !projectResponse.
|
|
124
|
+
if (!projectResponse || !projectResponse.id || projectResponse.id !== parsedProjectId) {
|
|
127
125
|
console.error('❌ Error: Project not found. Ensure you have access to this project.');
|
|
128
126
|
process.exit(1);
|
|
129
127
|
}
|
|
130
128
|
} catch (e) {
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
if (e && typeof e === 'object' && 'status' in e && 'text' in e) {
|
|
130
|
+
try {
|
|
131
|
+
const bodyText = await e.text();
|
|
132
|
+
console.error(`❌ Error: Failed to validate project (HTTP ${e.status} ${e.statusText || ''}${bodyText ? ` - ${bodyText}` : ''})`);
|
|
133
|
+
} catch {
|
|
134
|
+
console.error(`❌ Error: Failed to validate project (HTTP ${e.status} ${e.statusText || ''})`);
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
const message = e?.message || String(e);
|
|
138
|
+
console.error(`❌ Error: Failed to validate project (${message})`);
|
|
139
|
+
}
|
|
133
140
|
process.exit(1);
|
|
134
141
|
}
|
|
135
142
|
|
|
@@ -256,4 +263,3 @@ export async function createTestPlan(options) {
|
|
|
256
263
|
}
|
|
257
264
|
}
|
|
258
265
|
|
|
259
|
-
|