Skip to content

Commit

Permalink
provardx initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu.sharma authored and himanshu.sharma committed May 14, 2019
1 parent 48ae0ee commit c7317b2
Show file tree
Hide file tree
Showing 30 changed files with 4,704 additions and 0 deletions.
11 changes: 11 additions & 0 deletions com.provar.plugins.provardx/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
11 changes: 11 additions & 0 deletions com.provar.plugins.provardx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*-debug.log
*-error.log
/.nyc_output
/.circleci
/.vscode
/.images
/dist
/lib
/package-lock.json
/tmp
node_modules
38 changes: 38 additions & 0 deletions com.provar.plugins.provardx/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.provar.plugins.provardx</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.typescript.typeScriptBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="webclipse.typescript" version="1.0"/>
</faceted-project>
6 changes: 6 additions & 0 deletions com.provar.plugins.provardx/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Provardx
Bundle-SymbolicName: com.provar.plugins.provardx
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: PROVAR
177 changes: 177 additions & 0 deletions com.provar.plugins.provardx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
@provartesting/provardx
=======================

sfdx custom plugin to run provar testcases

[![Version](https://img.shields.io/npm/v/@provartesting/provardx.svg)](https://npmjs.org/package/@provartesting/provardx)
[![CircleCI](https://circleci.com/gh/provardx/provardx/tree/master.svg?style=shield)](https://circleci.com/gh/provardx/provardx/tree/master)
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/provardx/provardx?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/provardx/branch/master)
[![Codecov](https://codecov.io/gh/provardx/provardx/branch/master/graph/badge.svg)](https://codecov.io/gh/provardx/provardx)
[![Greenkeeper](https://badges.greenkeeper.io/provardx/provardx.svg)](https://greenkeeper.io/)
[![Known Vulnerabilities](https://snyk.io/test/github/provardx/provardx/badge.svg)](https://snyk.io/test/github/provardx/provardx)
[![Downloads/week](https://img.shields.io/npm/dw/@provartesting/provardx.svg)](https://npmjs.org/package/@provartesting/provardx)
[![License](https://img.shields.io/npm/l/@provartesting/provardx.svg)](https://github.com/provardx/provardx/blob/master/package.json)

<!-- toc -->
* [Debugging your plugin](#debugging-your-plugin)
<!-- tocstop -->
<!-- install -->
<!-- usage -->
```sh-session
$ npm install -g @provartesting/provardx
$ sfdx COMMAND
running command...
$ sfdx (-v|--version|version)
@provartesting/provardx/0.0.1 win32-x64 node-v10.15.3
$ sfdx --help [COMMAND]
USAGE
$ sfdx COMMAND
...
```
<!-- usagestop -->
<!-- commands -->
* [`sfdx provar:compile [-p <string>] [--json] [-l <string>]`](#sfdx-provarcompile--p-string---json--l-string)
* [`sfdx provar:metadatacache [-m <string>] [-c <string>] [-p <string>] [--json] [-l <string>]`](#sfdx-provarmetadatacache--m-string--c-string--p-string---json--l-string)
* [`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)
* [`sfdx provar:validate [-p <string>] [--json] [-l <string>]`](#sfdx-provarvalidate--p-string---json--l-string)

## `sfdx provar:compile [-p <string>] [--json] [-l <string>]`

Pre-compiles any /src PageObject or PageControl Java source files into object code to use in runtests

```
USAGE
$ sfdx provar:compile [-p <string>] [--json] [-l <string>]
OPTIONS
-l, --loglevel=loglevel Specify log level for command output
-p, --propertyfile=propertyfile Specify custom property file.
--json format output as json
EXAMPLE
$ sfdx provar:compile -p './myproperties.json' --json --loglevel SEVERE
```

_See code: [src\commands\provar\compile.ts](https://github.com/provardx/provardx/blob/v0.0.1/src\commands\provar\compile.ts)_

## `sfdx provar:metadatacache [-m <string>] [-c <string>] [-p <string>] [--json] [-l <string>]`

Command to pre-download any required metadata for a specified user or provar connections.

```
USAGE
$ sfdx provar:metadatacache [-m <string>] [-c <string>] [-p <string>] [--json] [-l <string>]
OPTIONS
-c, --cachepath=cachepath Relative or full file path for where the metadata cache will be stored.
-l, --loglevel=loglevel Specify the log level for command
-m, --metadatalevel=metadatalevel Permitted values reload (get all metadata - default) | refresh (only download
changes).
-p, --propertyfile=propertyfile Specify custom property file.
--json format output as json
EXAMPLE
$ sfdx provar:metadatacache -m 'refresh' -c './metadata' -f './myproperties.json'
```

_See code: [src\commands\provar\metadatacache.ts](https://github.com/provardx/provardx/blob/v0.0.1/src\commands\provar\metadatacache.ts)_

## `sfdx provar:runtests [-f <string>] [-p <string>] [-o <string>] [-c <string>] [-m <string>] [-s <string>] [--json] [-l <string>]`

Runs the specified list of Provar test cases against the currently configured SFDX defaultuserrname

```
USAGE
$ sfdx provar:runtests [-f <string>] [-p <string>] [-o <string>] [-c <string>] [-m <string>] [-s <string>] [--json]
[-l <string>]
OPTIONS
-c, --cachepath=cachepath Specify relative or full file path for where a metadata cache has
already been downloaded using either a VCS extract or metadata
ProvarDX command.
-f, --filespec=filespec Specify comma-delimited, ordered paths of test cases to be
executed. If not provided all tests in the PROJECTPATH will be
executed.
-l, --loglevel=loglevel Specify the level of feedback provided during the compilation
(see above) and execution.
-m, --metadatalevel=metadatalevel Specify permitted values reload (get all metadata - default) |
refresh (only download changes). This overrides any settings made
in the propertyfile.
-o, --connectionoverridefile=connectionoverridefile Connection file in the format provardx-connection-schema.json
providing a mapping between the Provar project Connection names
and the target users to be used.
-p, --propertyfile=propertyfile provardx-properties.json file. If filepath specified the filename
will be assumed or it can be specified (.e.g myprops.json). File
must be in JSON format and conform to the provardx-properties
JSON schema.
-s, --secrets=secrets Specify path to secrets file
--json format output as json
EXAMPLE
$ sfdx provar:runtests -f './myproperties.json'
```

_See code: [src\commands\provar\runtests.ts](https://github.com/provardx/provardx/blob/v0.0.1/src\commands\provar\runtests.ts)_

## `sfdx provar:validate [-p <string>] [--json] [-l <string>]`

Validate the provardx property file agains standard JSON Schema

```
USAGE
$ sfdx provar:validate [-p <string>] [--json] [-l <string>]
OPTIONS
-l, --loglevel=loglevel Allow to provide loglevels.
-p, --propertyfile=propertyfile Specify custom property file.
--json format output as json
EXAMPLES
$ sfdx provar:validate
Property file is valid.
$ sfdx provar:validate --json
Invalid property file.
[Detailed validation error shown]
$ sfdx provar:validate -p './provardx-properties.json' --json
Invalid property file.
[Detailed validation error shown]
```

_See code: [src\commands\provar\validate.ts](https://github.com/provardx/provardx/blob/v0.0.1/src\commands\provar\validate.ts)_
<!-- commandsstop -->
<!-- debugging-your-plugin -->
# Debugging your plugin
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.

To debug the `hello:org` command:
1. Start the inspector

If you linked your plugin to the sfdx cli, call your command with the `dev-suspend` switch:
```sh-session
$ sfdx hello:org -u myOrg@example.com --dev-suspend
```

Alternatively, to call your command using the `bin/run` script, set the `NODE_OPTIONS` environment variable to `--inspect-brk` when starting the debugger:
```sh-session
$ NODE_OPTIONS=--inspect-brk bin/run hello:org -u myOrg@example.com
```

2. Set some breakpoints in your command code
3. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view.
4. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen.
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.
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).
<br><img src=".images/vscodeScreenshot.png" width="480" height="278"><br>
Congrats, you are debugging!
22 changes: 22 additions & 0 deletions com.provar.plugins.provardx/appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
environment:
nodejs_version: "10"
cache:
- '%LOCALAPPDATA%\Yarn -> appveyor.yml'
- node_modules -> yarn.lock

install:
- ps: Install-Product node $env:nodejs_version x64
- yarn
test_script:
- yarn test

after_test:
- .\node_modules\.bin\nyc report --reporter text-lcov > coverage.lcov
- ps: |
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
bash codecov.sh
build: off

4 changes: 4 additions & 0 deletions com.provar.plugins.provardx/bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

require('@oclif/command').run()
.catch(require('@oclif/errors/handle'))
3 changes: 3 additions & 0 deletions com.provar.plugins.provardx/bin/run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\run" %*
6 changes: 6 additions & 0 deletions com.provar.plugins.provardx/messages/compile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commandDescription": "Pre-compiles any /src PageObject or PageControl Java source files into object code to use in runtests",
"propertyFileFlagDescription" : "Specify custom property file.",
"loglevelFlagDescription": "Specify log level for command output"
}

8 changes: 8 additions & 0 deletions com.provar.plugins.provardx/messages/metadatacache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"commandDescription": "Command to pre-download any required metadata for a specified user or provar connections.",
"metadataLevelFlagDescription" : "Permitted values reload (get all metadata - default) | refresh (only download changes).",
"cachePathFlagDescription": "Relative or full file path for where the metadata cache will be stored.",
"propertyFileFlagDescription" : "Specify custom property file.",
"loglevelFlagDescription": "Specify the log level for command"
}

6 changes: 6 additions & 0 deletions com.provar.plugins.provardx/messages/org.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commandDescription": "print a greeting and your org IDs",
"nameFlagDescription": "name to print",
"forceFlagDescription": "example boolean flag",
"errorNoOrgResults": "No results found for the org '%s'."
}
11 changes: 11 additions & 0 deletions com.provar.plugins.provardx/messages/runtests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commandDescription": "Runs the specified list of Provar test cases against the currently configured SFDX defaultuserrname",
"propertyFileFlagDescription" : "provardx-properties.json file. If filepath specified the filename will be assumed or it can be specified (.e.g myprops.json). File must be in JSON format and conform to the provardx-properties JSON schema.",
"fileSpecFlagDescription" : "Specify comma-delimited, ordered paths of test cases to be executed. If not provided all tests in the PROJECTPATH will be executed.",
"connectionOverridefile" : "Connection file in the format provardx-connection-schema.json providing a mapping between the Provar project Connection names and the target users to be used.",
"cachePathFlagDescription" : "Specify relative or full file path for where a metadata cache has already been downloaded using either a VCS extract or metadata ProvarDX command.",
"metadataLevelFlagDescription" : "Specify permitted values reload (get all metadata - default) | refresh (only download changes). This overrides any settings made in the propertyfile.",
"secretsFlagDescription" : "Specify path to secrets file",
"loglevelFlagDescription" : "Specify the level of feedback provided during the compilation (see above) and execution."
}

7 changes: 7 additions & 0 deletions com.provar.plugins.provardx/messages/validate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"commandDescription": "Validate the provardx property file agains standard JSON Schema",
"propertyFileFlagDescription" : "Specify custom property file.",
"showErrorsFlagDescription": "Allow to show validation errors. Default is false.",
"loglevelFlagDescription": "Allow to provide loglevels."
}

Loading

0 comments on commit c7317b2

Please sign in to comment.