public void CreateCompetencyLevel_SameName() { int i = 0; string name = "CompetencyLevel_" + DateTime.Now.ToString().Replace(' ', '_').Replace(':', '_').Replace('/', '_'); while (i < 2) { Thread.Sleep(2000); AddCompetencyLevelButton.Click(); Thread.Sleep(6000); PopupName_Textbox.Clear(); PopupName_Textbox.SendKeys(name); PopupActiveYes_RadioButton.Click(); PopupSubmit_Button.Click(); i++; Thread.Sleep(3000); Assert.IsTrue(SuccessMessage.Displayed, name + " - Active Competency Level is not created successfully"); ExtentReport.test.Log(LogStatus.Pass, "Success Message is displayed, " + name + " - Active Competency Level created successfully"); } SearchCompetencyLevel(name); Assert.AreEqual(2, CompetencyLevelList.Count, "Creating of same name '" + name + "' - Competency Level was unsuccessful"); ExtentReport.test.Log(LogStatus.Pass, name + " - Competency Level of same name has been created successfully and listed properly in the Competencies Level Grid"); }
public void VerifyMandatoryFields_AddCompetencyLevel() { Thread.Sleep(2000); AddCompetencyLevelButton.Click(); Thread.Sleep(6000); PopupSubmit_Button.Click(); Thread.Sleep(2000); Assert.IsTrue(ErrorMessage.Displayed, "Error message for validating the Competency Level is not displayed in Add Competency Level popup"); ExtentReport.test.Log(LogStatus.Pass, "Error message for validating the Competency Level is displayed in Add Competency Level popup"); try { Assert.IsTrue(PopupName_LabelMandatory.Displayed); ExtentReport.test.Log(LogStatus.Info, "Validation for Name field is enabled in Add Competency Level popup"); Assert.IsTrue(PopupName_TextboxValidationMessage.Displayed, "Validation message of Name field for validating the Competency Level is not displayed in Add Competency Level popup"); ExtentReport.test.Log(LogStatus.Pass, "Validation message of Name field for validating the Competency Level is displayed in Add Competency Level popup"); } catch (NoSuchElementException e) { ExtentReport.test.Log(LogStatus.Info, "Validation for Name field is not enabled in Add Competency Level popup"); } CloseButton_Popup.Click(); Thread.Sleep(2000); }
public string CreateCompetencyLevel(string type, bool isCreate) { Thread.Sleep(2000); if (isCreate) { AddCompetencyLevelButton.Click(); Thread.Sleep(6000); } string name = "CompetencyLevel_" + DateTime.Now.ToString().Replace(' ', '_').Replace(':', '_').Replace('/', '_'); PopupName_Textbox.Clear(); PopupName_Textbox.SendKeys(name); if (type == "Active") { PopupActiveYes_RadioButton.Click(); } else//type will be InActive { PopupActiveNo_RadioButton.Click(); } PopupSubmit_Button.Click(); Thread.Sleep(3000); Assert.IsTrue(SuccessMessage.Displayed, name + " - " + type + " Competency Level is not " + formSubmitType + " successfully"); ExtentReport.test.Log(LogStatus.Pass, "Success Message is displayed, " + name + " - " + type + " Competency Level " + formSubmitType + " successfully"); return(name); }
public void VerifyAddPopupElements_CompetencyLevelListPage() { Thread.Sleep(2000); AddCompetencyLevelButton.Click(); Thread.Sleep(6000); Assert.IsTrue(PopupManageCompetencyLevel_Title.Displayed, "The title of the Add Competency Level popup – Manage Competency Level is not displaying in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "The title of the Add popup – Manage Competency Level is displaying in the Competencies Level List Page"); Assert.IsTrue(PopupName_Label.Displayed, "Name field label of the Add Competency Level popup is not displaying in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "Name field label of the Add Competency Level popup is displaying in the Competencies Level List Page"); Assert.IsTrue(PopupName_Textbox.Displayed, "Name field textbox of the Add Competency Level popup is not displaying in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "Name field textbox of the Add Competency Level popup is displaying in the Competencies Level List Page"); Assert.IsTrue(PopupActive_Label.Displayed, "Active field label of the Add Competency Level popup is not displaying in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "Active field label of the Add Competency Level popup is displaying in the Competencies Level List Page"); Assert.IsTrue(PopupActiveYes_RadioButton.Displayed, "Active field Yes Radio button of the Add Competency Level popup is not displaying in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "Active field Yes Radio button of the Add Competency Level popup is displaying in the Competencies Level List Page"); Assert.IsTrue(PopupActiveNo_RadioButton.Displayed, "Active field No Radio button of the Add Competency Level popup is not displaying in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "Active field No Radio button of the Add Competency Level popup is displaying in the Competencies Level List Page"); Assert.IsTrue(PopupActiveYes_RadioButton.Selected, "Active field is not defaulted to Yes Radio button of the Add Competency Level popup in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "Active field is defaulted to Yes Radio button of the Add Competency Level popup in the Competencies Level List Page"); Assert.IsTrue(PopupSubmit_Button.Displayed, "Submit button of the Add Competency Level popup is not displaying in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "Submit button of the Add Competency Level popup is displaying in the Competencies Level List Page"); Assert.IsTrue(PopupCancel_Button.Displayed, "Cancel button of the Add Competency Level popup is not displaying in the Competencies Level List Page"); ExtentReport.test.Log(LogStatus.Pass, "Cancel button of the Add Competency Level popup is displaying in the Competencies Level List Page"); CloseButton_Popup.Click(); Thread.Sleep(2000); }