@uipath/test-manager-tool 1.199.0-preview.104 → 1.199.0-preview.106

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.
Files changed (2) hide show
  1. package/dist/tool.js +541 -68
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -30309,7 +30309,7 @@ var require_lib3 = __commonJS((exports, module) => {
30309
30309
  var package_default = {
30310
30310
  name: "@uipath/test-manager-tool",
30311
30311
  license: "MIT",
30312
- version: "1.199.0-preview.104",
30312
+ version: "1.199.0-preview.106",
30313
30313
  description: "Manage test cases, test sets, executions, and results.",
30314
30314
  private: false,
30315
30315
  repository: {
@@ -39287,38 +39287,6 @@ function UiPathTestManagementHubCommonEnumsRobotTypeToJSON(value) {
39287
39287
  return value;
39288
39288
  }
39289
39289
 
39290
- // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceState.ts
39291
- function UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSON(json2) {
39292
- return UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSONTyped(json2, false);
39293
- }
39294
- function UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSONTyped(json2, ignoreDiscriminator) {
39295
- return json2;
39296
- }
39297
-
39298
- // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsDTOsObjectGovernanceDto.ts
39299
- function UiPathTestManagementHubTestManagementAbstractionsDTOsObjectGovernanceDtoFromJSON(json2) {
39300
- return UiPathTestManagementHubTestManagementAbstractionsDTOsObjectGovernanceDtoFromJSONTyped(json2, false);
39301
- }
39302
- function UiPathTestManagementHubTestManagementAbstractionsDTOsObjectGovernanceDtoFromJSONTyped(json2, ignoreDiscriminator) {
39303
- if (json2 == null) {
39304
- return json2;
39305
- }
39306
- return {
39307
- id: json2["id"] == null ? undefined : json2["id"],
39308
- objectId: json2["objectId"] == null ? undefined : json2["objectId"],
39309
- objectType: json2["objectType"] == null ? undefined : UiPathTestManagementHubCommonEnumsObjectTypeFromJSON(json2["objectType"]),
39310
- tenantId: json2["tenantId"] == null ? undefined : json2["tenantId"],
39311
- projectId: json2["projectId"] == null ? undefined : json2["projectId"],
39312
- state: json2["state"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSON(json2["state"]),
39313
- created: json2["created"] == null ? undefined : new Date(json2["created"]),
39314
- updated: json2["updated"] == null ? undefined : new Date(json2["updated"]),
39315
- totalSignaturesRequired: json2["totalSignaturesRequired"] == null ? undefined : json2["totalSignaturesRequired"],
39316
- totalSignaturesReceived: json2["totalSignaturesReceived"] == null ? undefined : json2["totalSignaturesReceived"],
39317
- allowedExplicitNextStates: json2["allowedExplicitNextStates"] == null ? undefined : json2["allowedExplicitNextStates"].map(UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSON),
39318
- isLocked: json2["isLocked"] == null ? undefined : json2["isLocked"]
39319
- };
39320
- }
39321
-
39322
39290
  // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubCommonEnumsExecutionType.ts
39323
39291
  var UiPathTestManagementHubCommonEnumsExecutionType = {
39324
39292
  Manual: "manual",
@@ -39336,6 +39304,14 @@ function UiPathTestManagementHubCommonEnumsExecutionTypeToJSON(value) {
39336
39304
  return value;
39337
39305
  }
39338
39306
 
39307
+ // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceState.ts
39308
+ function UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSON(json2) {
39309
+ return UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSONTyped(json2, false);
39310
+ }
39311
+ function UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSONTyped(json2, ignoreDiscriminator) {
39312
+ return json2;
39313
+ }
39314
+
39339
39315
  // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsDTOsResult.ts
39340
39316
  var UiPathTestManagementHubTestManagementAbstractionsDTOsResult = {
39341
39317
  None: "None",
@@ -39359,7 +39335,8 @@ var UiPathTestManagementHubCommonEnumsTestCaseLogExecutionStatus = {
39359
39335
  Running: "running",
39360
39336
  Cancelling: "cancelling",
39361
39337
  Cancelled: "cancelled",
39362
- Finished: "finished"
39338
+ Finished: "finished",
39339
+ Failed: "failed"
39363
39340
  };
39364
39341
  function UiPathTestManagementHubCommonEnumsTestCaseLogExecutionStatusFromJSON(json2) {
39365
39342
  return UiPathTestManagementHubCommonEnumsTestCaseLogExecutionStatusFromJSONTyped(json2, false);
@@ -39389,6 +39366,7 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestCaseDtoFromJSO
39389
39366
  foreignReference: json2["foreignReference"] == null ? undefined : json2["foreignReference"],
39390
39367
  connectorTestCaseId: json2["connectorTestCaseId"] == null ? undefined : json2["connectorTestCaseId"],
39391
39368
  isAutomated: json2["isAutomated"] == null ? undefined : json2["isAutomated"],
39369
+ hasLinkedAutomation: json2["hasLinkedAutomation"] == null ? undefined : json2["hasLinkedAutomation"],
39392
39370
  packageVersion: json2["packageVersion"] == null ? undefined : json2["packageVersion"],
39393
39371
  postCondition: json2["postCondition"] == null ? undefined : json2["postCondition"],
39394
39372
  packageEntryPointUniqueId: json2["packageEntryPointUniqueId"] == null ? undefined : json2["packageEntryPointUniqueId"],
@@ -39399,6 +39377,9 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestCaseDtoFromJSO
39399
39377
  studioWebProjectId: json2["studioWebProjectId"] == null ? undefined : json2["studioWebProjectId"],
39400
39378
  studioWebFileId: json2["studioWebFileId"] == null ? undefined : json2["studioWebFileId"],
39401
39379
  isHidden: json2["isHidden"] == null ? undefined : json2["isHidden"],
39380
+ isGoverned: json2["isGoverned"] == null ? undefined : json2["isGoverned"],
39381
+ approvalStatus: json2["approvalStatus"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSON(json2["approvalStatus"]),
39382
+ totalApproversRequired: json2["totalApproversRequired"] == null ? undefined : json2["totalApproversRequired"],
39402
39383
  id: json2["id"] == null ? undefined : json2["id"],
39403
39384
  name: json2["name"] == null ? undefined : json2["name"],
39404
39385
  description: json2["description"] == null ? undefined : json2["description"],
@@ -39448,7 +39429,6 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestCaseLogWithTes
39448
39429
  runId: json2["runId"] == null ? undefined : json2["runId"],
39449
39430
  updated: json2["updated"] == null ? undefined : new Date(json2["updated"]),
39450
39431
  executionOrder: json2["executionOrder"] == null ? undefined : json2["executionOrder"],
39451
- governanceInfo: json2["governanceInfo"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsDTOsObjectGovernanceDtoFromJSON(json2["governanceInfo"]),
39452
39432
  isGoverned: json2["isGoverned"] == null ? undefined : json2["isGoverned"],
39453
39433
  approvalStatus: json2["approvalStatus"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSON(json2["approvalStatus"]),
39454
39434
  totalApproversRequired: json2["totalApproversRequired"] == null ? undefined : json2["totalApproversRequired"],
@@ -39620,6 +39600,22 @@ function UiPathTestManagementHubTestManagementAbstractionsEnumsSourceToJSON(valu
39620
39600
  return value;
39621
39601
  }
39622
39602
 
39603
+ // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsDTOsPlaywrightExecutionSnapshot.ts
39604
+ function UiPathTestManagementHubTestManagementAbstractionsDTOsPlaywrightExecutionSnapshotFromJSON(json2) {
39605
+ return UiPathTestManagementHubTestManagementAbstractionsDTOsPlaywrightExecutionSnapshotFromJSONTyped(json2, false);
39606
+ }
39607
+ function UiPathTestManagementHubTestManagementAbstractionsDTOsPlaywrightExecutionSnapshotFromJSONTyped(json2, ignoreDiscriminator) {
39608
+ if (json2 == null) {
39609
+ return json2;
39610
+ }
39611
+ return {
39612
+ packageName: json2["packageName"] == null ? undefined : json2["packageName"],
39613
+ version: json2["version"] == null ? undefined : json2["version"],
39614
+ projects: json2["projects"] == null ? undefined : json2["projects"],
39615
+ artifactLocationJson: json2["artifactLocationJson"] == null ? undefined : json2["artifactLocationJson"]
39616
+ };
39617
+ }
39618
+
39623
39619
  // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsEnumsTestExecutionStatus.ts
39624
39620
  var UiPathTestManagementHubTestManagementAbstractionsEnumsTestExecutionStatus = {
39625
39621
  Pending: "pending",
@@ -39682,6 +39678,7 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestExecutionDtoFr
39682
39678
  machineKey: json2["machineKey"] == null ? undefined : json2["machineKey"],
39683
39679
  hostMachineName: json2["hostMachineName"] == null ? undefined : json2["hostMachineName"],
39684
39680
  serviceUsername: json2["serviceUsername"] == null ? undefined : json2["serviceUsername"],
39681
+ playwrightExecutionSnapshot: json2["playwrightExecutionSnapshot"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsDTOsPlaywrightExecutionSnapshotFromJSON(json2["playwrightExecutionSnapshot"]),
39685
39682
  id: json2["id"] == null ? undefined : json2["id"],
39686
39683
  name: json2["name"] == null ? undefined : json2["name"],
39687
39684
  description: json2["description"] == null ? undefined : json2["description"],
@@ -39731,7 +39728,6 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestCaseLogWithTes
39731
39728
  runId: json2["runId"] == null ? undefined : json2["runId"],
39732
39729
  updated: json2["updated"] == null ? undefined : new Date(json2["updated"]),
39733
39730
  executionOrder: json2["executionOrder"] == null ? undefined : json2["executionOrder"],
39734
- governanceInfo: json2["governanceInfo"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsDTOsObjectGovernanceDtoFromJSON(json2["governanceInfo"]),
39735
39731
  isGoverned: json2["isGoverned"] == null ? undefined : json2["isGoverned"],
39736
39732
  approvalStatus: json2["approvalStatus"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSON(json2["approvalStatus"]),
39737
39733
  totalApproversRequired: json2["totalApproversRequired"] == null ? undefined : json2["totalApproversRequired"],
@@ -39800,6 +39796,7 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestExecutionWithS
39800
39796
  machineKey: json2["machineKey"] == null ? undefined : json2["machineKey"],
39801
39797
  hostMachineName: json2["hostMachineName"] == null ? undefined : json2["hostMachineName"],
39802
39798
  serviceUsername: json2["serviceUsername"] == null ? undefined : json2["serviceUsername"],
39799
+ playwrightExecutionSnapshot: json2["playwrightExecutionSnapshot"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsDTOsPlaywrightExecutionSnapshotFromJSON(json2["playwrightExecutionSnapshot"]),
39803
39800
  id: json2["id"] == null ? undefined : json2["id"],
39804
39801
  name: json2["name"] == null ? undefined : json2["name"],
39805
39802
  description: json2["description"] == null ? undefined : json2["description"],
@@ -39844,6 +39841,7 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestSetDtoFromJSON
39844
39841
  videoRecordingSettings: json2["videoRecordingSettings"] == null ? undefined : UiPathTestManagementHubCommonDTOsVideoRecordingSettingsFromJSON(json2["videoRecordingSettings"]),
39845
39842
  enforceExecutionOrder: json2["enforceExecutionOrder"] == null ? undefined : json2["enforceExecutionOrder"],
39846
39843
  orderedExecutionSettings: json2["orderedExecutionSettings"] == null ? undefined : UiPathTestManagementHubCommonDTOsOrderedExecutionSettingsFromJSON(json2["orderedExecutionSettings"]),
39844
+ executionNameFormatOverride: json2["executionNameFormatOverride"] == null ? undefined : json2["executionNameFormatOverride"],
39847
39845
  folderKey: json2["folderKey"] == null ? undefined : json2["folderKey"],
39848
39846
  robotName: json2["robotName"] == null ? undefined : json2["robotName"],
39849
39847
  robotUserKey: json2["robotUserKey"] == null ? undefined : json2["robotUserKey"],
@@ -40183,7 +40181,8 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsUpdateTestSetPacka
40183
40181
  }
40184
40182
  return {
40185
40183
  packageName: value["packageName"],
40186
- version: value["version"]
40184
+ version: value["version"],
40185
+ playwrightProjects: value["playwrightProjects"]
40187
40186
  };
40188
40187
  }
40189
40188
 
@@ -40518,7 +40517,6 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestCaseLogDtoFrom
40518
40517
  runId: json2["runId"] == null ? undefined : json2["runId"],
40519
40518
  updated: json2["updated"] == null ? undefined : new Date(json2["updated"]),
40520
40519
  executionOrder: json2["executionOrder"] == null ? undefined : json2["executionOrder"],
40521
- governanceInfo: json2["governanceInfo"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsDTOsObjectGovernanceDtoFromJSON(json2["governanceInfo"]),
40522
40520
  isGoverned: json2["isGoverned"] == null ? undefined : json2["isGoverned"],
40523
40521
  approvalStatus: json2["approvalStatus"] == null ? undefined : UiPathTestManagementHubTestManagementAbstractionsEnumsObjectGovernanceStateFromJSON(json2["approvalStatus"]),
40524
40522
  totalApproversRequired: json2["totalApproversRequired"] == null ? undefined : json2["totalApproversRequired"],
@@ -40544,7 +40542,23 @@ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestSetPackageDtoF
40544
40542
  return {
40545
40543
  testSetId: json2["testSetId"] == null ? undefined : json2["testSetId"],
40546
40544
  packageName: json2["packageName"] == null ? undefined : json2["packageName"],
40547
- version: json2["version"] == null ? undefined : json2["version"]
40545
+ version: json2["version"] == null ? undefined : json2["version"],
40546
+ playwrightProjects: json2["playwrightProjects"] == null ? undefined : json2["playwrightProjects"]
40547
+ };
40548
+ }
40549
+ // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsDTOsTestSetPlaywrightProjectContextDto.ts
40550
+ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestSetPlaywrightProjectContextDtoFromJSON(json2) {
40551
+ return UiPathTestManagementHubTestManagementAbstractionsDTOsTestSetPlaywrightProjectContextDtoFromJSONTyped(json2, false);
40552
+ }
40553
+ function UiPathTestManagementHubTestManagementAbstractionsDTOsTestSetPlaywrightProjectContextDtoFromJSONTyped(json2, ignoreDiscriminator) {
40554
+ if (json2 == null) {
40555
+ return json2;
40556
+ }
40557
+ return {
40558
+ packageIdentifier: json2["packageIdentifier"] == null ? undefined : json2["packageIdentifier"],
40559
+ version: json2["version"] == null ? undefined : json2["version"],
40560
+ availablePlaywrightProjects: json2["availablePlaywrightProjects"] == null ? undefined : json2["availablePlaywrightProjects"],
40561
+ selectedPlaywrightProjects: json2["selectedPlaywrightProjects"] == null ? undefined : json2["selectedPlaywrightProjects"]
40548
40562
  };
40549
40563
  }
40550
40564
  // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsDTOsTestStepDto.ts
@@ -40841,6 +40855,33 @@ function UiPathTestManagementHubTestManagementAbstractionsRequestModelsSearchObj
40841
40855
  labels: value["labels"]
40842
40856
  };
40843
40857
  }
40858
+ // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsRequestModelsTestCasesFilterRequestModel.ts
40859
+ function UiPathTestManagementHubTestManagementAbstractionsRequestModelsTestCasesFilterRequestModelToJSON(json2) {
40860
+ return UiPathTestManagementHubTestManagementAbstractionsRequestModelsTestCasesFilterRequestModelToJSONTyped(json2, false);
40861
+ }
40862
+ function UiPathTestManagementHubTestManagementAbstractionsRequestModelsTestCasesFilterRequestModelToJSONTyped(value, ignoreDiscriminator = false) {
40863
+ if (value == null) {
40864
+ return value;
40865
+ }
40866
+ return {
40867
+ projectid: value["projectid"],
40868
+ folderId: value["folderId"],
40869
+ testsetid: value["testsetid"],
40870
+ requirementid: value["requirementid"],
40871
+ onlynotautomated: value["onlynotautomated"],
40872
+ onlyDynamicallyAssigned: value["onlyDynamicallyAssigned"],
40873
+ updatedby: value["updatedby"],
40874
+ labels: value["labels"],
40875
+ studioProjectNames: value["studioProjectNames"],
40876
+ packageNames: value["packageNames"],
40877
+ resultTypes: value["resultTypes"] == null ? undefined : value["resultTypes"].map(UiPathTestManagementHubTestManagementAbstractionsDTOsResultToJSON),
40878
+ ids: value["ids"],
40879
+ search: value["search"],
40880
+ orderBy: value["orderBy"],
40881
+ top: value["top"],
40882
+ skip: value["skip"]
40883
+ };
40884
+ }
40844
40885
  // ../test-manager-sdk/generated/src/models/UiPathTestManagementHubTestManagementAbstractionsRequestModelsTestExecutionsFilterRequestModel.ts
40845
40886
  function UiPathTestManagementHubTestManagementAbstractionsRequestModelsTestExecutionsFilterRequestModelToJSON(json2) {
40846
40887
  return UiPathTestManagementHubTestManagementAbstractionsRequestModelsTestExecutionsFilterRequestModelToJSONTyped(json2, false);
@@ -41378,7 +41419,7 @@ class CustomFieldDefinitionsApi extends BaseAPI {
41378
41419
  }
41379
41420
  const queryParameters = {};
41380
41421
  const headerParameters = {};
41381
- headerParameters["Content-Type"] = "application/json-patch+json";
41422
+ headerParameters["Content-Type"] = "application/json";
41382
41423
  if (this.configuration && this.configuration.accessToken) {
41383
41424
  const token = this.configuration.accessToken;
41384
41425
  const tokenString = await token("Bearer", []);
@@ -41637,7 +41678,7 @@ class CustomFieldLabelsApi extends BaseAPI {
41637
41678
  }
41638
41679
  const queryParameters = {};
41639
41680
  const headerParameters = {};
41640
- headerParameters["Content-Type"] = "application/json-patch+json";
41681
+ headerParameters["Content-Type"] = "application/json";
41641
41682
  if (this.configuration && this.configuration.accessToken) {
41642
41683
  const token = this.configuration.accessToken;
41643
41684
  const tokenString = await token("Bearer", []);
@@ -41960,7 +42001,7 @@ class ObjectLabelsApi extends BaseAPI {
41960
42001
  }
41961
42002
  const queryParameters = {};
41962
42003
  const headerParameters = {};
41963
- headerParameters["Content-Type"] = "application/json-patch+json";
42004
+ headerParameters["Content-Type"] = "application/json";
41964
42005
  if (this.configuration && this.configuration.accessToken) {
41965
42006
  const token = this.configuration.accessToken;
41966
42007
  const tokenString = await token("Bearer", []);
@@ -42633,7 +42674,7 @@ class RequirementsApi extends BaseAPI {
42633
42674
  queryParameters["projectKey"] = requestParameters["projectKey"];
42634
42675
  }
42635
42676
  const headerParameters = {};
42636
- headerParameters["Content-Type"] = "application/json-patch+json";
42677
+ headerParameters["Content-Type"] = "application/json";
42637
42678
  if (this.configuration && this.configuration.accessToken) {
42638
42679
  const token = this.configuration.accessToken;
42639
42680
  const tokenString = await token("Bearer", []);
@@ -42854,7 +42895,7 @@ class RequirementsApi extends BaseAPI {
42854
42895
  }
42855
42896
  const queryParameters = {};
42856
42897
  const headerParameters = {};
42857
- headerParameters["Content-Type"] = "application/json-patch+json";
42898
+ headerParameters["Content-Type"] = "application/json";
42858
42899
  if (this.configuration && this.configuration.accessToken) {
42859
42900
  const token = this.configuration.accessToken;
42860
42901
  const tokenString = await token("Bearer", []);
@@ -43647,6 +43688,39 @@ class TestCasesApi extends BaseAPI {
43647
43688
  async testCasesDelete(requestParameters, initOverrides) {
43648
43689
  await this.testCasesDeleteRaw(requestParameters, initOverrides);
43649
43690
  }
43691
+ async testCasesGetFilteredTestCasesRequestOpts(requestParameters) {
43692
+ if (requestParameters["projectId"] == null) {
43693
+ throw new RequiredError("projectId", 'Required parameter "projectId" was null or undefined when calling testCasesGetFilteredTestCases().');
43694
+ }
43695
+ const queryParameters = {};
43696
+ const headerParameters = {};
43697
+ headerParameters["Content-Type"] = "application/json";
43698
+ if (this.configuration && this.configuration.accessToken) {
43699
+ const token = this.configuration.accessToken;
43700
+ const tokenString = await token("Bearer", []);
43701
+ if (tokenString) {
43702
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
43703
+ }
43704
+ }
43705
+ let urlPath = `/api/v2/{projectId}/testcases/filtered`;
43706
+ urlPath = urlPath.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters["projectId"])));
43707
+ return {
43708
+ path: urlPath,
43709
+ method: "POST",
43710
+ headers: headerParameters,
43711
+ query: queryParameters,
43712
+ body: UiPathTestManagementHubTestManagementAbstractionsRequestModelsTestCasesFilterRequestModelToJSON(requestParameters["uiPathTestManagementHubTestManagementAbstractionsRequestModelsTestCasesFilterRequestModel"])
43713
+ };
43714
+ }
43715
+ async testCasesGetFilteredTestCasesRaw(requestParameters, initOverrides) {
43716
+ const requestOptions = await this.testCasesGetFilteredTestCasesRequestOpts(requestParameters);
43717
+ const response = await this.request(requestOptions, initOverrides);
43718
+ return new JSONApiResponse(response, (jsonValue) => UiPathTestManagementHubCommonDTOsPagingModelDto1UiPathTestManagementHubTestManagementAbstractionsDTOsTestCaseDtoFromJSON(jsonValue));
43719
+ }
43720
+ async testCasesGetFilteredTestCases(requestParameters, initOverrides) {
43721
+ const response = await this.testCasesGetFilteredTestCasesRaw(requestParameters, initOverrides);
43722
+ return await response.value();
43723
+ }
43650
43724
  async testCasesGetTestCaseBatchRequestOpts(requestParameters) {
43651
43725
  if (requestParameters["projectId"] == null) {
43652
43726
  throw new RequiredError("projectId", 'Required parameter "projectId" was null or undefined when calling testCasesGetTestCaseBatch().');
@@ -43680,6 +43754,41 @@ class TestCasesApi extends BaseAPI {
43680
43754
  const response = await this.testCasesGetTestCaseBatchRaw(requestParameters, initOverrides);
43681
43755
  return await response.value();
43682
43756
  }
43757
+ async testCasesGetTestCaseByObjKeyAndProjectIdRequestOpts(requestParameters) {
43758
+ if (requestParameters["objKey"] == null) {
43759
+ throw new RequiredError("objKey", 'Required parameter "objKey" was null or undefined when calling testCasesGetTestCaseByObjKeyAndProjectId().');
43760
+ }
43761
+ if (requestParameters["projectId"] == null) {
43762
+ throw new RequiredError("projectId", 'Required parameter "projectId" was null or undefined when calling testCasesGetTestCaseByObjKeyAndProjectId().');
43763
+ }
43764
+ const queryParameters = {};
43765
+ const headerParameters = {};
43766
+ if (this.configuration && this.configuration.accessToken) {
43767
+ const token = this.configuration.accessToken;
43768
+ const tokenString = await token("Bearer", []);
43769
+ if (tokenString) {
43770
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
43771
+ }
43772
+ }
43773
+ let urlPath = `/api/v2/{projectId}/testcases/objkey/{objKey}`;
43774
+ urlPath = urlPath.replace(`{${"objKey"}}`, encodeURIComponent(String(requestParameters["objKey"])));
43775
+ urlPath = urlPath.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters["projectId"])));
43776
+ return {
43777
+ path: urlPath,
43778
+ method: "GET",
43779
+ headers: headerParameters,
43780
+ query: queryParameters
43781
+ };
43782
+ }
43783
+ async testCasesGetTestCaseByObjKeyAndProjectIdRaw(requestParameters, initOverrides) {
43784
+ const requestOptions = await this.testCasesGetTestCaseByObjKeyAndProjectIdRequestOpts(requestParameters);
43785
+ const response = await this.request(requestOptions, initOverrides);
43786
+ return new JSONApiResponse(response, (jsonValue) => UiPathTestManagementHubTestManagementAbstractionsDTOsTestCaseDtoFromJSON(jsonValue));
43787
+ }
43788
+ async testCasesGetTestCaseByObjKeyAndProjectId(requestParameters, initOverrides) {
43789
+ const response = await this.testCasesGetTestCaseByObjKeyAndProjectIdRaw(requestParameters, initOverrides);
43790
+ return await response.value();
43791
+ }
43683
43792
  async testCasesGetTestCasesRequestOpts(requestParameters) {
43684
43793
  if (requestParameters["projectId"] == null) {
43685
43794
  throw new RequiredError("projectId", 'Required parameter "projectId" was null or undefined when calling testCasesGetTestCases().');
@@ -43972,7 +44081,7 @@ class TestExecutionsApi extends BaseAPI {
43972
44081
  }
43973
44082
  const queryParameters = {};
43974
44083
  const headerParameters = {};
43975
- headerParameters["Content-Type"] = "application/json-patch+json";
44084
+ headerParameters["Content-Type"] = "application/json";
43976
44085
  if (this.configuration && this.configuration.accessToken) {
43977
44086
  const token = this.configuration.accessToken;
43978
44087
  const tokenString = await token("Bearer", []);
@@ -44047,7 +44156,7 @@ class TestSetsApi extends BaseAPI {
44047
44156
  }
44048
44157
  const queryParameters = {};
44049
44158
  const headerParameters = {};
44050
- headerParameters["Content-Type"] = "application/json-patch+json";
44159
+ headerParameters["Content-Type"] = "application/json";
44051
44160
  if (this.configuration && this.configuration.accessToken) {
44052
44161
  const token = this.configuration.accessToken;
44053
44162
  const tokenString = await token("Bearer", []);
@@ -44246,6 +44355,50 @@ class TestSetsApi extends BaseAPI {
44246
44355
  const response = await this.testSetsGetByIdRaw(requestParameters, initOverrides);
44247
44356
  return await response.value();
44248
44357
  }
44358
+ async testSetsGetPlaywrightProjectContextRequestOpts(requestParameters) {
44359
+ if (requestParameters["id"] == null) {
44360
+ throw new RequiredError("id", 'Required parameter "id" was null or undefined when calling testSetsGetPlaywrightProjectContext().');
44361
+ }
44362
+ if (requestParameters["projectId"] == null) {
44363
+ throw new RequiredError("projectId", 'Required parameter "projectId" was null or undefined when calling testSetsGetPlaywrightProjectContext().');
44364
+ }
44365
+ const queryParameters = {};
44366
+ if (requestParameters["folderKey"] != null) {
44367
+ queryParameters["folderKey"] = requestParameters["folderKey"];
44368
+ }
44369
+ if (requestParameters["packageIdentifier"] != null) {
44370
+ queryParameters["packageIdentifier"] = requestParameters["packageIdentifier"];
44371
+ }
44372
+ if (requestParameters["version"] != null) {
44373
+ queryParameters["version"] = requestParameters["version"];
44374
+ }
44375
+ const headerParameters = {};
44376
+ if (this.configuration && this.configuration.accessToken) {
44377
+ const token = this.configuration.accessToken;
44378
+ const tokenString = await token("Bearer", []);
44379
+ if (tokenString) {
44380
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
44381
+ }
44382
+ }
44383
+ let urlPath = `/api/v2/{projectId}/testsets/{id}/playwright-project-context`;
44384
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));
44385
+ urlPath = urlPath.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters["projectId"])));
44386
+ return {
44387
+ path: urlPath,
44388
+ method: "GET",
44389
+ headers: headerParameters,
44390
+ query: queryParameters
44391
+ };
44392
+ }
44393
+ async testSetsGetPlaywrightProjectContextRaw(requestParameters, initOverrides) {
44394
+ const requestOptions = await this.testSetsGetPlaywrightProjectContextRequestOpts(requestParameters);
44395
+ const response = await this.request(requestOptions, initOverrides);
44396
+ return new JSONApiResponse(response, (jsonValue) => UiPathTestManagementHubTestManagementAbstractionsDTOsTestSetPlaywrightProjectContextDtoFromJSON(jsonValue));
44397
+ }
44398
+ async testSetsGetPlaywrightProjectContext(requestParameters, initOverrides) {
44399
+ const response = await this.testSetsGetPlaywrightProjectContextRaw(requestParameters, initOverrides);
44400
+ return await response.value();
44401
+ }
44249
44402
  async testSetsGetTestSetByObjKeyAndProjectIdRequestOpts(requestParameters) {
44250
44403
  if (requestParameters["objKey"] == null) {
44251
44404
  throw new RequiredError("objKey", 'Required parameter "objKey" was null or undefined when calling testSetsGetTestSetByObjKeyAndProjectId().');
@@ -44447,6 +44600,42 @@ class TestSetsApi extends BaseAPI {
44447
44600
  const response = await this.testSetsStartExecuteRaw(requestParameters, initOverrides);
44448
44601
  return await response.value();
44449
44602
  }
44603
+ async testSetsUnAssignTestCasesRequestOpts(requestParameters) {
44604
+ if (requestParameters["id"] == null) {
44605
+ throw new RequiredError("id", 'Required parameter "id" was null or undefined when calling testSetsUnAssignTestCases().');
44606
+ }
44607
+ if (requestParameters["projectId"] == null) {
44608
+ throw new RequiredError("projectId", 'Required parameter "projectId" was null or undefined when calling testSetsUnAssignTestCases().');
44609
+ }
44610
+ const queryParameters = {};
44611
+ const headerParameters = {};
44612
+ headerParameters["Content-Type"] = "application/json";
44613
+ if (this.configuration && this.configuration.accessToken) {
44614
+ const token = this.configuration.accessToken;
44615
+ const tokenString = await token("Bearer", []);
44616
+ if (tokenString) {
44617
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
44618
+ }
44619
+ }
44620
+ let urlPath = `/api/v2/{projectId}/testsets/{id}/unassigntestcases`;
44621
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));
44622
+ urlPath = urlPath.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters["projectId"])));
44623
+ return {
44624
+ path: urlPath,
44625
+ method: "POST",
44626
+ headers: headerParameters,
44627
+ query: queryParameters,
44628
+ body: requestParameters["requestBody"]
44629
+ };
44630
+ }
44631
+ async testSetsUnAssignTestCasesRaw(requestParameters, initOverrides) {
44632
+ const requestOptions = await this.testSetsUnAssignTestCasesRequestOpts(requestParameters);
44633
+ const response = await this.request(requestOptions, initOverrides);
44634
+ return new VoidApiResponse(response);
44635
+ }
44636
+ async testSetsUnAssignTestCases(requestParameters, initOverrides) {
44637
+ await this.testSetsUnAssignTestCasesRaw(requestParameters, initOverrides);
44638
+ }
44450
44639
  async testSetsUpdateRequestOpts(requestParameters) {
44451
44640
  if (requestParameters["id"] == null) {
44452
44641
  throw new RequiredError("id", 'Required parameter "id" was null or undefined when calling testSetsUpdate().');
@@ -44519,6 +44708,42 @@ class TestSetsApi extends BaseAPI {
44519
44708
  async testSetsUpdateTestSetFolderKey(requestParameters, initOverrides) {
44520
44709
  await this.testSetsUpdateTestSetFolderKeyRaw(requestParameters, initOverrides);
44521
44710
  }
44711
+ async testSetsUpdateTestSetPackagesRequestOpts(requestParameters) {
44712
+ if (requestParameters["id"] == null) {
44713
+ throw new RequiredError("id", 'Required parameter "id" was null or undefined when calling testSetsUpdateTestSetPackages().');
44714
+ }
44715
+ if (requestParameters["projectId"] == null) {
44716
+ throw new RequiredError("projectId", 'Required parameter "projectId" was null or undefined when calling testSetsUpdateTestSetPackages().');
44717
+ }
44718
+ const queryParameters = {};
44719
+ const headerParameters = {};
44720
+ headerParameters["Content-Type"] = "application/json";
44721
+ if (this.configuration && this.configuration.accessToken) {
44722
+ const token = this.configuration.accessToken;
44723
+ const tokenString = await token("Bearer", []);
44724
+ if (tokenString) {
44725
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
44726
+ }
44727
+ }
44728
+ let urlPath = `/api/v2/{projectId}/testsets/{id}/testsetpackages`;
44729
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));
44730
+ urlPath = urlPath.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters["projectId"])));
44731
+ return {
44732
+ path: urlPath,
44733
+ method: "POST",
44734
+ headers: headerParameters,
44735
+ query: queryParameters,
44736
+ body: requestParameters["uiPathTestManagementHubTestManagementAbstractionsDTOsUpdateTestSetPackageRequest"].map(UiPathTestManagementHubTestManagementAbstractionsDTOsUpdateTestSetPackageRequestToJSON)
44737
+ };
44738
+ }
44739
+ async testSetsUpdateTestSetPackagesRaw(requestParameters, initOverrides) {
44740
+ const requestOptions = await this.testSetsUpdateTestSetPackagesRequestOpts(requestParameters);
44741
+ const response = await this.request(requestOptions, initOverrides);
44742
+ return new VoidApiResponse(response);
44743
+ }
44744
+ async testSetsUpdateTestSetPackages(requestParameters, initOverrides) {
44745
+ await this.testSetsUpdateTestSetPackagesRaw(requestParameters, initOverrides);
44746
+ }
44522
44747
  async testSetsUpdateTestSetRobotRequestOpts(requestParameters) {
44523
44748
  if (requestParameters["id"] == null) {
44524
44749
  throw new RequiredError("id", 'Required parameter "id" was null or undefined when calling testSetsUpdateTestSetRobot().');
@@ -55176,6 +55401,51 @@ function toStepOutput(step) {
55176
55401
  return toOutput(step);
55177
55402
  }
55178
55403
 
55404
+ // src/mappers/input/testset.input.ts
55405
+ function toFilteredTestCasesRequest(projectId, labels, top, skip) {
55406
+ return {
55407
+ projectId,
55408
+ uiPathTestManagementHubTestManagementAbstractionsRequestModelsTestCasesFilterRequestModel: { labels, top, skip }
55409
+ };
55410
+ }
55411
+ function toPlaywrightProjectContextRequest(projectId, testSetId) {
55412
+ return { id: testSetId, projectId };
55413
+ }
55414
+ function toUpdateTestSetPackagesRequest(projectId, testSetId, packageName, version, projects) {
55415
+ return {
55416
+ id: testSetId,
55417
+ projectId,
55418
+ uiPathTestManagementHubTestManagementAbstractionsDTOsUpdateTestSetPackageRequest: [{ packageName, version, playwrightProjects: projects }]
55419
+ };
55420
+ }
55421
+
55422
+ // src/utils/label-select.ts
55423
+ var FILTER_PAGE_SIZE = 200;
55424
+ var FILTER_MAX_PAGES = 50;
55425
+ async function findTestCasesByLabels(testCasesApi, projectId, labels, maxMatches) {
55426
+ const rows = [];
55427
+ const seen = new Set;
55428
+ for (let page = 0;; page++) {
55429
+ if (page >= FILTER_MAX_PAGES) {
55430
+ throw new Error(`Label query matched more than ${FILTER_MAX_PAGES * FILTER_PAGE_SIZE} test cases — narrow the label selection (labels: ${labels.join(", ")}).`);
55431
+ }
55432
+ const response = await testCasesApi.testCasesGetFilteredTestCases(toFilteredTestCasesRequest(projectId, labels, FILTER_PAGE_SIZE, page * FILTER_PAGE_SIZE));
55433
+ const items = response.data ?? [];
55434
+ for (const item of items) {
55435
+ if (item.id && item.objKey && !seen.has(item.id)) {
55436
+ seen.add(item.id);
55437
+ rows.push({ id: item.id, objKey: item.objKey });
55438
+ if (maxMatches !== undefined && rows.length >= maxMatches) {
55439
+ return rows;
55440
+ }
55441
+ }
55442
+ }
55443
+ if (items.length < FILTER_PAGE_SIZE) {
55444
+ return rows;
55445
+ }
55446
+ }
55447
+ }
55448
+
55179
55449
  // src/utils/step-input.ts
55180
55450
  function hasScalarStep(options) {
55181
55451
  return options.description !== undefined || options.expectedResult !== undefined || options.actionType !== undefined || options.clipboardData !== undefined || options.orderNo !== undefined;
@@ -55322,7 +55592,7 @@ var TESTCASE_DELETE_EXAMPLES = [
55322
55592
  var TESTCASE_ADD_EXAMPLES = [
55323
55593
  {
55324
55594
  Description: "Add test cases to a test set",
55325
- Command: "uip tm testcases add --test-set-key DEMO:10 --test-case-keys DEMO:1,DEMO:2",
55595
+ Command: "uip tm testcases add --test-set-key DEMO:10 --test-case-keys DEMO:1 DEMO:2",
55326
55596
  Output: {
55327
55597
  Code: "TestSetAddTestCases",
55328
55598
  Data: {
@@ -55331,6 +55601,19 @@ var TESTCASE_ADD_EXAMPLES = [
55331
55601
  Result: "Added"
55332
55602
  }
55333
55603
  }
55604
+ },
55605
+ {
55606
+ Description: "Add every test case carrying one of the given labels (e.g. the PW_* labels that 'tm pack' Playwright ingestion applies)",
55607
+ Command: "uip tm testcases add --test-set-key DEMO:10 --labels PW_Tag_smoke PW_Project_chromium",
55608
+ Output: {
55609
+ Code: "TestSetAddTestCases",
55610
+ Data: {
55611
+ TestSetKey: "DEMO:10",
55612
+ Added: "DEMO:3, DEMO:4, DEMO:7",
55613
+ MatchedLabels: "PW_Tag_smoke, PW_Project_chromium",
55614
+ Result: "Added"
55615
+ }
55616
+ }
55334
55617
  }
55335
55618
  ];
55336
55619
  var TESTCASE_REMOVE_EXAMPLES = [
@@ -56516,7 +56799,27 @@ var registerTestcaseCommand = (program2) => {
56516
56799
  Result: "Deleted"
56517
56800
  }));
56518
56801
  });
56519
- testcaseCmd.command("add").description("Add test cases to a test set.").requiredOption("--test-set-key <key>", "Test set object key (e.g. DEMO:42)").requiredOption("--test-case-keys <keys>", "Comma-separated test case keys to add (e.g. DEMO:1,DEMO:2)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--log-level <level>", "Log verbosity: debug, info, warn, error", "Information").examples(TESTCASE_ADD_EXAMPLES).trackedAction(processContext, async (options) => {
56802
+ testcaseCmd.command("add").description("Add test cases to a test set, either by explicit keys or by label.").requiredOption("--test-set-key <key>", "Test set object key (e.g. DEMO:42)").option("--test-case-keys <keys...>", "Test case keys to add, space-separated (e.g. DEMO:1 DEMO:2). Comma-separated values are also accepted. Mutually exclusive with --labels; pass exactly one.").option("--labels <labels...>", "Label names, space-separated (quote names that contain spaces). Adds every test case in the project carrying at least one of the labels. Works with any object label — for Playwright packages this includes the PW_Tag_*, PW_Project_*, PW_Suite_* and PW_File_* labels applied at ingestion. Mutually exclusive with --test-case-keys; pass exactly one.").option("--limit <count>", "Maximum number of label-matched test cases to add (only with --labels). Default: all matches. Prefer precise labels to keep the match set small.").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--log-level <level>", "Log verbosity: debug, info, warn, error", "Information").examples(TESTCASE_ADD_EXAMPLES).trackedAction(processContext, async (options) => {
56803
+ if (options.testCaseKeys && options.labels || !options.testCaseKeys && !options.labels) {
56804
+ OutputFormatter.error({
56805
+ Result: RESULTS.Failure,
56806
+ Message: "Pass exactly one of --test-case-keys or --labels.",
56807
+ Instructions: "Use --test-case-keys DEMO:1,DEMO:2 for explicit test cases, or --labels PW_Tag_smoke to add every test case carrying one of the labels."
56808
+ });
56809
+ processContext.exit(1);
56810
+ return;
56811
+ }
56812
+ const testCaseKeys = (options.testCaseKeys ?? []).flatMap((k) => k.split(",")).map((k) => k.trim()).filter(Boolean);
56813
+ const labels = (options.labels ?? []).map((l) => l.trim()).filter(Boolean);
56814
+ if (testCaseKeys.length === 0 && labels.length === 0) {
56815
+ OutputFormatter.error({
56816
+ Result: RESULTS.Failure,
56817
+ Message: "The provided --test-case-keys/--labels value is empty.",
56818
+ Instructions: "Pass at least one test case key (e.g. DEMO:1) or label name (e.g. PW_Tag_smoke)."
56819
+ });
56820
+ processContext.exit(1);
56821
+ return;
56822
+ }
56520
56823
  const [authError, ctx] = await catchError(initializeContextWithProject(options));
56521
56824
  if (authError) {
56522
56825
  OutputFormatter.error({
@@ -56531,9 +56834,7 @@ var registerTestcaseCommand = (program2) => {
56531
56834
  return;
56532
56835
  const { tmConfig, projectId } = ctx;
56533
56836
  const testSetsApi = new TestSetsApi(tmConfig);
56534
- const testCasesApi = new TestCasesApi(tmConfig);
56535
56837
  const testSetKey = options.testSetKey;
56536
- const testCaseKeys = options.testCaseKeys.split(",").map((k) => k.trim()).filter(Boolean);
56537
56838
  const [error, testSet] = await catchError(testSetsApi.testSetsGetTestSetByObjKeyAndProjectId({
56538
56839
  objKey: testSetKey,
56539
56840
  projectId
@@ -56559,14 +56860,23 @@ var registerTestcaseCommand = (program2) => {
56559
56860
  return;
56560
56861
  }
56561
56862
  const testCaseIds = [];
56562
- for (const tcKey of testCaseKeys) {
56563
- const [tcError, page] = await catchError(testCasesApi.testCasesGetTestCases({
56564
- projectId,
56565
- search: tcKey,
56566
- top: 50
56567
- }));
56568
- if (tcError) {
56569
- const { message, details } = await extractErrorDetails2(tcError, { forbiddenMessage: TM_FORBIDDEN_MESSAGE });
56863
+ const addedKeys = [];
56864
+ if (labels.length > 0) {
56865
+ let labelLimit;
56866
+ if (options.limit !== undefined) {
56867
+ labelLimit = Number(options.limit);
56868
+ if (!Number.isInteger(labelLimit) || labelLimit < 1) {
56869
+ OutputFormatter.error({
56870
+ Result: RESULTS.Failure,
56871
+ Message: "--limit must be a positive integer."
56872
+ });
56873
+ processContext.exit(1);
56874
+ return;
56875
+ }
56876
+ }
56877
+ const [labelError, matches] = await catchError(findTestCasesByLabels(new TestCasesApi(tmConfig), projectId, labels, labelLimit));
56878
+ if (labelError) {
56879
+ const { message, details } = await extractErrorDetails2(labelError, { forbiddenMessage: TM_FORBIDDEN_MESSAGE });
56570
56880
  OutputFormatter.error({
56571
56881
  Result: RESULTS.Failure,
56572
56882
  Message: message,
@@ -56575,17 +56885,47 @@ var registerTestcaseCommand = (program2) => {
56575
56885
  processContext.exit(1);
56576
56886
  return;
56577
56887
  }
56578
- const items = page.data ?? [];
56579
- const tc = items.find((t) => t.objKey?.toLowerCase() === tcKey.toLowerCase());
56580
- if (!tc?.id) {
56888
+ if (!matches || matches.length === 0) {
56581
56889
  OutputFormatter.error({
56582
56890
  Result: RESULTS.Failure,
56583
- Message: `Test case '${tcKey}' not found.`
56891
+ Message: `No test cases carry any of the labels: ${labels.join(", ")}.`,
56892
+ Instructions: "Check the label names with 'uip tm objectlabel list --object-type testcase'. Label matching is exact and case-sensitive."
56584
56893
  });
56585
56894
  processContext.exit(1);
56586
56895
  return;
56587
56896
  }
56588
- testCaseIds.push(tc.id);
56897
+ for (const match of matches) {
56898
+ testCaseIds.push(match.id);
56899
+ addedKeys.push(match.objKey);
56900
+ }
56901
+ } else {
56902
+ const testCasesApi = new TestCasesApi(tmConfig);
56903
+ for (const tcKey of testCaseKeys) {
56904
+ const [tcError, tc] = await catchError(testCasesApi.testCasesGetTestCaseByObjKeyAndProjectId({
56905
+ objKey: tcKey,
56906
+ projectId
56907
+ }));
56908
+ if (tcError) {
56909
+ const { message, details } = await extractErrorDetails2(tcError, { forbiddenMessage: TM_FORBIDDEN_MESSAGE });
56910
+ OutputFormatter.error({
56911
+ Result: RESULTS.Failure,
56912
+ Message: message,
56913
+ Instructions: details
56914
+ });
56915
+ processContext.exit(1);
56916
+ return;
56917
+ }
56918
+ if (!tc?.id) {
56919
+ OutputFormatter.error({
56920
+ Result: RESULTS.Failure,
56921
+ Message: `Test case '${tcKey}' not found.`
56922
+ });
56923
+ processContext.exit(1);
56924
+ return;
56925
+ }
56926
+ testCaseIds.push(tc.id);
56927
+ addedKeys.push(tcKey);
56928
+ }
56589
56929
  }
56590
56930
  const [assignError] = await catchError(testSetsApi.testSetsAssignTestCases({
56591
56931
  id: testSet.id,
@@ -56604,7 +56944,8 @@ var registerTestcaseCommand = (program2) => {
56604
56944
  }
56605
56945
  OutputFormatter.success(new SuccessOutput("TestSetAddTestCases", {
56606
56946
  TestSetKey: testSetKey,
56607
- Added: testCaseKeys.join(", "),
56947
+ Added: addedKeys.join(", "),
56948
+ ...labels.length > 0 ? { MatchedLabels: labels.join(", ") } : {},
56608
56949
  Result: "Added"
56609
56950
  }));
56610
56951
  });
@@ -56683,10 +57024,10 @@ var registerTestcaseCommand = (program2) => {
56683
57024
  }
56684
57025
  testCaseIds.push(tc.id);
56685
57026
  }
56686
- const [unassignError] = await catchError(testSetsApi.testSetsUnassignTestCases({
57027
+ const [unassignError] = await catchError(testSetsApi.testSetsUnAssignTestCases({
56687
57028
  id: testSet.id,
56688
57029
  projectId,
56689
- testCaseIds
57030
+ requestBody: testCaseIds
56690
57031
  }));
56691
57032
  if (unassignError) {
56692
57033
  const { message, details } = await extractErrorDetails2(unassignError, { forbiddenMessage: TM_FORBIDDEN_MESSAGE });
@@ -57059,6 +57400,38 @@ var registerTestcaselogCommand = (program2) => {
57059
57400
  // src/commands/testset.ts
57060
57401
  init_src();
57061
57402
 
57403
+ // src/utils/playwright-projects.ts
57404
+ class PlaywrightSelectionUnsupportedError extends Error {
57405
+ constructor(message) {
57406
+ super(message);
57407
+ this.name = "PlaywrightSelectionUnsupportedError";
57408
+ }
57409
+ }
57410
+ var isClientError = (error) => error instanceof ResponseError && error.response.status >= 400 && error.response.status < 500;
57411
+ async function getPlaywrightProjectContext(testSetsApi, projectId, testSetId, testSetKey) {
57412
+ try {
57413
+ return await testSetsApi.testSetsGetPlaywrightProjectContext(toPlaywrightProjectContextRequest(projectId, testSetId));
57414
+ } catch (error) {
57415
+ if (isClientError(error)) {
57416
+ throw new PlaywrightSelectionUnsupportedError(`Could not read the Playwright context of test set '${testSetKey}' (HTTP ${error.response.status}). This needs a Test Manager with Playwright support enabled.`);
57417
+ }
57418
+ throw error;
57419
+ }
57420
+ }
57421
+ var isPlaywrightContext = (context) => Boolean(context.packageIdentifier && context.version);
57422
+ async function applyPlaywrightProjectSelection(testSetsApi, projectId, testSetId, testSetKey, requestedProjects) {
57423
+ const context = await getPlaywrightProjectContext(testSetsApi, projectId, testSetId, testSetKey);
57424
+ if (!isPlaywrightContext(context)) {
57425
+ throw new PlaywrightSelectionUnsupportedError(`Test set '${testSetKey}' does not resolve to a single Playwright package — --playwright-projects needs every test case in the test set to come from one Playwright package.`);
57426
+ }
57427
+ const available = context.availablePlaywrightProjects ?? [];
57428
+ const unknown = requestedProjects.filter((p) => !available.includes(p));
57429
+ if (unknown.length > 0) {
57430
+ throw new PlaywrightSelectionUnsupportedError(`Unknown Playwright project(s) for test set '${testSetKey}': ${unknown.join(", ")}. Available projects: ${available.length > 0 ? available.join(", ") : "(none)"}.`);
57431
+ }
57432
+ await testSetsApi.testSetsUpdateTestSetPackages(toUpdateTestSetPackagesRequest(projectId, testSetId, context.packageIdentifier, context.version, requestedProjects));
57433
+ }
57434
+
57062
57435
  // src/utils/response.ts
57063
57436
  async function parseJsonResponse(response) {
57064
57437
  const contentType = response.headers.get("content-type");
@@ -57260,6 +57633,53 @@ var TESTSET_LIST_EXAMPLES = [
57260
57633
  }
57261
57634
  }
57262
57635
  ];
57636
+ async function resolveTestSetForCommand(options) {
57637
+ const [authError, ctx] = await catchError(initializeContextWithProject(options));
57638
+ if (authError) {
57639
+ OutputFormatter.error({
57640
+ Result: RESULTS.Failure,
57641
+ Message: authError.message,
57642
+ Instructions: instructionsFor("auth")
57643
+ });
57644
+ processContext.exit(1);
57645
+ return;
57646
+ }
57647
+ if (!ctx)
57648
+ return;
57649
+ const { tmConfig, projectId } = ctx;
57650
+ const testSetsApi = new TestSetsApi(tmConfig);
57651
+ const testSetKey = options.testSetKey;
57652
+ const [error, testSet] = await catchError(testSetsApi.testSetsGetTestSetByObjKeyAndProjectId({
57653
+ objKey: testSetKey,
57654
+ projectId
57655
+ }));
57656
+ if (error) {
57657
+ const { message, details } = await extractErrorDetails2(error, {
57658
+ forbiddenMessage: TM_FORBIDDEN_MESSAGE
57659
+ });
57660
+ OutputFormatter.error({
57661
+ Result: RESULTS.Failure,
57662
+ Message: message,
57663
+ Instructions: details
57664
+ });
57665
+ processContext.exit(1);
57666
+ return;
57667
+ }
57668
+ if (!testSet.id) {
57669
+ OutputFormatter.error({
57670
+ Result: RESULTS.Failure,
57671
+ Message: `Test set '${testSetKey}' not found.`
57672
+ });
57673
+ processContext.exit(1);
57674
+ return;
57675
+ }
57676
+ return {
57677
+ testSetsApi,
57678
+ projectId,
57679
+ testSet: { id: testSet.id },
57680
+ testSetKey
57681
+ };
57682
+ }
57263
57683
  var registerTestsetCommand = (program2) => {
57264
57684
  const testsetCmd = program2.command("testsets").description("Manage Test Manager test sets");
57265
57685
  testsetCmd.command("create").description("Create a new test set in a Test Manager project.").requiredOption("--project-key <key>", "Test Manager project key (e.g. DEMO)").requiredOption("--name <name>", "Name of the test set").option("--description <text>", "Description for the test set").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--log-level <level>", "Log verbosity: debug, info, warn, error", "Information").examples(TESTSET_CREATE_EXAMPLES).trackedAction(processContext, async (options) => {
@@ -57530,6 +57950,36 @@ var registerTestsetCommand = (program2) => {
57530
57950
  }));
57531
57951
  OutputFormatter.success(new SuccessOutput("TestSetTestCasesList", rows));
57532
57952
  });
57953
+ testsetCmd.command("playwright-context", { hidden: true }).description("Show the Playwright context of a test set: whether it resolves to a single Playwright package and which Playwright projects are available/selected.").requiredOption("--test-set-key <key>", "Test set object key (e.g. DEMO:42)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--log-level <level>", "Log verbosity: debug, info, warn, error", "Information").trackedAction(processContext, async (options) => {
57954
+ const resolved = await resolveTestSetForCommand(options);
57955
+ if (!resolved)
57956
+ return;
57957
+ const { testSetsApi, projectId, testSet, testSetKey } = resolved;
57958
+ const [contextError, context] = await catchError(getPlaywrightProjectContext(testSetsApi, projectId, testSet.id, testSetKey));
57959
+ if (contextError) {
57960
+ OutputFormatter.error({
57961
+ Result: RESULTS.Failure,
57962
+ Message: contextError.message
57963
+ });
57964
+ processContext.exit(1);
57965
+ return;
57966
+ }
57967
+ if (!context)
57968
+ return;
57969
+ const playwright = isPlaywrightContext(context);
57970
+ OutputFormatter.success(new SuccessOutput("TestSetPlaywrightContext", {
57971
+ TestSetKey: testSetKey,
57972
+ IsPlaywright: playwright,
57973
+ ...playwright ? {
57974
+ PackageIdentifier: context.packageIdentifier,
57975
+ Version: context.version,
57976
+ AvailablePlaywrightProjects: (context.availablePlaywrightProjects ?? []).join(", "),
57977
+ SelectedPlaywrightProjects: (context.selectedPlaywrightProjects ?? []).join(", ")
57978
+ } : {
57979
+ Details: "Not a Playwright test set (RPA, mixed, manual, or no single package). Run it without --playwright-projects."
57980
+ }
57981
+ }));
57982
+ });
57533
57983
  testsetCmd.command("run").description("Run a test set and return the execution ID.").requiredOption("--test-set-key <key>", "Test set object key (e.g. DEMO:42). The project key is derived from the prefix (e.g. DEMO).").option("--execution-type <type>", [
57534
57984
  "Type of test cases to execute.",
57535
57985
  " automated - run only automated test cases (default)",
@@ -57537,7 +57987,17 @@ var registerTestsetCommand = (program2) => {
57537
57987
  " mixed - run both automated and manual test cases",
57538
57988
  " none - no specific type filter"
57539
57989
  ].join(`
57540
- `), "automated").option("--input-path <file>", 'JSON file with parameter overrides: [{"name":"Param","type":"String","value":"v"}]').addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--log-level <level>", "Log verbosity: debug, info, warn, error", "Information").option("--wait", "Block until the execution reaches a terminal state (finished, cancelled)").option("--timeout <seconds>", "Maximum seconds to wait (0 = no timeout). Requires --wait.", String(DEFAULT_TIMEOUT_MS2 / 1000)).option("--poll-interval <seconds>", "Seconds between status checks. Requires --wait.", String(DEFAULT_INTERVAL_MS / 1000)).examples(TESTSET_EXECUTE_EXAMPLES).trackedAction(processContext, async (options) => {
57990
+ `), "automated").option("--input-path <file>", 'JSON file with parameter overrides: [{"name":"Param","type":"String","value":"v"}]').addOption(new Option("--playwright-projects <names...>", "PLAYWRIGHT ONLY. Playwright project names to run, space-separated (as defined in the package's playwright.config, e.g. chromium firefox). Only valid when every test case in the test set comes from one single Playwright package (packed with 'tm pack --type playwright'); fails for UiPath Studio/RPA test sets. Names are validated against the package's Playwright projects before anything is persisted; an unknown name fails fast listing the available ones (see 'tm testsets playwright-context'). The selection is saved on the test set and applies to later runs too. Omit to run with the package's playwright.config defaults.").hideHelp()).addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--log-level <level>", "Log verbosity: debug, info, warn, error", "Information").option("--wait", "Block until the execution reaches a terminal state (finished, cancelled)").option("--timeout <seconds>", "Maximum seconds to wait (0 = no timeout). Requires --wait.", String(DEFAULT_TIMEOUT_MS2 / 1000)).option("--poll-interval <seconds>", "Seconds between status checks. Requires --wait.", String(DEFAULT_INTERVAL_MS / 1000)).examples(TESTSET_EXECUTE_EXAMPLES).trackedAction(processContext, async (options) => {
57991
+ const requestedProjects = (options.playwrightProjects ?? []).map((p) => p.trim()).filter(Boolean);
57992
+ if (options.playwrightProjects && requestedProjects.length === 0) {
57993
+ OutputFormatter.error({
57994
+ Result: RESULTS.Failure,
57995
+ Message: "--playwright-projects was passed empty.",
57996
+ Instructions: "Pass at least one Playwright project name, space-separated, e.g. --playwright-projects chromium firefox."
57997
+ });
57998
+ processContext.exit(1);
57999
+ return;
58000
+ }
57541
58001
  const [authError, ctx] = await catchError(initializeContextWithProject(options));
57542
58002
  if (authError) {
57543
58003
  OutputFormatter.error({
@@ -57609,6 +58069,19 @@ var registerTestsetCommand = (program2) => {
57609
58069
  processContext.exit(1);
57610
58070
  return;
57611
58071
  }
58072
+ if (requestedProjects.length > 0) {
58073
+ const [selectError] = await catchError(applyPlaywrightProjectSelection(testSetsApi, projectId, testSet.id, testSetKey, requestedProjects));
58074
+ if (selectError) {
58075
+ OutputFormatter.error({
58076
+ Result: RESULTS.Failure,
58077
+ Message: selectError.message,
58078
+ Instructions: selectError instanceof PlaywrightSelectionUnsupportedError ? "Playwright project selection needs a Test Manager with Playwright support enabled and a test set whose test cases all come from one Playwright package. Re-run without --playwright-projects to use the package's playwright.config defaults." : "Re-run without --playwright-projects to use the package's playwright.config defaults, or fix the selection and retry."
58079
+ });
58080
+ processContext.exit(1);
58081
+ return;
58082
+ }
58083
+ logger.info(`Playwright project selection applied: ${requestedProjects.join(", ")}`);
58084
+ }
57612
58085
  if (options.inputPath) {
57613
58086
  const [overrideError] = await catchError(overrideTestSetParameters(tmConfig, projectId, testSet.id, options.inputPath));
57614
58087
  if (overrideError) {
@@ -58069,4 +58542,4 @@ export {
58069
58542
  metadata
58070
58543
  };
58071
58544
 
58072
- //# debugId=104A0639AB241E6E64756E2164756E21
58545
+ //# debugId=8564101ED9F6D44A64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/test-manager-tool",
3
3
  "license": "MIT",
4
- "version": "1.199.0-preview.104",
4
+ "version": "1.199.0-preview.106",
5
5
  "description": "Manage test cases, test sets, executions, and results.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "829a8ab8a25bce5b62c284bd1ddc674d2947f647"
29
+ "gitHead": "cb01f256c2c4f1a1a5d014ffb97e506bac709e45"
30
30
  }