public void NCR_SimpleWF_End_To_End() { string ncrDescription = WF_QaRcrdCtrl_GeneralNCR.Create_and_SaveForward_NCR(UserType.NCRTech); AddAssertionToList(WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInReview(ncrDescription), "VerifyNCRDocIsDisplayedInReview"); GridHelper.ClickEditBtnForRow(); log.Debug("------------send to revise from Review------------"); QaRcrdCtrl_GeneralNCR.ClickBtn_Revise(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Revise, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Revise)"); GridHelper.ClickEditBtnForRow(); log.Debug("------------cancel, edit/saveonly in Revise------------"); QaRcrdCtrl_GeneralNCR.EnterDescription("New NCR Description", true); QaRcrdCtrl_GeneralNCR.ClickBtn_Cancel(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Revise, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Revise)"); GridHelper.ClickEditBtnForRow(); ncrDescription = QaRcrdCtrl_GeneralNCR.EnterDescription(); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveOnly(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Revise, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Revise)"); GridHelper.ClickEditBtnForRow(); log.Debug("------------save&fwd in Review------------"); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); AddAssertionToList(WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInReview(ncrDescription), "VerifyNCRDocIsDisplayedInReview"); GridHelper.ClickEditBtnForRow(); log.Debug("------------save&fwd in ToBeClosed------------"); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.To_Be_Closed, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.To_Be_Closed)"); GridHelper.ClickEditBtnForRow(); log.Debug("------------send to revise from ToBeClosed------------"); QaRcrdCtrl_GeneralNCR.ClickBtn_Revise(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Revise, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Revise)"); GridHelper.ClickEditBtnForRow(); log.Debug("------------save&fwd from Revise to Review------------"); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); AddAssertionToList(WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInReview(ncrDescription), "VerifyNCRDocIsDisplayedInReview"); GridHelper.ClickEditBtnForRow(); log.Debug("------------save&fwd in Review------------"); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.To_Be_Closed, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.To_Be_Closed)"); GridHelper.ClickEditBtnForRow(); QaRcrdCtrl_GeneralNCR.ClickBtn_Close(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsClosed(ncrDescription), "VerifyNCRDocIsDisplayedInClosed"); AssertAll(); }
public void Revise_Ncr_Document_ConcessionRequest_ReturnToConformance() { string ncrDescription = WF_QaRcrdCtrl_GeneralNCR.Create_and_SaveForward_NCR(UserType.NCRTech); LogoutToLoginPage(); WF_QaRcrdCtrl_GeneralNCR.Review_and_Return_NCR_ForRevise(UserType.NCRMgr, ncrDescription); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Creating_Revise, ncrDescription)); GridHelper.ClickEditBtnForRow(); //step for Edit NCR ? QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); WF_QaRcrdCtrl_GeneralNCR.Review_and_Approve_NCR(UserType.NCRMgr, ncrDescription); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition, ncrDescription)); WF_QaRcrdCtrl_GeneralNCR.SaveForward_FromResolutionDisposition_ToVerificationClosure_ReturnToConformance(ncrDescription); WF_QaRcrdCtrl_GeneralNCR.CheckReviseKickback_FromVerificationClosure_ForReturnToConformance(ncrDescription); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition, ncrDescription)); AssertAll(); }
public void Edit_Cancel_SaveOnly_Ncr_Document_ComplexWF() { Report.Step("STEP: Login as NCR Technician, create ncr and enter description, click saveOnly then logout -------"); string ncrDescription = WF_QaRcrdCtrl_GeneralNCR.Create_and_SaveOnly_NCR(UserType.NCRTech); LogoutToLoginPage(); Report.Step("STEP: Login as NCR Manager, edit NCR in revise tab, modify description then click cancel -------"); LoginAs(UserType.NCRMgr); NavigateToPage.QARecordControl_General_NCR(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Creating_Revise, ncrDescription), "VerifyNCRDocIsDisplayed(Creating_Revise)"); GridHelper.ClickEditBtnForRow(); QaRcrdCtrl_GeneralNCR.EnterDescription("Temp Description", true); QaRcrdCtrl_GeneralNCR.ClickBtn_Cancel(); Report.Step("STEP: edit in revise tab then click saveFwd -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Creating_Revise, ncrDescription), "VerifyNCRDocIsDisplayed(Creating_Revise)"); GridHelper.ClickEditBtnForRow(); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); Report.Step("STEP: edit in review tab and select Type of NCR (Level 3) then click cancel -------"); AddAssertionToList(WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInReview(ncrDescription), "VerifyNCRDocIsDisplayed(CQM_Review)"); GridHelper.ClickEditBtnForRow(); QaRcrdCtrl_GeneralNCR.SelectRdoBtn_TypeOfNCR_Level3(); QaRcrdCtrl_GeneralNCR.ClickBtn_Cancel(); Report.Step("STEP: edit in review tab and select Type of NCR (Level 3) then click saveOnly -------"); AddAssertionToList(WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInReview(ncrDescription), "VerifyNCRDocIsDisplayed(CQM_Review)"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.TypeOfNCR_Level3 /*, false*/), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.TypeOfNCR_Level3"); //<----- TODO: uncomment after bug is fixed: Retains selection when clicking Cancel btn after selecting Type Of NCR rdoBtn. QaRcrdCtrl_GeneralNCR.SelectRdoBtn_TypeOfNCR_Level3(); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveOnly(); Report.Step("STEP: edit in review tab and verify Type of NCR selection is intact then click Approve -------"); AddAssertionToList(WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInReview(ncrDescription), "VerifyNCRDocIsDisplayed(CQM_Review)"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.TypeOfNCR_Level3), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.TypeOfNCR_Level3)"); QaRcrdCtrl_GeneralNCR.ClickBtn_Approve(); Report.Step("STEP: edit in Resolution/Disposition tab and verify previously selected required field -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition)"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.TypeOfNCR_Level3), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.TypeOfNCR_Level3)"); Report.Step("STEP: selectDDL Concession Request - Concession Diviation and populate required fields then click Cancel -------"); QaRcrdCtrl_GeneralNCR.PopulateRelatedFields_And_SelectDDL_forConcessionRequest_ConcessionDeviation(); QaRcrdCtrl_GeneralNCR.ClickBtn_Cancel(); Report.Step("STEP: edit in Resolution/Disposition tab then verify Concession Request DDL is set to 'Please Select' -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition)"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyDDListSelectedValue(InputFields.Concession_Request, "Please Select"), "VerifyDDListSelectedValue(InputFields.Concession_Request, \"Please Select\")"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required, false), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required, false)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Accept_As_Is, false), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Accept_As_Is, false)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Repair, false), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Repair, false)"); Report.Step("STEP: selectDDL Concession Request - Concession Diviation, populate required fields then click SaveOnly -------"); QaRcrdCtrl_GeneralNCR.PopulateRelatedFields_And_SelectDDL_forConcessionRequest_ConcessionDeviation(); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveOnly(); Report.Step("STEP: edit in Resolution/Disposition tab and verify Concession Request DDL is set to 'Concession Diviation', checkboxes are selected then click SaveFwd -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition)"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyDDListSelectedValue(InputFields.Concession_Request, "Concession Deviation"), "VerifyDDListSelectedValue(InputFields.Concession_Request, \"Concession Deviation\")"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Accept_As_Is), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Accept_As_Is)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Repair), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Repair)"); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); Report.Step("------ edit in Developer Concurrence tab and verify preivously selected required fields -------"); WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInDevConcurrence(ncrDescription); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyDDListSelectedValue(InputFields.Concession_Request, "Concession Deviation"), "VerifyDDListSelectedValue(InputFields.Concession_Request, \"Concession Deviation\")"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Accept_As_Is), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Accept_As_Is)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Repair), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Repair)"); Report.Step("------ provide signature for Engineer of Record then click Cancel -------"); WF_QaRcrdCtrl_GeneralNCR.SignDateApproveNCR(TableTab.Developer_Concurrence); QaRcrdCtrl_GeneralNCR.ClickBtn_Cancel(); Report.Step("STEP: edit in Developer Concurrence tab and verify signatature for Eng of Record is empty -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Developer_Concurrence, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Developer_Concurrence)"); GridHelper.ClickEditBtnForRow(); WF_QaRcrdCtrl_GeneralNCR.VerifySignatureNCR(TableTab.Developer_Concurrence, ncrDescription, true); Report.Step("------ provide signature, name and select Approval 'Yes' rdoBtn then click SaveOnly -------"); WF_QaRcrdCtrl_GeneralNCR.SignDateApproveNCR(TableTab.Developer_Concurrence); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveOnly(); Report.Step("STEP: edit in Developer Concurrence tab and verify signature value attribute is not empty, name field is not empty, approval rdoBtn is selected then click saveFwd -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Developer_Concurrence, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Developer_Concurrence)"); GridHelper.ClickEditBtnForRow(); WF_QaRcrdCtrl_GeneralNCR.VerifySignatureNCR(TableTab.Developer_Concurrence, ncrDescription, false); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInLAWAConcurrence(ncrDescription); GridHelper.ClickEditBtnForRow(); QaRcrdCtrl_GeneralNCR.SignDateApproveNcrByReviewer(Reviewer.Owner); QaRcrdCtrl_GeneralNCR.ClickBtn_Cancel(); Report.Step("STEP: edit in DOT Approval tab and verify signatature for DOT Review is empty -------"); AddAssertionToList(WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInDOTApprovalOrLAWAConcurrence(ncrDescription), "VerifyNCRDocIsDisplayedInDOTApprovalOrLAWAConcurrence"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifySignatureField(Reviewer.Owner, true), "VerifySignatureField(Reviewer.Owner, true)"); AddAssertionToList(VerifyInputField(InputFields.Owner_Review, true), "VerifyInputField(InputFields.Owner_Review, true)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.Owner_Approval_NA), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.Owner_Approval_NA)"); Report.Step("STEP: provide signature, name and select Approval 'Yes' rdoBtn then click SaveOnly -------"); QaRcrdCtrl_GeneralNCR.SignDateApproveNcrByReviewer(Reviewer.Owner); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveOnly(); Report.Step("STEP: edit in DOT Approval tab and verify signature value attribute is not empty, name field is not empty, approval rdoBtn is selected then click saveFwd -------"); AddAssertionToList(WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInDOTApprovalOrLAWAConcurrence(ncrDescription), "VerifyNCRDocIsDisplayedInDOTApprovalOrLAWAConcurrence"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifySignatureField(Reviewer.Owner), "VerifySignatureField(Reviewer.Owner)"); AddAssertionToList(VerifyInputField(InputFields.Owner_Review), "VerifyInputField(InputFields.Owner_Review)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.Owner_Approval_Yes), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.Owner_Approval_Yes)"); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInVerificationAndClosure(ncrDescription); GridHelper.ClickEditBtnForRow(); QaRcrdCtrl_GeneralNCR.ClickBtn_Revise(); WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInResolutionAndDisposition(ncrDescription); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyDDListSelectedValue(InputFields.Concession_Request, "Concession Deviation"), "VerifyDDListSelectedValue(InputFields.Concession_Request)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Correct_Rework, false), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Correct_Rework, false)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Replace, false), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Replace, false)"); Report.Step("STEP: selectDDL Concession Request - Return To Conformance and select checkboxes then click SaveOnly -------"); QaRcrdCtrl_GeneralNCR.PopulateRelatedFields_And_SelectDDL_forConcessionRequest_ReturnToConformance(); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveOnly(); Report.Step("STEP: edit in Resolution/Disposition tab and verify Concession Request DDL is set to 'Return to Conformance' and checkboxes are selected then click SaveFwd -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Resolution_Disposition)"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyDDListSelectedValue(InputFields.Concession_Request, "Return to Conformance"), "VerifyDDListSelectedValue(InputFields.Concession_Request, \"Return to Conformance\")"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Correct_Rework), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Correct_Rework)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Replace), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Replace)"); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); WF_QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayedInVerificationAndClosure(ncrDescription); GridHelper.ClickEditBtnForRow(); AddAssertionToList(VerifyDDListSelectedValue(InputFields.Concession_Request, "Return to Conformance"), "VerifyDDListSelectedValue(InputFields.Concession_Request, \"Return to Conformance\")"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_As_Built_Required)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Correct_Rework), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Correct_Rework)"); AddAssertionToList(VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Replace), "VerifyChkBoxRdoBtnSelection(RadioBtnsAndCheckboxes.ChkBox_Replace)"); Report.Step("STEP: provide signature for IQF Mgr then click cancel -------"); QaRcrdCtrl_GeneralNCR.SignDateApproveNcrByReviewer(Reviewer.IQF_Manager); QaRcrdCtrl_GeneralNCR.ClickBtn_Cancel(); Report.Step("STEP: edit in Verification and Closure and verify signature is empty for IQF Mgr -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Verification_and_Closure, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Verification_and_Closure, ncrDescription)"); GridHelper.ClickEditBtnForRow(); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifySignatureField(Reviewer.IQF_Manager, true), "VerifySignatureField(Reviewer.IQF_Manager, true)"); WF_QaRcrdCtrl_GeneralNCR.SignDateApproveNCR(TableTab.Verification_and_Closure); Report.Step("STEP: edit in Verification and Closure and verify signatures' element value and name field is not empty then click Close -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsDisplayed(TableTab.Verification_and_Closure, ncrDescription), "VerifyNCRDocIsDisplayed(TableTab.Verification_and_Closure)"); GridHelper.ClickEditBtnForRow(); WF_QaRcrdCtrl_GeneralNCR.VerifySignatureNCR(TableTab.Verification_and_Closure, ncrDescription); QaRcrdCtrl_GeneralNCR.ClickBtn_Close(); Report.Step("------ verify ncr is closed -------"); AddAssertionToList(QaRcrdCtrl_GeneralNCR.VerifyNCRDocIsClosed(ncrDescription), $"VerifyNCRDocIsClosed({ncrDescription})"); AssertAll(); }
public void NCR_RequiredFieldIDs() { Report.Info($"Testing, UserAccts for {tenantName}"); LoginAs(UserType.NCRMgr); NavigateToPage.QARecordControl_General_NCR(); QaRcrdCtrl_GeneralNCR.ClickBtn_New(); QaRcrdCtrl_GeneralNCR.ClickBtn_SaveForward(); string requiredFieldXpath = "//span[contains(text(),'Required')]"; string sibling = "//following-sibling::"; string datePickerAddlXpath = "span[contains(@class,'picker')]/span/input"; string textAreaAddlXpath = "textarea"; string ddListAddlXpath = "span[contains(@class,'dropdown')]/input"; string textInputAddlXpath = "input"; string key; string type; string name; string id; List <KeyValuePair <string, string> > reqFieldPairs = new List <KeyValuePair <string, string> >(); IList <IWebElement> reqFieldElems = Driver.FindElements(By.XPath(requiredFieldXpath)); System.Console.WriteLine(reqFieldElems.Count); var dateElems = Driver.FindElements(By.XPath($"{requiredFieldXpath}{sibling}{datePickerAddlXpath}")); if (dateElems != null) { type = "Date"; foreach (IWebElement dateElem in dateElems) { id = dateElem.GetAttribute("id"); name = dateElem.GetAttribute("name"); key = $"{type}\n{name}"; reqFieldPairs.Add(new KeyValuePair <string, string>(key, id)); } } var ddListElems = Driver.FindElements(By.XPath($"{requiredFieldXpath}{sibling}{ddListAddlXpath}")); if (ddListElems != null) { type = "DDList"; foreach (IWebElement ddlElem in ddListElems) { id = ddlElem.GetAttribute("id"); name = ddlElem.GetAttribute("name"); key = $"{type}\n{name}"; reqFieldPairs.Add(new KeyValuePair <string, string>(key, id)); } } var txtInputElems = Driver.FindElements(By.XPath($"{requiredFieldXpath}{sibling}{textInputAddlXpath}")); if (txtInputElems != null) { type = "TextInput"; foreach (IWebElement txtInput in txtInputElems) { id = txtInput.GetAttribute("id"); name = txtInput.GetAttribute("name"); key = $"{type}\n{name}"; reqFieldPairs.Add(new KeyValuePair <string, string>(key, id)); } } var textAreaElems = Driver.FindElements(By.XPath($"{requiredFieldXpath}{sibling}{textAreaAddlXpath}")); if (textAreaElems != null) { type = "TextArea"; foreach (IWebElement txtArea in textAreaElems) { id = txtArea.GetAttribute("id"); name = txtArea.GetAttribute("name"); key = $"{type}\n{name}"; reqFieldPairs.Add(new KeyValuePair <string, string>(key, id)); } } System.Console.WriteLine($"{tenantName}\n"); for (int x = 0; x < reqFieldPairs.Count; x++) { var pairKey = reqFieldPairs[x].Key; var value = reqFieldPairs[x].Value; System.Console.WriteLine($"{pairKey}\n{value}\n"); } }