Skip to content

Commit 47fac03

Browse files
Merge pull request #28 from waxtell/master
Add support for API v1.8 features callback and hostAndPort (run project)
2 parents 3963db2 + f828190 commit 47fac03

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ table includes the currently implemented options.
8383
| tags | "smoketest,regression" | See description above|
8484
| output | c:\\temp\\reports | Directory to store reports in.|
8585
| reportFileName | N/A | File name for the report. If omitted, the report will get a name based on the test job ID|
86+
| callback | http://localhost:8080 | The URL, to which the results will be posted|
87+
| environment | dev | Specify the The target environment for test job. Can not be used with **hostAndPort**|
88+
| hostAndPort | localhost:8080 | The host and port to be used for HTTP requests sent by this test, in the format host:[port]. Can not be used with **environment**|
8689
| format | excel | Specify the file type of the report. Currently supported formats are json, junit, excel and pdf. The default format is junit|
8790
| proxyHost | 172.0.1.10 | Hostname or IP of the server to use as a proxy for outgoing requests (from TestEngine)|
8891
| proxyPort | 8888 | Port of the proxyHost to contact for outgoing requests (from TestEngine)|

bin/run_functions.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module.exports.dispatcher = function (args) {
2929
'testsuite',
3030
'securitytest',
3131
'tags',
32+
'callback',
33+
'hostAndPort',
3234
'environment',
3335
'=printReport',
3436
'output',
@@ -57,7 +59,7 @@ module.exports.dispatcher = function (args) {
5759
function printModuleHelp() {
5860
util.error("Usage: testengine run <command>");
5961
util.error("Commands: ");
60-
util.error(" project [testsuite=<name>] [async] [skipdeps] [priorityJob] [testcase=<name>] [securitytest=<name>] [timeout=<seconds>] [tags=(tag1,tag2)] [output=<directory>] [printReport] [reportFileName=<filename>] [format=junit/excel/json/pdf] [environment=<environment name>]");
62+
util.error(" project [testsuite=<name>] [async] [skipdeps] [priorityJob] [testcase=<name>] [securitytest=<name>] [timeout=<seconds>] [tags=(tag1,tag2)] [output=<directory>] [printReport] [reportFileName=<filename>] [format=junit/excel/json/pdf] [environment=<environment name>] [hostAndPort=<host:port>] [callback=<url>]");
6163
util.error(" [projectPassword=<password>] [proxyHost=<hostname>] [proxyPort=<port>] [proxyUser=<username>]");
6264
util.error(" [proxyPassword=<password>] <filename>");
6365
util.error(" help");
@@ -67,11 +69,17 @@ function conflictingOptionsCheck(options) {
6769
if (('securitytest' in options) && (('testcase' in options) || ('testsuite' in options))) {
6870
util.printErrorAndExit('Error: Parameters testsuite and testcase are not allowed when securitytest is used');
6971
}
72+
7073
if ('tags' in options) {
7174
if (('testsuite' in options) || ('testcase' in options)) {
72-
util.printErrorAndExit('Error: tags cannot be used together with testcase/testsuite ');
75+
util.printErrorAndExit('Error: tags cannot be used together with testcase/testsuite');
7376
}
7477
}
78+
79+
if(('hostAndPort' in options) && ('environment' in options)) {
80+
util.printErrorAndExit('Error: environment cannot be used together with hostAndPort');
81+
}
82+
7583
if (('testcase' in options)
7684
&& !('testsuite' in options)) {
7785
util.error('Warning: Specifying testscase without testsuite can cause unpredictable results');
@@ -177,6 +185,12 @@ function getQueryStringFromOptions(options) {
177185
queryStringPart = 'tags=' + encodeURI(tags);
178186
break;
179187
}
188+
case 'callback':
189+
queryStringPart = 'callback=' + encodeURI(options[key]);
190+
break;
191+
case 'hostAndPort':
192+
queryStringPart = 'hostAndPort=' + encodeURI(options[key]);
193+
break;
180194
case 'proxyUser':
181195
queryStringPart = 'proxyUsername=' + encodeURI(options[key]);
182196
break;
@@ -257,7 +271,6 @@ function executeProject(filename, project, options) {
257271
});
258272
util.output(path.resolve(projectFilesByLength[0]));
259273
let fullPathUpToComposite = path.dirname(path.resolve(projectFilesByLength[0]));
260-
projectRootPath = path.dirname(path.resolve(projectFilesByLength[0]));
261274
projectRootPath = path.basename(fullPathUpToComposite);
262275
fullPathUpToComposite = path.dirname(fullPathUpToComposite);
263276

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "testengine-cli",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "CLI for SmartBear ReadyAPI TestEngine",
55
"scripts": {
66
"testengine": "bin/testengine.js",

0 commit comments

Comments
 (0)