|
| 1 | +@provartesting/provardx |
| 2 | +======================= |
| 3 | + |
| 4 | +sfdx custom plugin to run provar testcases |
| 5 | + |
| 6 | +[](https://npmjs.org/package/@provartesting/provardx) |
| 7 | +[](https://circleci.com/gh/provardx/provardx/tree/master) |
| 8 | +[](https://ci.appveyor.com/project/heroku/provardx/branch/master) |
| 9 | +[](https://codecov.io/gh/provardx/provardx) |
| 10 | +[](https://greenkeeper.io/) |
| 11 | +[](https://snyk.io/test/github/provardx/provardx) |
| 12 | +[](https://npmjs.org/package/@provartesting/provardx) |
| 13 | +[](https://github.com/provardx/provardx/blob/master/package.json) |
| 14 | + |
| 15 | +<!-- toc --> |
| 16 | +* [Debugging your plugin](#debugging-your-plugin) |
| 17 | +<!-- tocstop --> |
| 18 | +<!-- install --> |
| 19 | +<!-- usage --> |
| 20 | +```sh-session |
| 21 | +$ npm install -g @provartesting/provardx |
| 22 | +$ sfdx COMMAND |
| 23 | +running command... |
| 24 | +$ sfdx (-v|--version|version) |
| 25 | +@provartesting/provardx/0.0.1 win32-x64 node-v10.15.3 |
| 26 | +$ sfdx --help [COMMAND] |
| 27 | +USAGE |
| 28 | + $ sfdx COMMAND |
| 29 | +... |
| 30 | +``` |
| 31 | +<!-- usagestop --> |
| 32 | +<!-- commands --> |
| 33 | +* [`sfdx provar:compile [-p <string>] [--json] [-l <string>]`](#sfdx-provarcompile--p-string---json--l-string) |
| 34 | +* [`sfdx provar:metadatacache [-m <string>] [-c <string>] [-p <string>] [--json] [-l <string>]`](#sfdx-provarmetadatacache--m-string--c-string--p-string---json--l-string) |
| 35 | +* [`sfdx provar:runtests [-f <string>] [-p <string>] [-o <string>] [-c <string>] [-m <string>] [-s <string>] [--json] [-l <string>]`](#sfdx-provarruntests--f-string--p-string--o-string--c-string--m-string--s-string---json--l-string) |
| 36 | +* [`sfdx provar:validate [-p <string>] [--json] [-l <string>]`](#sfdx-provarvalidate--p-string---json--l-string) |
| 37 | + |
| 38 | +## `sfdx provar:compile [-p <string>] [--json] [-l <string>]` |
| 39 | + |
| 40 | +Pre-compiles any /src PageObject or PageControl Java source files into object code to use in runtests |
| 41 | + |
| 42 | +``` |
| 43 | +USAGE |
| 44 | + $ sfdx provar:compile [-p <string>] [--json] [-l <string>] |
| 45 | +
|
| 46 | +OPTIONS |
| 47 | + -l, --loglevel=loglevel Specify log level for command output |
| 48 | + -p, --propertyfile=propertyfile Specify custom property file. |
| 49 | + --json format output as json |
| 50 | +
|
| 51 | +EXAMPLE |
| 52 | + $ sfdx provar:compile -p './myproperties.json' --json --loglevel SEVERE |
| 53 | +``` |
| 54 | + |
| 55 | +_See code: [src\commands\provar\compile.ts](https://github.com/provardx/provardx/blob/v0.0.1/src\commands\provar\compile.ts)_ |
| 56 | + |
| 57 | +## `sfdx provar:metadatacache [-m <string>] [-c <string>] [-p <string>] [--json] [-l <string>]` |
| 58 | + |
| 59 | +Command to pre-download any required metadata for a specified user or provar connections. |
| 60 | + |
| 61 | +``` |
| 62 | +USAGE |
| 63 | + $ sfdx provar:metadatacache [-m <string>] [-c <string>] [-p <string>] [--json] [-l <string>] |
| 64 | +
|
| 65 | +OPTIONS |
| 66 | + -c, --cachepath=cachepath Relative or full file path for where the metadata cache will be stored. |
| 67 | + -l, --loglevel=loglevel Specify the log level for command |
| 68 | +
|
| 69 | + -m, --metadatalevel=metadatalevel Permitted values reload (get all metadata - default) | refresh (only download |
| 70 | + changes). |
| 71 | +
|
| 72 | + -p, --propertyfile=propertyfile Specify custom property file. |
| 73 | +
|
| 74 | + --json format output as json |
| 75 | +
|
| 76 | +EXAMPLE |
| 77 | + $ sfdx provar:metadatacache -m 'refresh' -c './metadata' -f './myproperties.json' |
| 78 | +``` |
| 79 | + |
| 80 | +_See code: [src\commands\provar\metadatacache.ts](https://github.com/provardx/provardx/blob/v0.0.1/src\commands\provar\metadatacache.ts)_ |
| 81 | + |
| 82 | +## `sfdx provar:runtests [-f <string>] [-p <string>] [-o <string>] [-c <string>] [-m <string>] [-s <string>] [--json] [-l <string>]` |
| 83 | + |
| 84 | +Runs the specified list of Provar test cases against the currently configured SFDX defaultuserrname |
| 85 | + |
| 86 | +``` |
| 87 | +USAGE |
| 88 | + $ sfdx provar:runtests [-f <string>] [-p <string>] [-o <string>] [-c <string>] [-m <string>] [-s <string>] [--json] |
| 89 | + [-l <string>] |
| 90 | +
|
| 91 | +OPTIONS |
| 92 | + -c, --cachepath=cachepath Specify relative or full file path for where a metadata cache has |
| 93 | + already been downloaded using either a VCS extract or metadata |
| 94 | + ProvarDX command. |
| 95 | +
|
| 96 | + -f, --filespec=filespec Specify comma-delimited, ordered paths of test cases to be |
| 97 | + executed. If not provided all tests in the PROJECTPATH will be |
| 98 | + executed. |
| 99 | +
|
| 100 | + -l, --loglevel=loglevel Specify the level of feedback provided during the compilation |
| 101 | + (see above) and execution. |
| 102 | +
|
| 103 | + -m, --metadatalevel=metadatalevel Specify permitted values reload (get all metadata - default) | |
| 104 | + refresh (only download changes). This overrides any settings made |
| 105 | + in the propertyfile. |
| 106 | +
|
| 107 | + -o, --connectionoverridefile=connectionoverridefile Connection file in the format provardx-connection-schema.json |
| 108 | + providing a mapping between the Provar project Connection names |
| 109 | + and the target users to be used. |
| 110 | +
|
| 111 | + -p, --propertyfile=propertyfile provardx-properties.json file. If filepath specified the filename |
| 112 | + will be assumed or it can be specified (.e.g myprops.json). File |
| 113 | + must be in JSON format and conform to the provardx-properties |
| 114 | + JSON schema. |
| 115 | +
|
| 116 | + -s, --secrets=secrets Specify path to secrets file |
| 117 | +
|
| 118 | + --json format output as json |
| 119 | +
|
| 120 | +EXAMPLE |
| 121 | + $ sfdx provar:runtests -f './myproperties.json' |
| 122 | +``` |
| 123 | + |
| 124 | +_See code: [src\commands\provar\runtests.ts](https://github.com/provardx/provardx/blob/v0.0.1/src\commands\provar\runtests.ts)_ |
| 125 | + |
| 126 | +## `sfdx provar:validate [-p <string>] [--json] [-l <string>]` |
| 127 | + |
| 128 | +Validate the provardx property file agains standard JSON Schema |
| 129 | + |
| 130 | +``` |
| 131 | +USAGE |
| 132 | + $ sfdx provar:validate [-p <string>] [--json] [-l <string>] |
| 133 | +
|
| 134 | +OPTIONS |
| 135 | + -l, --loglevel=loglevel Allow to provide loglevels. |
| 136 | + -p, --propertyfile=propertyfile Specify custom property file. |
| 137 | + --json format output as json |
| 138 | +
|
| 139 | +EXAMPLES |
| 140 | + $ sfdx provar:validate |
| 141 | + Property file is valid. |
| 142 | + |
| 143 | + $ sfdx provar:validate --json |
| 144 | + Invalid property file. |
| 145 | + [Detailed validation error shown] |
| 146 | + |
| 147 | + $ sfdx provar:validate -p './provardx-properties.json' --json |
| 148 | + Invalid property file. |
| 149 | + [Detailed validation error shown] |
| 150 | +``` |
| 151 | + |
| 152 | +_See code: [src\commands\provar\validate.ts](https://github.com/provardx/provardx/blob/v0.0.1/src\commands\provar\validate.ts)_ |
| 153 | +<!-- commandsstop --> |
| 154 | +<!-- debugging-your-plugin --> |
| 155 | +# Debugging your plugin |
| 156 | +We recommend using the Visual Studio Code (VS Code) IDE for your plugin development. Included in the `.vscode` directory of this plugin is a `launch.json` config file, which allows you to attach a debugger to the node process when running your commands. |
| 157 | + |
| 158 | +To debug the `hello:org` command: |
| 159 | +1. Start the inspector |
| 160 | + |
| 161 | +If you linked your plugin to the sfdx cli, call your command with the `dev-suspend` switch: |
| 162 | +```sh-session |
| 163 | +$ sfdx hello:org -u myOrg@example.com --dev-suspend |
| 164 | +``` |
| 165 | + |
| 166 | +Alternatively, to call your command using the `bin/run` script, set the `NODE_OPTIONS` environment variable to `--inspect-brk` when starting the debugger: |
| 167 | +```sh-session |
| 168 | +$ NODE_OPTIONS=--inspect-brk bin/run hello:org -u myOrg@example.com |
| 169 | +``` |
| 170 | + |
| 171 | +2. Set some breakpoints in your command code |
| 172 | +3. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view. |
| 173 | +4. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen. |
| 174 | +5. Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program. |
| 175 | +6. Hit the green play button at the top middle of VS Code (this play button will be to the right of the play button that you clicked in step #5). |
| 176 | +<br><img src=".images/vscodeScreenshot.png" width="480" height="278"><br> |
| 177 | +Congrats, you are debugging! |
0 commit comments