Skip to content

Commit c7317b2

Browse files
himanshu.sharmahimanshu.sharma
authored andcommitted
provardx initial commit
1 parent 48ae0ee commit c7317b2

30 files changed

Lines changed: 4704 additions & 0 deletions
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*-debug.log
2+
*-error.log
3+
/.nyc_output
4+
/.circleci
5+
/.vscode
6+
/.images
7+
/dist
8+
/lib
9+
/package-lock.json
10+
/tmp
11+
node_modules
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>com.provar.plugins.provardx</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.wst.validation.validationbuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>com.genuitec.eclipse.typescript.typeScriptBuilder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
</buildSpec>
34+
<natures>
35+
<nature>org.eclipse.pde.PluginNature</nature>
36+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
37+
</natures>
38+
</projectDescription>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<installed facet="webclipse.typescript" version="1.0"/>
4+
</faceted-project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: Provardx
4+
Bundle-SymbolicName: com.provar.plugins.provardx
5+
Bundle-Version: 1.0.0.qualifier
6+
Bundle-Vendor: PROVAR
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
@provartesting/provardx
2+
=======================
3+
4+
sfdx custom plugin to run provar testcases
5+
6+
[![Version](https://img.shields.io/npm/v/@provartesting/provardx.svg)](https://npmjs.org/package/@provartesting/provardx)
7+
[![CircleCI](https://circleci.com/gh/provardx/provardx/tree/master.svg?style=shield)](https://circleci.com/gh/provardx/provardx/tree/master)
8+
[![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)
9+
[![Codecov](https://codecov.io/gh/provardx/provardx/branch/master/graph/badge.svg)](https://codecov.io/gh/provardx/provardx)
10+
[![Greenkeeper](https://badges.greenkeeper.io/provardx/provardx.svg)](https://greenkeeper.io/)
11+
[![Known Vulnerabilities](https://snyk.io/test/github/provardx/provardx/badge.svg)](https://snyk.io/test/github/provardx/provardx)
12+
[![Downloads/week](https://img.shields.io/npm/dw/@provartesting/provardx.svg)](https://npmjs.org/package/@provartesting/provardx)
13+
[![License](https://img.shields.io/npm/l/@provartesting/provardx.svg)](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!
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
environment:
2+
nodejs_version: "10"
3+
cache:
4+
- '%LOCALAPPDATA%\Yarn -> appveyor.yml'
5+
- node_modules -> yarn.lock
6+
7+
install:
8+
- ps: Install-Product node $env:nodejs_version x64
9+
- yarn
10+
test_script:
11+
- yarn test
12+
13+
after_test:
14+
- .\node_modules\.bin\nyc report --reporter text-lcov > coverage.lcov
15+
- ps: |
16+
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
17+
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
18+
bash codecov.sh
19+
20+
21+
build: off
22+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
3+
require('@oclif/command').run()
4+
.catch(require('@oclif/errors/handle'))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
node "%~dp0\run" %*
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commandDescription": "Pre-compiles any /src PageObject or PageControl Java source files into object code to use in runtests",
3+
"propertyFileFlagDescription" : "Specify custom property file.",
4+
"loglevelFlagDescription": "Specify log level for command output"
5+
}
6+

0 commit comments

Comments
 (0)