@uipath/test-manager-tool 1.200.0-preview.118 → 1.200.0-preview.120

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/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Command,
4
4
  metadata,
5
5
  registerCommands
6
- } from "./tool-2dv001mt.js";
6
+ } from "./tool-9awsxwev.js";
7
7
  import"./tool-9qecd4wb.js";
8
8
  import"./tool-nvhfxv67.js";
9
9
  import"./tool-vc9mne6b.js";
@@ -11189,7 +11189,7 @@ var require_lib3 = __commonJS((exports, module) => {
11189
11189
  var package_default = {
11190
11190
  name: "@uipath/test-manager-tool",
11191
11191
  license: "MIT",
11192
- version: "1.200.0-preview.118",
11192
+ version: "1.200.0-preview.120",
11193
11193
  description: "Manage test cases, test sets, executions, and results.",
11194
11194
  private: false,
11195
11195
  repository: {
@@ -30965,6 +30965,8 @@ var MESSAGES = {
30965
30965
  LOCKFILE_MISSING: "No supported lockfile found at the project root (package-lock.json, npm-shrinkwrap.json, bun.lock, bun.lockb, yarn.lock, or pnpm-lock.yaml). The robot uses the lockfile for a deterministic install — commit one before packing.",
30966
30966
  runnerDependencyMissing: (keys) => `None of the framework's test-runner packages (${keys.join(", ")}) is declared in package.json dependencies or devDependencies. Add the runner to your project before packing.`,
30967
30967
  TMH_PROJECT_KEY_REQUIRED: "--project-key is required when --create-test-cases is enabled (the default). Pass --project-key <ProjectKey> with the destination TestManager project's URL prefix, or pass --no-create-test-cases to skip auto-creation.",
30968
+ tmhProjectKeyInvalid: (key) => `--project-key '${key}' is not a valid Test Manager project key. Keys are uppercase letters and digits only (A-Z, 0-9) — check the URL prefix of the destination project. Packing is offline, so a key that is well-formed but does not exist is only detected when the package is ingested.`,
30969
+ PLAYWRIGHT_CONFIG_MISSING: "No playwright.config file found at the project root (looked for playwright.config.{ts,js,mts,cts,mjs,cjs}). Playwright projects are read from that config; without it every test packs with an empty projects list and --playwright-projects has nothing to select at run time.",
30968
30970
  PACK_FAILED: "Failed to create package"
30969
30971
  },
30970
30972
  SUCCESS: {
@@ -30978,58 +30980,6 @@ var MESSAGES = {
30978
30980
  }
30979
30981
  };
30980
30982
 
30981
- // src/pack/actions/pack-manifest.ts
30982
- async function detectBuildTool(projectPath, buildTools) {
30983
- const fs = getFileSystem();
30984
- for (const tool of buildTools) {
30985
- const present = await Promise.all(tool.lockfiles.map((name) => fs.exists(fs.path.join(projectPath, name))));
30986
- if (present.some(Boolean)) {
30987
- return tool;
30988
- }
30989
- }
30990
- return null;
30991
- }
30992
- async function validatePackageManifest(projectPath, buildTools, runnerDependencyKeys) {
30993
- const fs = getFileSystem();
30994
- const packageJsonPath = fs.path.join(projectPath, "package.json");
30995
- if (!await fs.exists(packageJsonPath)) {
30996
- return { ok: false, message: MESSAGES.ERRORS.PACKAGE_JSON_MISSING };
30997
- }
30998
- const buildTool = await detectBuildTool(projectPath, buildTools);
30999
- if (buildTool === null) {
31000
- return { ok: false, message: MESSAGES.ERRORS.LOCKFILE_MISSING };
31001
- }
31002
- const raw = await fs.readFile(packageJsonPath, "utf-8");
31003
- if (raw === null) {
31004
- return { ok: false, message: MESSAGES.ERRORS.PACKAGE_JSON_MISSING };
31005
- }
31006
- let parsed;
31007
- try {
31008
- parsed = JSON.parse(raw);
31009
- } catch {
31010
- return { ok: false, message: MESSAGES.ERRORS.PACKAGE_JSON_INVALID };
31011
- }
31012
- if (typeof parsed !== "object" || parsed === null) {
31013
- return { ok: false, message: MESSAGES.ERRORS.PACKAGE_JSON_INVALID };
31014
- }
31015
- const pkg = parsed;
31016
- for (const key of runnerDependencyKeys) {
31017
- const version = pkg.dependencies?.[key] ?? pkg.devDependencies?.[key];
31018
- if (typeof version === "string" && version.length > 0) {
31019
- return {
31020
- ok: true,
31021
- runnerPackage: key,
31022
- runnerVersion: version,
31023
- buildTool: buildTool.name
31024
- };
31025
- }
31026
- }
31027
- return {
31028
- ok: false,
31029
- message: MESSAGES.ERRORS.runnerDependencyMissing(runnerDependencyKeys)
31030
- };
31031
- }
31032
-
31033
30983
  // src/pack/discovery/run-subprocess.ts
31034
30984
  import { spawn } from "node:child_process";
31035
30985
  function runSubprocess(command, args, options) {
@@ -31205,6 +31155,58 @@ function normalizeStringArray(value) {
31205
31155
  return;
31206
31156
  }
31207
31157
 
31158
+ // src/pack/actions/pack-manifest.ts
31159
+ async function detectBuildTool(projectPath, buildTools) {
31160
+ const fs = getFileSystem();
31161
+ for (const tool of buildTools) {
31162
+ const present = await Promise.all(tool.lockfiles.map((name) => fs.exists(fs.path.join(projectPath, name))));
31163
+ if (present.some(Boolean)) {
31164
+ return tool;
31165
+ }
31166
+ }
31167
+ return null;
31168
+ }
31169
+ async function validatePackageManifest(projectPath, buildTools, runnerDependencyKeys) {
31170
+ const fs = getFileSystem();
31171
+ const packageJsonPath = fs.path.join(projectPath, "package.json");
31172
+ if (!await fs.exists(packageJsonPath)) {
31173
+ return { ok: false, message: MESSAGES.ERRORS.PACKAGE_JSON_MISSING };
31174
+ }
31175
+ const buildTool = await detectBuildTool(projectPath, buildTools);
31176
+ if (buildTool === null) {
31177
+ return { ok: false, message: MESSAGES.ERRORS.LOCKFILE_MISSING };
31178
+ }
31179
+ const raw = await fs.readFile(packageJsonPath, "utf-8");
31180
+ if (raw === null) {
31181
+ return { ok: false, message: MESSAGES.ERRORS.PACKAGE_JSON_MISSING };
31182
+ }
31183
+ let parsed;
31184
+ try {
31185
+ parsed = JSON.parse(raw);
31186
+ } catch {
31187
+ return { ok: false, message: MESSAGES.ERRORS.PACKAGE_JSON_INVALID };
31188
+ }
31189
+ if (typeof parsed !== "object" || parsed === null) {
31190
+ return { ok: false, message: MESSAGES.ERRORS.PACKAGE_JSON_INVALID };
31191
+ }
31192
+ const pkg = parsed;
31193
+ for (const key of runnerDependencyKeys) {
31194
+ const version = pkg.dependencies?.[key] ?? pkg.devDependencies?.[key];
31195
+ if (typeof version === "string" && version.length > 0) {
31196
+ return {
31197
+ ok: true,
31198
+ runnerPackage: key,
31199
+ runnerVersion: version,
31200
+ buildTool: buildTool.name
31201
+ };
31202
+ }
31203
+ }
31204
+ return {
31205
+ ok: false,
31206
+ message: MESSAGES.ERRORS.runnerDependencyMissing(runnerDependencyKeys)
31207
+ };
31208
+ }
31209
+
31208
31210
  // src/pack/discovery/playwright-list.ts
31209
31211
  var SPAWN_TIMEOUT_MS = 60000;
31210
31212
  var WIN_CLI_REL = [
@@ -31541,6 +31543,8 @@ function isSecretFile(entryName) {
31541
31543
  }
31542
31544
 
31543
31545
  // src/pack/actions/pack.ts
31546
+ var TMH_PROJECT_KEY_PATTERN = /^[A-Z0-9]+$/;
31547
+ var TMH_PROJECT_KEY_MAX_LENGTH = 255;
31544
31548
  async function executePack(options) {
31545
31549
  const fs = getFileSystem();
31546
31550
  const absoluteProjectPath = fs.path.resolve(options.projectPath);
@@ -31569,12 +31573,18 @@ async function executePack(options) {
31569
31573
  message: MESSAGES.ERRORS.INVALID_PROJECT_PATH
31570
31574
  };
31571
31575
  }
31572
- if (!options.dryRun && options.createTestCases && (options.tmhProjectKey === undefined || options.tmhProjectKey.trim().length === 0)) {
31576
+ if (options.createTestCases && (options.tmhProjectKey === undefined || options.tmhProjectKey.trim().length === 0)) {
31573
31577
  return {
31574
31578
  success: false,
31575
31579
  message: MESSAGES.ERRORS.TMH_PROJECT_KEY_REQUIRED
31576
31580
  };
31577
31581
  }
31582
+ if (options.tmhProjectKey !== undefined && options.tmhProjectKey.trim().length > 0 && (!TMH_PROJECT_KEY_PATTERN.test(options.tmhProjectKey.trim()) || options.tmhProjectKey.trim().length > TMH_PROJECT_KEY_MAX_LENGTH)) {
31583
+ return {
31584
+ success: false,
31585
+ message: MESSAGES.ERRORS.tmhProjectKeyInvalid(options.tmhProjectKey.trim())
31586
+ };
31587
+ }
31578
31588
  const stat = await fs.stat(absoluteProjectPath);
31579
31589
  if (!stat?.isDirectory()) {
31580
31590
  return {
@@ -31587,6 +31597,12 @@ async function executePack(options) {
31587
31597
  return { success: false, message: manifest.message };
31588
31598
  }
31589
31599
  logger.info(`Detected build tool: ${manifest.buildTool}`);
31600
+ if (framework.type === "playwright" && await findConfigFile(absoluteProjectPath) === null) {
31601
+ return {
31602
+ success: false,
31603
+ message: MESSAGES.ERRORS.PLAYWRIGHT_CONFIG_MISSING
31604
+ };
31605
+ }
31590
31606
  logger.info(MESSAGES.INFO.DISCOVERING_TESTS);
31591
31607
  const { tests } = await language.discoverTests(absoluteProjectPath, packageName);
31592
31608
  if (tests.length === 0) {
@@ -31870,7 +31886,7 @@ var PACK_EXAMPLES = [
31870
31886
  },
31871
31887
  {
31872
31888
  Description: "Preview what would be discovered and packaged, without writing anything",
31873
- Command: "uip tm pack --project-path ./e2e --type playwright --dry-run",
31889
+ Command: "uip tm pack --project-path ./e2e --type playwright --project-key DEMO --dry-run",
31874
31890
  Output: {
31875
31891
  Code: "ExternalTestPackDryRun",
31876
31892
  Data: {
@@ -31881,7 +31897,7 @@ var PACK_EXAMPLES = [
31881
31897
  }
31882
31898
  ];
31883
31899
  var registerPackCommand = (program2) => {
31884
- program2.command("pack").description("Pack a Playwright test suite into a UiPath .nupkg for Test Manager. " + "For UiPath Studio test automation projects, use `rpa-legacy pack` instead.").requiredOption("--project-path <path>", "Path to the test project root (for playwright: the directory containing package.json, a lockfile, and playwright.config)").addOption(new Option("--type <type>", "Test framework").choices(SUPPORTED_TYPES).makeOptionMandatory()).option("-n, --name <name>", "Package name (default: project folder name)").option("--package-version <version>", "Package version", DEFAULT_VERSION).option("-o, --output <dir>", "Output directory", DEFAULT_OUTPUT_DIR).option("--author <author>", "Package author", DEFAULT_AUTHOR).option("--description <desc>", "Package description").option("--no-create-test-cases", "Do not auto-create Test Cases in Test Manager when this package is uploaded. Per-test label metadata is still embedded, so labels can be applied later when Test Cases are created.").option("--project-key <key>", "Test Manager project key that auto-created Test Cases land in (e.g. MYPROJ). Required when --create-test-cases is on (the default).").option("--dry-run", "Preview what would be packaged without creating").examples(PACK_EXAMPLES).trackedAction(processContext, async (options) => {
31900
+ program2.command("pack").description("Pack a Playwright test suite into a UiPath .nupkg for Test Manager. " + "For UiPath Studio test automation projects, use `rpa-legacy pack` instead.").requiredOption("--project-path <path>", "Path to the test project root (for playwright: the directory containing package.json, a lockfile, and playwright.config). All three are required — the config is what defines the Playwright projects that --playwright-projects can later select.").addOption(new Option("--type <type>", "Test framework").choices(SUPPORTED_TYPES).makeOptionMandatory()).option("-n, --name <name>", "Package name (default: project folder name)").option("--package-version <version>", "Package version", DEFAULT_VERSION).option("-o, --output <dir>", "Output directory", DEFAULT_OUTPUT_DIR).option("--author <author>", "Package author", DEFAULT_AUTHOR).option("--description <desc>", "Package description").option("--no-create-test-cases", "Do not auto-create Test Cases in Test Manager when this package is uploaded. Per-test label metadata is still embedded, so labels can be applied later when Test Cases are created.").option("--project-key <key>", "Test Manager project key that auto-created Test Cases land in (e.g. MYPROJ) - uppercase letters and digits only. Required when --create-test-cases is on (the default). Packing is offline, so the format is checked here; whether the project exists is confirmed when the package is ingested.").option("--dry-run", "Preview what would be packaged without creating it. Applies the same validation as a real pack, so a dry run that succeeds will pack.").examples(PACK_EXAMPLES).trackedAction(processContext, async (options) => {
31885
31901
  const [error, result] = await catchError2(executePack({
31886
31902
  projectPath: options.projectPath,
31887
31903
  type: options.type,
@@ -39482,4 +39498,4 @@ var registerCommands = async (program2) => {
39482
39498
 
39483
39499
  export { Command, metadata, registerCommands };
39484
39500
 
39485
- //# debugId=40C11B6B82A47E5C64756E2164756E21
39501
+ //# debugId=29912622C4BBDAD964756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-2dv001mt.js";
4
+ } from "./tool-9awsxwev.js";
5
5
  import"./tool-9qecd4wb.js";
6
6
  import"./tool-nvhfxv67.js";
7
7
  import"./tool-vc9mne6b.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/test-manager-tool",
3
3
  "license": "MIT",
4
- "version": "1.200.0-preview.118",
4
+ "version": "1.200.0-preview.120",
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": "bc87399d98869787498783b3b9383df4426fd896"
29
+ "gitHead": "173ad4b4930bd3e17a493b32e9f1c3c616ea1c10"
30
30
  }