Example #1
0
 private void btnExecute_Click(object sender, EventArgs e)
 {
     btnExecute.Enabled = false;
     txtInfo.Text       = "";
     if (validate().Length > 0)
     {
         txtInfo.Text      = validate();
         txtInfo.ForeColor = Color.Red;
     }
     else
     {
         if (issueType == IssueType.TestExecution)
         {
             List <FieldsTestExecution> fieldsIssues  = ExcelUtils.getDataTestExecution(txtDataPath.Text, txtProjectKey.Text);
             List <ResponseInfo>        responseInfos = new List <ResponseInfo>();
             foreach (var p in fieldsIssues)
             {
                 TestExecution issue = new TestExecution {
                     fields = p
                 };
                 ResponseInfo responseInfo = RestShapUtils.getInstance().doRequestCreateTestExecution(issue);
                 responseInfos.Add(responseInfo);
                 txtInfo.Text += "\n" + responseInfo.message;
             }
             saveFile(responseInfos);
         }
         else
         {
             List <FieldsSubTestExecution> fieldsSubTests = ExcelUtils.getDataSubTestExecution(txtDataPath.Text, txtProjectKey.Text);
             List <ResponseInfo>           responseInfos  = new List <ResponseInfo>();
             foreach (var p in fieldsSubTests)
             {
                 SubTestExecution issue = new SubTestExecution {
                     fields = p
                 };
                 ResponseInfo responseInfo = RestShapUtils.getInstance().doRequestCreateSubTestExecution(issue);
                 responseInfos.Add(responseInfo);
                 txtInfo.Text += "\n" + responseInfo.message;
             }
             saveFile(responseInfos);
         }
     }
     btnExecute.Enabled = true;
 }