@testrigor/testrigor-cli 0.0.45-beta → 0.0.46-beta

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/README.md CHANGED
@@ -19,18 +19,19 @@ This is a command line tool for TestRigor. It allows you to run TestRigor tests
19
19
  8. With rules `testrigor test-suite run <test-suite-id> --token <token> --rules-path rules/**/*.yaml`
20
20
  9. With settings `testrigor test-suite run <test-suite-id> --token <token> --settings-path settings.yaml` (Can be YAML or JSON)
21
21
  10. Run a single test case `testrigor test-suite run <test-suite-id> --token <token> --test-case-uuid <test-case-uuid>`
22
- 11. Run with auto create AI rules enabled `testrigor test-suite run <test-suite-id> --token <token> --test-cases-path test_cases/**/*.{yaml,txt} --auto-create-ai-rules`
23
- 12. Run with explicit mutations enabled `testrigor test-suite run <test-suite-id> --token <token> --test-cases-path test_cases/**/*.{yaml,txt} --explicit-mutations`
24
- 13. With all options `testrigor test-suite run <test-suite-id> --token <token> --url <url> --branch <branch> --commit <commit> --variables-path file.json --localhost --test-cases-path test_cases/**/*.{yaml,txt} --rules-path rules/**/*.{yaml,txt} --auto-create-ai-rules --explicit-mutations`
25
- 14. Save JUnit report to `./junit-report.xml` (works only in sync mode): `testrigor test-suite run <test-suite-id> --token <token> --junit-report-save-path ./report.xml`
26
- 15. With comma-separated labels `testrigor test-suite run <test-suite-id> --token <token> --labels <labels>`
27
- 16. Excluding comma-separated labels `testrigor test-suite run <test-suite-id> --token <token> --excluded-labels <excluded-labels>`
28
- 17. With different WEB and API URLs `testrigor test-suite run <test-suite-id> --token <token> --base-url-web=<base-web-url> --base-url-api=<base_api_url>`
29
- 18. Set the default test suite ID: `testrigor test-suite config --default <test-suite-id>`
30
- 19. Remove the default test suite ID: `testrigor test-suite config --delete`
31
- 20. Show current configuration: `testrigor test-suite config --show`
32
- 21. Authenticate with TestRigor and store credentials (interactive prompt): `testrigor authenticate`
33
- 22. Run with override chrome extensions at runtime (one or more chrome extensions): `test-suite run <test-suite-id> --token <token> --chrome-extension "name=<extension-name> file=<extension-file>" --chrome-extension "name=<extension-name> file=<extension-file>"`
22
+ 11. Run multiple test cases `testrigor test-suite run <test-suite-id> --token <token> --test-case-uuid <test-case-uuid-1> --test-case-uuid <test-case-uuid-2>`
23
+ 12. Run with auto create AI rules enabled `testrigor test-suite run <test-suite-id> --token <token> --test-cases-path test_cases/**/*.{yaml,txt} --auto-create-ai-rules`
24
+ 13. Run with explicit mutations enabled `testrigor test-suite run <test-suite-id> --token <token> --test-cases-path test_cases/**/*.{yaml,txt} --explicit-mutations`
25
+ 14. With all options `testrigor test-suite run <test-suite-id> --token <token> --url <url> --branch <branch> --commit <commit> --variables-path file.json --localhost --test-cases-path test_cases/**/*.{yaml,txt} --rules-path rules/**/*.{yaml,txt} --auto-create-ai-rules --explicit-mutations`
26
+ 15. Save JUnit report to `./junit-report.xml` (works only in sync mode): `testrigor test-suite run <test-suite-id> --token <token> --junit-report-save-path ./report.xml`
27
+ 16. With comma-separated labels `testrigor test-suite run <test-suite-id> --token <token> --labels <labels>`
28
+ 17. Excluding comma-separated labels `testrigor test-suite run <test-suite-id> --token <token> --excluded-labels <excluded-labels>`
29
+ 18. With different WEB and API URLs `testrigor test-suite run <test-suite-id> --token <token> --base-url-web=<base-web-url> --base-url-api=<base_api_url>`
30
+ 19. Set the default test suite ID: `testrigor test-suite config --default <test-suite-id>`
31
+ 20. Remove the default test suite ID: `testrigor test-suite config --delete`
32
+ 21. Show current configuration: `testrigor test-suite config --show`
33
+ 22. Authenticate with TestRigor and store credentials (interactive prompt): `testrigor authenticate`
34
+ 23. Run with override chrome extensions at runtime (one or more chrome extensions): `test-suite run <test-suite-id> --token <token> --chrome-extension "name=<extension-name> file=<extension-file>" --chrome-extension "name=<extension-name> file=<extension-file>"`
34
35
 
35
36
  ### Mobile Testing
36
37
 
@@ -18,7 +18,7 @@ export default class Run extends CommandBase<typeof Run> {
18
18
  "rules-path": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
19
19
  "settings-path": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
20
20
  "local-test-nodes-path": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
21
- "test-case-uuid": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
21
+ "test-case-uuid": import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
22
22
  "auto-create-ai-rules": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
23
23
  "explicit-mutations": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
24
24
  labels: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
@@ -36,6 +36,7 @@ export default class Run extends CommandBase<typeof Run> {
36
36
  };
37
37
  private initializeUrls;
38
38
  run(): Promise<void>;
39
+ private isSingleTestCaseExecution;
39
40
  private fetchStatus;
40
41
  private getStatusApiEndpoint;
41
42
  private uploadVariableFiles;
@@ -79,7 +79,7 @@ class Run extends command_base_1.CommandBase {
79
79
  const testCasesPath = flags["test-cases-path"];
80
80
  const rulesPath = flags["rules-path"];
81
81
  const settingsPath = flags["settings-path"];
82
- const testCaseUuid = flags["test-case-uuid"];
82
+ const testCaseUuids = flags["test-case-uuid"];
83
83
  const isAutoCreateAIBasedRulesEnabled = flags["auto-create-ai-rules"];
84
84
  const explicitMutations = flags["explicit-mutations"];
85
85
  const labels = flags["labels"];
@@ -108,8 +108,8 @@ class Run extends command_base_1.CommandBase {
108
108
  if (minPort > maxPort) {
109
109
  core_1.ux.error("--minPort cannot be greater than --maxPort");
110
110
  }
111
- if (testCaseUuid) {
112
- context.configuration.testCaseUuids = [testCaseUuid];
111
+ if (testCaseUuids && testCaseUuids.length > 0) {
112
+ context.configuration.testCaseUuids = testCaseUuids;
113
113
  }
114
114
  if (isAutoCreateAIBasedRulesEnabled) {
115
115
  context.configuration.isAutoCreateAIBasedRulesEnabled =
@@ -175,7 +175,7 @@ class Run extends command_base_1.CommandBase {
175
175
  }
176
176
  if (localTestNodesPath) {
177
177
  try {
178
- const localTestNodes = await (0, parser_1.parseSettings)(localTestNodesPath);
178
+ const localTestNodes = (await (0, parser_1.parseSettings)(localTestNodesPath));
179
179
  if (localTestNodes) {
180
180
  if (Array.isArray(localTestNodes.testNodes)) {
181
181
  for (const node of localTestNodes.testNodes) {
@@ -301,8 +301,8 @@ class Run extends command_base_1.CommandBase {
301
301
  // Checking last run id
302
302
  task: async (ctx) => {
303
303
  let pollBranch = flags.branch;
304
- if (testCaseUuid && !flags.branch) {
305
- pollBranch = `single-test-execution-${testCaseUuid}`;
304
+ if (this.isSingleTestCaseExecution(testCaseUuids, flags.branch)) {
305
+ pollBranch = `single-test-execution-${testCaseUuids[0]}`;
306
306
  }
307
307
  const statusResponse = await this.fetchStatus(testSuiteId, token, pollBranch, ctx.configuration.labels, ctx.configuration.excludedLabels);
308
308
  context.lastRunId = (0, utils_1.extractRunIdFromDetailsUrl)(statusResponse.detailsUrl);
@@ -479,8 +479,8 @@ class Run extends command_base_1.CommandBase {
479
479
  enabled: (ctx) => ctx.response?.queueId,
480
480
  task: async (ctx, currentTask) => {
481
481
  let pollBranch = flags.branch;
482
- if (testCaseUuid && !flags.branch) {
483
- pollBranch = `single-test-execution-${testCaseUuid}`;
482
+ if (this.isSingleTestCaseExecution(testCaseUuids, flags.branch)) {
483
+ pollBranch = `single-test-execution-${testCaseUuids[0]}`;
484
484
  }
485
485
  const detailsUrl = await this.waitForTestSuiteToBeCreated(testSuiteId, token, ctx.lastRunId, pollBranch, ctx.configuration.labels, ctx.configuration.excludedLabels);
486
486
  task.title = `Running test suite [ ${detailsUrl} ]`;
@@ -493,8 +493,8 @@ class Run extends command_base_1.CommandBase {
493
493
  enabled: (ctx) => ctx.response?.result === "ok" && !flags.async,
494
494
  task: async (ctx, task) => {
495
495
  let pollBranch = flags.branch;
496
- if (testCaseUuid && !flags.branch) {
497
- pollBranch = `single-test-execution-${testCaseUuid}`;
496
+ if (this.isSingleTestCaseExecution(testCaseUuids, flags.branch)) {
497
+ pollBranch = `single-test-execution-${testCaseUuids[0]}`;
498
498
  }
499
499
  return task.newListr([
500
500
  {
@@ -563,6 +563,9 @@ class Run extends command_base_1.CommandBase {
563
563
  }
564
564
  this.exit(0);
565
565
  }
566
+ isSingleTestCaseExecution(testCaseUuids, branch) {
567
+ return !!testCaseUuids && testCaseUuids.length === 1 && !branch;
568
+ }
566
569
  async fetchStatus(testSuiteId, token, branch, labels, excludedLabels) {
567
570
  const statusApiEndpoint = this.getStatusApiEndpoint(testSuiteId, branch, labels, excludedLabels);
568
571
  const response = await (0, node_fetch_commonjs_1.default)(statusApiEndpoint, {
@@ -885,7 +888,8 @@ Run.flags = {
885
888
  description: "Path to a YAML or JSON file with local test nodes configuration",
886
889
  }),
887
890
  "test-case-uuid": core_1.Flags.string({
888
- description: "Test case uuid",
891
+ description: "Test case uuid (can be repeated to run multiple test cases)",
892
+ multiple: true,
889
893
  }),
890
894
  "auto-create-ai-rules": core_1.Flags.boolean({
891
895
  description: "Enable auto create AI based rules",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.45-beta",
2
+ "version": "0.0.46-beta",
3
3
  "commands": {
4
4
  "authenticate": {
5
5
  "id": "authenticate",
@@ -204,8 +204,8 @@
204
204
  "test-case-uuid": {
205
205
  "name": "test-case-uuid",
206
206
  "type": "option",
207
- "description": "Test case uuid",
208
- "multiple": false
207
+ "description": "Test case uuid (can be repeated to run multiple test cases)",
208
+ "multiple": true
209
209
  },
210
210
  "auto-create-ai-rules": {
211
211
  "name": "auto-create-ai-rules",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testrigor/testrigor-cli",
3
- "version": "0.0.45-beta",
3
+ "version": "0.0.46-beta",
4
4
  "description": "TestRigor Command Line",
5
5
  "author": "Ivo Parun Rua @parunruaivo",
6
6
  "bin": {