@testcollab/cli 1.5.0 → 1.6.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 +1 -1
- package/src/commands/report.js +8 -1
package/package.json
CHANGED
package/src/commands/report.js
CHANGED
|
@@ -216,7 +216,8 @@ export function extractTestCaseIdFromTitle(title) {
|
|
|
216
216
|
function extractTestCaseIdFromMochawesomeTest(testData) {
|
|
217
217
|
const testTitle = String(testData?.title || '').trim();
|
|
218
218
|
const fullTitle = String(testData?.fullTitle || '').trim();
|
|
219
|
-
|
|
219
|
+
// Prefer fullTitle because some reporters shorten `title` and keep the canonical ID in fullTitle.
|
|
220
|
+
return extractTestCaseIdFromTitle(fullTitle) || extractTestCaseIdFromTitle(testTitle);
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
function prepareMochawesomeRunRecord(testData) {
|
|
@@ -527,6 +528,7 @@ class TcApiClient {
|
|
|
527
528
|
buildUrl(endpoint) {
|
|
528
529
|
const normalized = endpoint.startsWith('/') ? endpoint : `/${endpoint}`;
|
|
529
530
|
const separator = normalized.includes('?') ? '&' : '?';
|
|
531
|
+
// console.log("build url", `${this.baseApiUrl}${normalized}${separator}token=${encodeURIComponent(this.accessToken)}`);
|
|
530
532
|
return `${this.baseApiUrl}${normalized}${separator}token=${encodeURIComponent(this.accessToken)}`;
|
|
531
533
|
}
|
|
532
534
|
|
|
@@ -871,6 +873,11 @@ async function uploadUsingReporterFlow({
|
|
|
871
873
|
|
|
872
874
|
await tcApiInstance.getTestplanConfigs();
|
|
873
875
|
|
|
876
|
+
const userData = await tcApiInstance.getUserInfo();
|
|
877
|
+
if (!userData || !userData.id) {
|
|
878
|
+
throw new Error('User could not be fetched for this API key.');
|
|
879
|
+
}
|
|
880
|
+
|
|
874
881
|
const casesAssigned = await tcApiInstance.getAssignedCases();
|
|
875
882
|
console.log({ 'Total assigned cases found': Array.isArray(casesAssigned) ? casesAssigned.length : 0 });
|
|
876
883
|
|