diff --git a/README.md b/README.md index 66fd9ce..3ec1b10 100644 --- a/README.md +++ b/README.md @@ -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)| diff --git a/bin/run_functions.js b/bin/run_functions.js index c8f8c3c..ce4d056 100644 --- a/bin/run_functions.js +++ b/bin/run_functions.js @@ -29,6 +29,8 @@ module.exports.dispatcher = function (args) { 'testsuite', 'securitytest', 'tags', + 'callback', + 'hostAndPort', 'environment', '=printReport', 'output', @@ -57,7 +59,7 @@ module.exports.dispatcher = function (args) { function printModuleHelp() { util.error("Usage: testengine run "); util.error("Commands: "); - util.error(" project [testsuite=] [async] [skipdeps] [priorityJob] [testcase=] [securitytest=] [timeout=] [tags=(tag1,tag2)] [output=] [printReport] [reportFileName=] [format=junit/excel/json/pdf] [environment=]"); + util.error(" project [testsuite=] [async] [skipdeps] [priorityJob] [testcase=] [securitytest=] [timeout=] [tags=(tag1,tag2)] [output=] [printReport] [reportFileName=] [format=junit/excel/json/pdf] [environment=] [hostAndPort=] [callback=]"); util.error(" [projectPassword=] [proxyHost=] [proxyPort=] [proxyUser=]"); util.error(" [proxyPassword=] "); util.error(" help"); @@ -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'); @@ -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; @@ -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); diff --git a/package.json b/package.json index 7970b22..ed51064 100644 --- a/package.json +++ b/package.json @@ -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",