Advertisement
Guest User

Untitled

a guest
May 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exports.updateTestRail = function(){
  2.     jasmine.getEnv().addReporter({
  3.         suiteStarted: function(result,done) {
  4.             tr.getSections({
  5.                 project_id : 5,
  6.                 suite_id : 8
  7.             }).then(function (res) {
  8.                 data = {
  9.                     sections: res
  10.                 }
  11.                 sectionId = jsonQuery('sections[name='+result.description+']', {data: data}).value.id;
  12.                 done();
  13.             })
  14.         },
  15.         specStarted: function(result) {
  16.             tr.getCases({
  17.                 project_id : 5,
  18.                 filters: {
  19.                     suite_id : 8,
  20.                     section_id : sectionId,
  21.                 }
  22.             }).then(function (res) {
  23.                 data= {
  24.                     cases: res
  25.                 }
  26.                 try {
  27.  
  28.                     var caseId = jsonQuery('cases[title='+result.description+']', {data: data}).value.id
  29.  
  30.                 } catch (err) {
  31.  
  32.                     console.log(result.description)
  33.  
  34.                 }
  35.                 var object = {
  36.                     "case_id": caseId,
  37.                     "type_id": 3
  38.                 };
  39.                 tr.updateCase(object);
  40.             })
  41.         }
  42.     });
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement