From ffe1e4fbb757ae1e9d422ca9bcc6e81cf795701b Mon Sep 17 00:00:00 2001 From: Palak-Bansal-Provar <89642292+Palak-Bansal-Provar@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:29:44 +0530 Subject: [PATCH 1/3] Release v1.4.0 (#96) README file updated --- README.md | 197 +++++++++++++++++++++++++++++++--- messages/provar.config.get.md | 8 +- messages/provar.config.set.md | 16 ++- package.json | 4 +- 4 files changed, 198 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index f37185a..5ec492e 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,11 @@ $ sf plugins uninstall @provartesting/provardx-cli # Commands +- [`sf provar config get`](#sf-provar-config-get) +- [`sf provar config set`](#sf-provar-config-set) - [`sf provar automation config generate`](#sf-provar-automation-config-generate) -- [`sf provar automation config validate`](#sf-provar-automation-config-validate) - [`sf provar automation config load`](#sf-provar-automation-config-load) +- [`sf provar automation config validate`](#sf-provar-automation-config-validate) - [`sf provar automation config get`](#sf-provar-automation-config-get) - [`sf provar automation config set`](#sf-provar-automation-config-set) - [`sf provar automation setup`](#sf-provar-automation-setup) @@ -37,50 +39,88 @@ $ sf plugins uninstall @provartesting/provardx-cli - [`sf provar automation metadata download`](#sf-provar-automation-metadata-download) - [`sf provar automation test run`](#sf-provar-automation-test-run) - [`sf provar manager connect`](#sf-provar-manager-connect) +- [`sf provar manager display`](#sf-provar-manager-display) +- [`sf provar manager open`](#sf-provar-manager-open) - [`sf provar manager testcase retrieve`](#sf-provar-manager-testcase-retrieve) +- [`sf provar manager test run`](#sf-provar-manager-test-run) +- [`sf provar manager test run report`](#sf-provar-manager-test-run-report) -## `sf provar automation config generate` +## `sf provar config get` -Generate a boilerplate ProvarDX properties file. +Retrieve a value from the specified JSON file. ``` USAGE - $ sf provar automation config generate [--json] [-p ] + $ sf provar config get -f [--json] FLAGS - -p, --properties-file= (required) Path to the properties file that will be generated. - -n, --no-prompt Don't prompt to confirm file should be overwritten. + -f, --file-path= (required) File path of the JSON file to get the property value from. GLOBAL FLAGS - --json Format output as json. + --json Format output as json. DESCRIPTION - Generate a boilerplate property file. + Retrieve a value from the specified JSON file. EXAMPLES - Generate a basic properties file named provardx-properties.json: + Get the testEnvironment value within the environment property from the config.json file: - $ sf provar automation config generate -p provardx-properties.json + $ sf provar config get environment.testEnvironment -f config.json ``` -## `sf provar automation config validate` +## `sf provar config set` -Check if the loaded properties file has all the required properties set. +Set one or more properties in the specified JSON file. ``` USAGE - $ sf provar automation config validate [--json] + $ sf provar config set [--json] + +FLAGS + -f, --file-path= (required) File path of the JSON file to get the property value from. GLOBAL FLAGS --json Format output as json. DESCRIPTION - Check if the loaded properties file has all the required properties set. + Set one or more properties in the specified JSON file. EXAMPLES - Check if the loaded properties file has all the required properties set: - - $ sf provar automation config validate + Set the environment to “SIT” in the config.json properties file: + + $ sf provar config set environment.testEnvironment="SIT" -f config.json + + Set the testEnvironment to “SIT” and the webBrowser to “Chrome”, within the environment property. + + $ sf provar config set environment.testEnvironment="SIT" environment.webBrowser="Chrome" -f config.json + + Set testCases to a list of test case paths in the config.json properties file. + + $ sf provar config set testCases='["tests/myTestCase.testcase","tests/testSuite1/myTestCase1.testCase"]' -f config.json +``` + +## `sf provar automation config generate` + +Generate a boilerplate ProvarDX properties file. + +``` +USAGE + $ sf provar automation config generate [--json] [-p ] + +FLAGS + -p, --properties-file= (required) Path to the properties file that will be generated. + -n, --no-prompt Don't prompt to confirm file should be overwritten. + +GLOBAL FLAGS + --json Format output as json. + +DESCRIPTION + Generate a boilerplate property file. + +EXAMPLES + Generate a basic properties file named provardx-properties.json: + + $ sf provar automation config generate -p provardx-properties.json ``` ## `sf provar automation config load` @@ -106,6 +146,26 @@ EXAMPLES $ sf provar automation config load -p myproperties.json ``` +## `sf provar automation config validate` + +Check if the loaded properties file has all the required properties set. + +``` +USAGE + $ sf provar automation config validate [--json] + +GLOBAL FLAGS + --json Format output as json. + +DESCRIPTION + Check if the loaded properties file has all the required properties set. + +EXAMPLES + Check if the loaded properties file has all the required properties set: + + $ sf provar automation config validate +``` + ## `sf provar automation config get` Retrieve a value from the loaded properties file. @@ -263,6 +323,46 @@ EXAMPLES $ sf provar manager connect -o ProvarManager ``` +## `sf provar manager display` + +Display information about the connected Provar Manager org. + +``` +USAGE + $ sf provar manager display [--json] + +GLOBAL FLAGS + --json Format output as json. + +DESCRIPTION + Display information about the connected Provar Manager org. + +EXAMPLES + Display information about the connected Provar Manager org: + + $ sf provar manager display +``` + +## `sf provar manager open` + +Open Provar Manager in a browser. + +``` +USAGE + $ sf provar manager open [--json] + +GLOBAL FLAGS + --json Format output as json. + +DESCRIPTION + Open Provar Manager in a browser. + +EXAMPLES + Open Provar Manager in a browser: + + $ sf provar manager open +``` + ## `sf provar manager testcase retrieve` Retrieve test cases related to the provided user stories (issues) or metadata components, for a given test project. @@ -304,3 +404,66 @@ EXAMPLES base/main/default/objects/Sprint__c/fields/Sprint_Goal__c.field-meta.xml ``` + +## `sf provar manager test run` + +Run tests via Provar Manager. + +``` +USAGE + $ sf provar manager test run -f [--json] [-y] [-w ] [-p ] [-o ] [-r ] + +FLAGS + -f, --configuration-file= (required) Path to the configuration file. + -o, --output= Output to a specific file instead of stdout. + -p, --polling-interval= [default: 60] Sets the polling interval in seconds. Default is 60 seconds. + -r, --result-format= [default: human] Format of the test results. + -w, --wait= Sets the polling timeout in minutes. + -y, --synchronous Runs command synchronously; if not specified, the command is run asynchronously. + +GLOBAL FLAGS + --json Format output as json. + +DESCRIPTION + Run tests via Provar Manager. + +EXAMPLES + Run tests as per the config/run-grid-test.json configuration file, wait 10 minutes, poll every 30 seconds, and store the results as JSON in the results.json file: + + $ sf provar manager test run -f config/run-grid-tests.json -w 10 -p 30 -r json -o results.json + + Run tests as per the config/run-grid-test.json configuration file, wait 20 minutes, and store the results as JUnit in the junit-results.xml file: + + $ sf provar manager test run -f config/run-grid-tests.json -w 20 -r junit -o junit-results.xml + +``` + +## `sf provar manager test run report` + +Check or poll for the status of a test run operation. + +``` +USAGE + $ sf provar manager test run report -i [--json] [-r ] [-o ] + +FLAGS + -i, --test-run= (required) Test run ID. + -o, --output= Output to a specific file instead of stdout. + -r, --result-format= [default: human] Format of the test results. + +GLOBAL FLAGS + --json Format output as json. + +DESCRIPTION + Check or poll for the status of a test run operation. + +EXAMPLES + Retrieve results for test run 45f70417-df21-4917-a667-abc2ee46dc63 and store the results as JSON in the results.json file + + $ sf provar manager test run report -i 45f70417-df21-4917-a667-abc2ee46dc63 -r json -o results.json + + Retrieve results for test run 45f70417-df21-4917-a667-abc2ee46dc63 and store the results as JUnit in the junit-results.xml file: + + $ sf provar manager test run report -i 45f70417-df21-4917-a667-abc2ee46dc63 -r junit -o junit-results.xml + +``` diff --git a/messages/provar.config.get.md b/messages/provar.config.get.md index bf255c4..c88dc28 100644 --- a/messages/provar.config.get.md +++ b/messages/provar.config.get.md @@ -1,16 +1,16 @@ # summary -Retrieves a value from the loaded properties file. +Retrieve a value from the specified JSON file. # description -Retrieves a value from the loaded properties file. +Retrieve a value from the specified JSON file. # examples -- Retrieves a value from the loaded properties file +- Get the testEnvironment value within the environment property from the config.json file: - <%= config.bin %> <%= command.id %> 'key' + $ sf provar config get environment.testEnvironment -f config.json # error.MultipleFailure diff --git a/messages/provar.config.set.md b/messages/provar.config.set.md index c20934b..5902fb8 100644 --- a/messages/provar.config.set.md +++ b/messages/provar.config.set.md @@ -1,16 +1,24 @@ # summary -Sets a property in the loaded properties file. +Set one or more properties in the specified JSON file. # description -Sets a property in the loaded properties file. +Set one or more properties in the specified JSON file. # examples -- Sets a property in the loaded properties file with resp. values +- Set the environment to “SIT” in the config.json properties file: - <%= config.bin %> <%= command.id %> 'key'='value' + $ sf provar config set environment.testEnvironment="SIT" -f config.json + +- Set the testEnvironment to “SIT” and the webBrowser to “Chrome”, within the environment property. + + $ sf provar config set environment.testEnvironment="SIT" environment.webBrowser="Chrome" -f config.json + +- Set testCases to a list of test case paths in the config.json properties file. + + $ sf provar config set testCases='["tests/myTestCase.testcase","tests/testSuite1/myTestCase1.testCase"]' -f config.json # error.MultipleFailure diff --git a/package.json b/package.json index 96b3052..9517829 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@provartesting/provardx-cli", "description": "A plugin for the Salesforce CLI to orchestrate testing activities and report quality metrics to Provar Manager", - "version": "1.4.1", + "version": "1.4.2", "license": "BSD-3-Clause", "plugins": [ "@provartesting/provardx-plugins-automation", @@ -20,7 +20,7 @@ "node-stream-zip": "^1.15.0", "@provartesting/provardx-plugins-utils": "1.2.0", "@provartesting/provardx-plugins-automation": "1.1.0", - "@provartesting/provardx-plugins-manager": "1.2.0", + "@provartesting/provardx-plugins-manager": "1.2.1", "sync-request": "^6.1.0", "xml-js": "^1.6.11" }, From 88f1538b786926dc405b52aa6cbc87d6b6947fd2 Mon Sep 17 00:00:00 2001 From: Palak-Bansal-Provar <89642292+Palak-Bansal-Provar@users.noreply.github.com> Date: Wed, 4 Dec 2024 12:08:41 +0530 Subject: [PATCH 2/3] Release v1.4.5 (#99) Utils: Error Code additions specific to the manager and addition of sfProvarResult.ts to be extended further by other command specific result classes. Automation: Changes specific to shows logs to console by default for automation test run command Manager: Manager test run abort command. Aborts the test run started by test run command by specifying the uuid/externalId --- package.json | 8 ++++---- src/commands/provar/automation/config/set.ts | 2 +- src/commands/provar/config/set.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 9517829..b5880db 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@provartesting/provardx-cli", "description": "A plugin for the Salesforce CLI to orchestrate testing activities and report quality metrics to Provar Manager", - "version": "1.4.2", + "version": "1.4.6", "license": "BSD-3-Clause", "plugins": [ "@provartesting/provardx-plugins-automation", @@ -18,9 +18,9 @@ "fast-xml-parser": "^4.3.6", "jsonschema": "^1.4.1", "node-stream-zip": "^1.15.0", - "@provartesting/provardx-plugins-utils": "1.2.0", - "@provartesting/provardx-plugins-automation": "1.1.0", - "@provartesting/provardx-plugins-manager": "1.2.1", + "@provartesting/provardx-plugins-utils": "1.3.1", + "@provartesting/provardx-plugins-automation": "1.2.1", + "@provartesting/provardx-plugins-manager": "1.3.1", "sync-request": "^6.1.0", "xml-js": "^1.6.11" }, diff --git a/src/commands/provar/automation/config/set.ts b/src/commands/provar/automation/config/set.ts index c1279cb..600877d 100644 --- a/src/commands/provar/automation/config/set.ts +++ b/src/commands/provar/automation/config/set.ts @@ -68,7 +68,7 @@ export default class SfProvarConfigSet extends SfCommand } } if (this.errorHandler.getErrors().length == 0) { - fileSystem.writeFileSync(propertiesFilePath, JSON.stringify(propertyFileContent, null, 3)); + fileSystem.writeFileSync(propertiesFilePath, JSON.stringify(propertyFileContent, null, 4)); } } catch (err: any) { if (err.name === 'InvalidArgumentFormatError') { diff --git a/src/commands/provar/config/set.ts b/src/commands/provar/config/set.ts index 331bb4c..8ba1152 100644 --- a/src/commands/provar/config/set.ts +++ b/src/commands/provar/config/set.ts @@ -81,7 +81,7 @@ export default class SfProvarConfigSet extends SfCommand } } if (this.errorHandler.getErrors().length == 0) { - fileSystem.writeFileSync(propertiesFilePath, JSON.stringify(propertyFileContent, null, 3)); + fileSystem.writeFileSync(propertiesFilePath, JSON.stringify(propertyFileContent, null, 4)); } } catch (err: any) { if (err.name === 'InvalidArgumentFormatError') { From 561df3ccbbbb753e190f372b7add426b54de67ae Mon Sep 17 00:00:00 2001 From: Palak-Bansal-Provar <89642292+Palak-Bansal-Provar@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:20:29 +0530 Subject: [PATCH 3/3] PDX-457: bumped version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b5880db..577f8f4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@provartesting/provardx-cli", "description": "A plugin for the Salesforce CLI to orchestrate testing activities and report quality metrics to Provar Manager", - "version": "1.4.6", + "version": "1.4.7", "license": "BSD-3-Clause", "plugins": [ "@provartesting/provardx-plugins-automation",