Skip to content

Commit

Permalink
Merge pull request dmolchanenko#5 from wolterskluwer-redwoodhq/add-UI…
Browse files Browse the repository at this point in the history
…Snaphots-to-api

add UI Snapshots to remote execution (CLI and REST API) and refactor …
  • Loading branch information
Wolters Kluwer - UpToDate authored Sep 23, 2016
2 parents 85d48ee + a28ad73 commit a4b60a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
8 changes: 5 additions & 3 deletions cli/CIExecution.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ common.parseConfig(function(){
execution.locked = true;
execution.ignoreStatus = false;
execution.ignoreAfterState = false;
execution.ignoreScreenshots = (argv.ignoreScreenshots == 'true');
execution.allScreenshots = (argv.uiSnaphots == 'true' );
execution.lastRunDate = null;
execution.testsetname = argv.testset;
execution.pullLatest = argv.pullLatest;
Expand All @@ -38,7 +40,7 @@ common.parseConfig(function(){
else{
execution.retryCount = "0";
}
if(argv.ignoreScreenshots){
/*if(argv.ignoreScreenshots){
if(argv.ignoreScreenshots === "true"){
execution.ignoreScreenshots = true;
}
Expand All @@ -48,7 +50,7 @@ common.parseConfig(function(){
}
else{
execution.ignoreScreenshots = false;
}
}*/
execution._id = new ObjectID().toString();

common.initDB(common.Config.DBPort,function(){
Expand Down Expand Up @@ -191,7 +193,7 @@ function StartExecution(execution,testcases,callback){
});

// write data to request body
req.write(JSON.stringify({retryCount:execution.retryCount,ignoreAfterState:false,sendEmail:execution.sendEmail,emails:execution.emails,ignoreStatus:execution.ignoreStatus,ignoreScreenshots:execution.ignoreScreenshots,testcases:testcases,variables:execution.variables,executionID:execution._id,machines:execution.machines,templates:execution.templates}));
req.write(JSON.stringify({retryCount:execution.retryCount,ignoreAfterState:false,sendEmail:execution.sendEmail,emails:execution.emails,ignoreStatus:execution.ignoreStatus,ignoreScreenshots:execution.ignoreScreenshots,allScreenshots:execution.allScreenshots,testcases:testcases,variables:execution.variables,executionID:execution._id,machines:execution.machines,templates:execution.templates}));
req.end();
}

Expand Down
2 changes: 1 addition & 1 deletion public/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<div style="width:200px; margin:0 auto 40px;"><a href="/agentsetup/Agent_RedwoodHQ_Setup.exe" style="color:blue;width:200px; margin-left:60px;">Download Agent</a></div>
<BR>&nbsp;<BR>
<div style="color:#9aa94f;width:200px; margin:0 auto;">Default credentials are: admin/admin</div>
<div style="width:70px; margin:0 auto 20px;">Version 2.4.9</div>
<div style="width:75px; margin:0 auto 20px;">Version 2.4.11</div>
</body>
</html>
23 changes: 14 additions & 9 deletions routes/remoteexecution.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ exports.startexecutionPost = function(req, res){
execution.locked = true;
execution.ignoreStatus = false;
execution.ignoreAfterState = false;
execution.ignoreScreenshots = (query.ignoreScreenshots == 'true');
execution.allScreenshots = (query.uiSnapshots == 'true' );
execution.lastRunDate = null;
execution.testsetname = query.testset;
execution.pullLatest = query.pullLatest;
Expand All @@ -81,14 +83,17 @@ exports.startexecutionPost = function(req, res){
} else {
execution.retryCount = '0';
}
if(query.ignoreScreenshots) {
if(query.ignoreScreenshots === 'true' ||
query.ignoreScreenshots === 'false') {
execution.ignoreScreenshots = query.ignoreScreenshots;
} else{
/*if(query.ignoreScreenshots){
if(query.ignoreScreenshots === "true"){
execution.ignoreScreenshots = true;
}
else{
execution.ignoreScreenshots = false;
}
}
else{
execution.ignoreScreenshots = false;
}*/
execution._id = new ObjectID().toString();
var validationDetails = { status : true, error : "" }
if(!_validateQueryParams(query, validationDetails)) {
Expand Down Expand Up @@ -280,7 +285,7 @@ function StartExecution(execution,testcases,finalResponse,callback){
});

// write data to request body
req.write(JSON.stringify({retryCount:execution.retryCount,ignoreAfterState:false,sendEmail:execution.sendEmail,emails:execution.emails,ignoreStatus:execution.ignoreStatus,ignoreScreenshots:execution.ignoreScreenshots,testcases:testcases,variables:execution.variables,executionID:execution._id,machines:execution.machines,templates:execution.templates}));
req.write(JSON.stringify({retryCount:execution.retryCount,ignoreAfterState:false,sendEmail:execution.sendEmail,emails:execution.emails,ignoreStatus:execution.ignoreStatus,ignoreScreenshots:execution.ignoreScreenshots,allScreenshots:execution.allScreenshots,testcases:testcases,variables:execution.variables,executionID:execution._id,machines:execution.machines,templates:execution.templates}));
req.end();
}

Expand Down Expand Up @@ -456,7 +461,7 @@ function GenerateReport(finalResponse, queryParams,cliexecution,xw,callback){
if(testcase == null) {
xw.endElement();
xw.endDocument();
console.log(xw.toString());
//console.log(xw.toString());
callback(exitDetails);
return;
}
Expand Down Expand Up @@ -586,8 +591,8 @@ function _verifyexecution(req, res) {
})

setTimeout(function(){
console.log(newQueryObj);
console.log(validationDetails);
//console.log(newQueryObj);
//console.log(validationDetails);

if(!validationDetails.status) {
var exitDetails = {statusCode : 400, error : "Invalid Query Parameter value(s): " + validationDetails.error };
Expand Down

0 comments on commit a4b60a2

Please sign in to comment.