@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testcollab/cli",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Command-line interface for TestCollab operations",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -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
- return extractTestCaseIdFromTitle(testTitle) || extractTestCaseIdFromTitle(fullTitle);
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