Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ table includes the currently implemented options.
| tags | "smoketest,regression" | See description above|
| output | c:\\temp\\reports | Directory to store reports in.|
| reportFileName | N/A | File name for the report. If omitted, the report will get a name based on the test job ID|
| callback | http://localhost:8080 | The URL, to which the results will be posted|
| environment | dev | Specify the The target environment for test job. Can not be used with **hostAndPort**|
| 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**|
| format | excel | Specify the file type of the report. Currently supported formats are json, junit, excel and pdf. The default format is junit|
| proxyHost | 172.0.1.10 | Hostname or IP of the server to use as a proxy for outgoing requests (from TestEngine)|
| proxyPort | 8888 | Port of the proxyHost to contact for outgoing requests (from TestEngine)|
Expand Down
19 changes: 16 additions & 3 deletions bin/run_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ module.exports.dispatcher = function (args) {
'testsuite',
'securitytest',
'tags',
'callback',
'hostAndPort',
'environment',
'=printReport',
'output',
Expand Down Expand Up @@ -57,7 +59,7 @@ module.exports.dispatcher = function (args) {
function printModuleHelp() {
util.error("Usage: testengine run <command>");
util.error("Commands: ");
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>]");
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>]");
util.error(" [projectPassword=<password>] [proxyHost=<hostname>] [proxyPort=<port>] [proxyUser=<username>]");
util.error(" [proxyPassword=<password>] <filename>");
util.error(" help");
Expand All @@ -67,11 +69,17 @@ function conflictingOptionsCheck(options) {
if (('securitytest' in options) && (('testcase' in options) || ('testsuite' in options))) {
util.printErrorAndExit('Error: Parameters testsuite and testcase are not allowed when securitytest is used');
}

if ('tags' in options) {
if (('testsuite' in options) || ('testcase' in options)) {
util.printErrorAndExit('Error: tags cannot be used together with testcase/testsuite ');
util.printErrorAndExit('Error: tags cannot be used together with testcase/testsuite');
}
}

if(('hostAndPort' in options) && ('environment' in options)) {
util.printErrorAndExit('Error: environment cannot be used together with hostAndPort');
}

if (('testcase' in options)
&& !('testsuite' in options)) {
util.error('Warning: Specifying testscase without testsuite can cause unpredictable results');
Expand Down Expand Up @@ -177,6 +185,12 @@ function getQueryStringFromOptions(options) {
queryStringPart = 'tags=' + encodeURI(tags);
break;
}
case 'callback':
queryStringPart = 'callback=' + encodeURI(options[key]);
break;
case 'hostAndPort':
queryStringPart = 'hostAndPort=' + encodeURI(options[key]);
break;
case 'proxyUser':
queryStringPart = 'proxyUsername=' + encodeURI(options[key]);
break;
Expand Down Expand Up @@ -257,7 +271,6 @@ function executeProject(filename, project, options) {
});
util.output(path.resolve(projectFilesByLength[0]));
let fullPathUpToComposite = path.dirname(path.resolve(projectFilesByLength[0]));
projectRootPath = path.dirname(path.resolve(projectFilesByLength[0]));
projectRootPath = path.basename(fullPathUpToComposite);
fullPathUpToComposite = path.dirname(fullPathUpToComposite);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testengine-cli",
"version": "1.5.0",
"version": "1.6.0",
"description": "CLI for SmartBear ReadyAPI TestEngine",
"scripts": {
"testengine": "bin/testengine.js",
Expand Down