diff --git a/README.md b/README.md index 4f9ac3c..8128119 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ This way even entityIds like environmentIds or testCaseIds will be autocompleted # octomind -Octomind cli tool. Version: 4.2.0. Additional documentation see https://octomind.dev/docs/api-reference/ +Octomind cli tool. Version: 4.3.0. Additional documentation see https://octomind.dev/docs/api-reference/ **Usage:** `octomind [options] [command]` @@ -237,7 +237,7 @@ Execute local YAML test cases |:-------|:----------|:---------|:--------| | `-j, --json` | Output raw JSON response | No | | | `-u, --url ` | Url the tests should run against | Yes | | -| `-c, --test-case-id [uuid]` | Id of the test case you want to run, if not provided will run all test cases in the test target | No | | +| `-p, --test-case-path [string]` | Path of the test case you want to run, if not provided will run all test cases in the test target | No | | | `-e, --environment-id [uuid]` | Id of the environment you want to run against, if not provided will run all test cases against the default environment | No | | | `-t, --test-target-id [uuid]` | Id of the test target of the test case, if not provided will use the test target id from the config | No | | | `--headless` | If we should run headless without the UI of playwright and the browser | No | | @@ -445,6 +445,7 @@ Push local YAML test cases to the test target |:-------|:----------|:---------|:--------| | `-j, --json` | Output raw JSON response | No | | | `-t, --test-target-id [id]` | Test target ID, if not provided will use the test target id from the config | No | | +| `-y, --yes` | Skip confirmation prompt | No | | ## create-test-case @@ -459,7 +460,7 @@ Create a new test case | `-j, --json` | Output raw JSON response | No | | | `-t, --test-target-id [id]` | Test target ID, if not provided will use the test target id from the config | No | | | `-n, --name ` | The name of the test case you want to create | Yes | | -| `-d, --dependency-path ` | The path of to test case you want to use as dependency | Yes | | +| `-d, --dependency-path [path]` | The path of to test case you want to use as dependency | No | | ## edit-test-case diff --git a/package.json b/package.json index f63e60f..e5a2f56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@octomind/octomind", - "version": "4.2.0", + "version": "4.3.0", "description": "a command line client for octomind apis", "main": "./dist/index.js", "packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48", diff --git a/src/tools/sync/push.ts b/src/tools/sync/push.ts index 879ff82..5a2e17b 100644 --- a/src/tools/sync/push.ts +++ b/src/tools/sync/push.ts @@ -26,7 +26,10 @@ type PushOptions = { export const push = async ( options: PushOptions, -): Promise<{ success: boolean; versionIds: string[] } | undefined> => { +): Promise< + | { success: boolean; versionIds: string[]; pushResult: "drafts" | "enabled" } + | undefined +> => { const testCases = readTestCasesFromDir(options.sourceDir); checkForConsistency(testCases); const context = await getGitContext(); @@ -38,9 +41,17 @@ export const push = async ( }; if (isDefaultBranch) { - return defaultPush(body, options); + const pushResult = await defaultPush(body, options); + if (!pushResult) { + return undefined; + } + return { ...pushResult, pushResult: "enabled" }; } else { - return draftPush(body, options); + const pushResult = await draftPush(body, options); + if (!pushResult) { + return undefined; + } + return { ...pushResult, pushResult: "drafts" }; } }; diff --git a/src/tools/test-targets.ts b/src/tools/test-targets.ts index 614a807..cf39a33 100644 --- a/src/tools/test-targets.ts +++ b/src/tools/test-targets.ts @@ -102,7 +102,10 @@ export const pullTestTarget = async ( }; export const pushTestTarget = async ( - options: { testTargetId: string; yes?: boolean } & ListOptions, + options: { + testTargetId: string; + yes?: boolean; + } & ListOptions, ): Promise => { const localThrobber = ora("Reading local test cases").start(); const sourceDir = await findOctomindFolder(); @@ -139,5 +142,5 @@ export const pushTestTarget = async ( logJson(data); } - pushThrobber.succeed("Test cases pushed successfully"); + pushThrobber.succeed(`Test cases pushed as ${data?.pushResult}`); };