示例#1
0
 public void Approval_BulkApprovalToolApprove_WS_1130()
 {
     if (!DataParser.ReturnExecution("WS_1130"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1130.xml";
         string user        = AwardData.GetAwardUserName(_file),
                msg         = AwardData.GetAwardMessage(_file),
                award       = AwardData.GetAwardName(_file),
                begindate   = AwardData.GetAwardBeginDate(_file),
                endate      = AwardData.GetAwardEndDate(_file),
                description = AwardData.GetAwardDescription(_file),
                Criteria    = AwardData.GetAwardCriteria(_file),
                subCriteria = AwardData.GetSubCriteria(_file),
                value       = AwardData.GetAwardAmountValue(_file),
                ccEmail     = AwardData.GetAwardCCEmail(_file),
                proxyname   = AwardData.GetApprovalUserName(_file);
         MainHomePage proxy = InitialPage.Go().Logon().ClickLogin().NavigateToAdminHomePageSpan().
                              ClickOptionProxy("Proxy").EnterUserNameProxySprint2(user).ProxyToMainHomePageSprint().ClosePopUp();
         NominationHomePage recognitionPage = proxy.NavigateToNominationSprint();
         recognitionPage
         .SelectRecipientType("multiple")
         .SearchEmployeeFoundMultiple("Brenda Michel")
         .SearchEmployeeFoundMultiple("Adri Johnson")
         .SearchEmployeeFoundMultiple("Ada Pitocco")
         .SearchEmployeeFoundMultiple("Alex Alvarado")
         .ClickNextStep2()
         .SelectAwardMultiple(award, 2)
         .SelectValueOfAwardSprint(value)
         .EnterBeginDate(begindate)
         .EnterEndDate(endate)
         .SelectValues(Criteria)
         .SelectValues(subCriteria)
         .FillDescription(description)
         .FillMsg(msg)
         .ClickNextSprint()
         .EnterUserCCEmail(ccEmail).ClickNextGeneric();
         Assert.AreEqual("Ready to send?", recognitionPage.GetReadyToSendMsg(),
                         "The message is not ready to send");
         Assert.AreEqual("SEND RECOGNITION", recognitionPage.GetBtnSendRecognition(),
                         "Submit button is not well written");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
         Assert.AreEqual("FINISH", recognitionPage.GetBtnFinishLabel(), "Button finish its not correct write");
         Assert.AreEqual("RECOGNIZE SOMEONE ELSE", recognitionPage.GetBtnRecognizOtherLabelSprint(),
                         "Button finish its not correct write");
         recognitionPage.ExitProxy2();
         Thread.Sleep(1000);
         proxy =
             proxy.NavigateToAdminHomePageSpan()
             .ClickOptionProxy("Proxy")
             .EnterUserNameProxySprint2(proxyname)
             .ProxyToMainHomePageSprint()
             .ClosePopUp();
         var pending = proxy.NavigateToPendingApprovals();
         Assert.AreEqual(user, pending.GetFirstUserApproval(), user + " is not present");
         var popUp = pending.ClickThumpsUp();
         Assert.IsTrue(popUp.IsPopUpPresent(), "Pop Up To Approve or Decline was not present");
         popUp.ApproveAllorDeclineAll();
         Assert.AreEqual("Successfully approved!", popUp.GetSuccesfullMsg(), "Successfull message is not present");
         popUp.ClickClose();
     }
 }