public void AddActivityType() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC01_AddActivityType"); FpActivityTypesPage activityTypesPage = new FpActivityTypesPage(); strTestCaseNo = "TC001_Reg"; strtblname = "automation_activitytype"; strTestType = "Regression"; var connection = new ConnectToMySQL_Fetch_TestData(); var testdataActivityBoard = connection.Select(strtblname, strTestCaseNo, strTestType); string strTDShortCode = testdataActivityBoard[3]; string strTDActivityTypeName = testdataActivityBoard[4]; string strTDColour = testdataActivityBoard[5]; activityTypesPage.AddActivitydetails(strTDShortCode, strTDActivityTypeName, strTDColour); Thread.Sleep(5000); string[] strFPActivityName = activityTypesPage.RetrieveActivitydetails(strTDActivityTypeName); try { Assert.AreEqual(strFPActivityName[1], strTDActivityTypeName); PropertiesCollection.test.Log(Status.Pass, "ADD ACTIVITY TYPE => Activity Type: " + strTDActivityTypeName + " created and validated"); } catch { PropertiesCollection.test.Log(Status.Fail, "ADD ACTIVITY TYPE => Activity Type creation has failed"); } }
public void TS01_TC06_ValidateActivityTypesAdminMenu() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS01_TC06_ValidateActivityTypesAdminMenu"); /* Validate Activity Types Page */ FpAdminMenus AdminMenu = new FpAdminMenus(); AdminMenu.AdminClick(); AdminMenu.ActivityTypesClick(); System.Threading.Thread.Sleep(30000); FpActivityTypesPage ActivityTypes = new FpActivityTypesPage(); PropertiesCollection.driver.SwitchTo().Frame(ActivityTypes.frame); try { Assert.IsTrue(ActivityTypes.title.Displayed); PropertiesCollection.test.Log(Status.Pass, "Activity Types Page loaded"); } catch { PropertiesCollection.test.Log(Status.Fail, "Activity Types Page not loaded"); throw; } }
public void DeleteActivityType() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC05_DeleteActivityType"); FpActivityTypesPage activityTypesPage = new FpActivityTypesPage(); strTestCaseNo = "TC005_Reg"; strtblname = "automation_activitytype"; strTestType = "Regression"; var connection = new ConnectToMySQL_Fetch_TestData(); var testdataActivityBoard = connection.Select(strtblname, strTestCaseNo, strTestType); strTDActivityTypeName = testdataActivityBoard[4]; activityTypesPage.DeleteActivity(strTDActivityTypeName); string[] strActivityTypesName = activityTypesPage.RetrieveActivitydetails(strTDActivityTypeName); Console.WriteLine("Activity type name retrieved from web is: " + strActivityTypesName[1]); Thread.Sleep(4000); try { Assert.AreNotEqual(strActivityTypesName[1], strTDActivityTypeName); PropertiesCollection.test.Log(Status.Pass, "DELETE ACTIVITY TYPE => Acitivity type: " + strTDActivityTypeName + " has been deleted successfully."); } catch { PropertiesCollection.test.Log(Status.Fail, "DELETE ACTIVITY TYPE => Acitivity type: " + strTDActivityTypeName + " Deletion has failed"); } }
public void EditActivityType() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC03_EditActivityType"); FpActivityTypesPage activityTypesPage = new FpActivityTypesPage(); strTestCaseNo = "TC003_Reg"; strtblname = "automation_activitytype"; strTestType = "Regression"; var connection = new ConnectToMySQL_Fetch_TestData(); var testdataActivityBoard = connection.Select(strtblname, strTestCaseNo, strTestType); strTDActivityTypeName = testdataActivityBoard[4]; string strTDEditText = testdataActivityBoard[6]; for (int i = 0; i < activityTypesPage.txtAllActivityName.Count; i++) { if (activityTypesPage.txtAllActivityName.ElementAt(i).Text.Equals(strTDActivityTypeName)) { activityTypesPage.btnEditActivityType.ElementAt(i).Click(); break; } } Thread.Sleep(8000); activityTypesPage.txtName.Clear(); activityTypesPage.txtName.SendKeys(strTDEditText); activityTypesPage.btnSave.Click(); Thread.Sleep(5000); string modifiedActivityTypeName = ""; for (int i = 0; i < activityTypesPage.txtAllActivityName.Count; i++) { if (activityTypesPage.txtAllActivityName.ElementAt(i).Text.Equals(strTDEditText)) { modifiedActivityTypeName = activityTypesPage.txtAllActivityName.ElementAt(i).Text; break; } } try { Assert.AreEqual(modifiedActivityTypeName, strTDEditText); PropertiesCollection.test.Log(Status.Pass, "EDIT ACTIVITY TYPE => Acitivity type name has been edited successfully. New name for Activity type is: " + modifiedActivityTypeName); } catch { PropertiesCollection.test.Log(Status.Fail, "EDIT ACTIVITY TYPE => Acitivity type editing has failed"); } }
public void VerifyErrorMessage() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC02_VerifyErrorMessage"); FpActivityTypesPage activityTypesPage = new FpActivityTypesPage(); strTestCaseNo = "TC002_Reg"; strtblname = "automation_activitytype"; strTestType = "Regression"; var connection = new ConnectToMySQL_Fetch_TestData(); var testdataActivityBoard = connection.Select(strtblname, strTestCaseNo, strTestType); strTDActivityTypeName = testdataActivityBoard[4]; string strTDEditText = testdataActivityBoard[6]; for (int i = 0; i < activityTypesPage.txtAllActivityName.Count; i++) { if (activityTypesPage.txtAllActivityName.ElementAt(i).Text.Equals(strTDActivityTypeName)) { activityTypesPage.btnEditActivityType.ElementAt(i).Click(); break; } } Thread.Sleep(8000); activityTypesPage.txtName.Clear(); activityTypesPage.txtName.SendKeys(strTDEditText); Thread.Sleep(3000); string errorMessage = activityTypesPage.txtErrorMessage.Text; string expectedErrorMessage = "Name cannot be greater than 50 characters."; try { Assert.AreEqual(errorMessage, expectedErrorMessage); PropertiesCollection.test.Log(Status.Pass, "VERIFY ERROR MESSAGE => Error message received has been validated successfully on Edit Activity Types page"); } catch { PropertiesCollection.test.Log(Status.Fail, "VERIFY ERROR MESSAGE => Validation failed for Error message received on Edit Activity Types page"); } Thread.Sleep(5000); activityTypesPage.txtName.Clear(); activityTypesPage.txtName.SendKeys(strTDActivityTypeName); activityTypesPage.btnSave.Click(); Thread.Sleep(5000); }
public void ReturnWithOutSave() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC04_ReturnWithOutSave"); FpActivityTypesPage activityTypesPage = new FpActivityTypesPage(); strTestCaseNo = "TC004_Reg"; strtblname = "automation_activitytype"; strTestType = "Regression"; var connection = new ConnectToMySQL_Fetch_TestData(); var testdataActivityBoard = connection.Select(strtblname, strTestCaseNo, strTestType); strTDActivityTypeName = testdataActivityBoard[4]; string strTDEditText = testdataActivityBoard[6]; for (int i = 0; i < activityTypesPage.txtAllActivityName.Count; i++) { if (activityTypesPage.txtAllActivityName.ElementAt(i).Text.Equals(strTDActivityTypeName)) { activityTypesPage.btnEditActivityType.ElementAt(i).Click(); break; } } Thread.Sleep(8000); activityTypesPage.txtName.Clear(); activityTypesPage.txtName.SendKeys(strTDEditText); activityTypesPage.btnReturn.Click(); string errorMessage = activityTypesPage.txtConfirmationMsg.Text; string expectedErrorMessage = "Any unsaved changes will be lost. Are you sure?"; try { Assert.AreEqual(errorMessage, expectedErrorMessage); PropertiesCollection.test.Log(Status.Pass, "ACTIVITY TYPES EDIT - CLICK ON RETURN BEFORE SAVE => Validation for confirmation message received when returning to activity type list before save has been successful"); } catch { PropertiesCollection.test.Log(Status.Fail, "ACTIVITY TYPES EDIT - CLICK ON RETURN BEFORE SAVE => Validation for confirmation message received when returning to activity type list before save has not been successful"); } activityTypesPage.btnCancel.Click(); Thread.Sleep(2000); activityTypesPage.btnSave.Click(); Thread.Sleep(5000); }
public void TS05_PlanningBoard_TC08_DeleteActivityType() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS05_PlanningBoard_TC08_DeleteActivityType"); FpAdminMenus AdminMenu = new FpAdminMenus(); AdminMenu.AdminClick(); AdminMenu.ActivityTypesClick(); System.Threading.Thread.Sleep(30000); System.Threading.Thread.Sleep(30000); FpActivityTypesPage ActivityTypes = new FpActivityTypesPage(); PropertiesCollection.driver.SwitchTo().Frame(ActivityTypes.frame); String strTestCaseNo = "TC001"; String strtblname = "automation_activitytype"; String strTestType = "Smoke"; string strTDActivityName = String.Empty; /* Get test data from MySQL */ var connection = new ConnectToMySQL_Fetch_TestData(); var testdataActivityTypes = connection.Select(strtblname, strTestCaseNo, strTestType); strTDActivityName = testdataActivityTypes[4]; ActivityTypes.DeleteActivity(strTDActivityName); String[] Activitydetails = ActivityTypes.RetrieveActivitydetails(strTDActivityName); String strFPwebActivityName = Activitydetails[1]; Console.WriteLine(strFPwebActivityName); try { Assert.IsNull(strFPwebActivityName); PropertiesCollection.test.Log(Status.Pass, "Activity Type is deleted on Activity Types Admin screen"); } catch { PropertiesCollection.test.Log(Status.Fail, "Activity Type not deleted"); throw; } }
public void TS05_PlanningBoard_TC01_AddActivityTypes() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS05_PlanningBoard_TC01_AddActivityTypes"); FpActivityTypesPage ActivityTypes = new FpActivityTypesPage(); String strTestCaseNo = "TC001"; String strtblname = "automation_activitytype"; String strTestType = "Smoke"; string strTDActivityShortCode = String.Empty; string strTDActivityName = String.Empty; string strTDActivityColour = String.Empty; /* Get test data from MySQL */ var connection = new ConnectToMySQL_Fetch_TestData(); var testdataActivityTypes = connection.Select(strtblname, strTestCaseNo, strTestType); strTDActivityShortCode = testdataActivityTypes[3]; strTDActivityName = testdataActivityTypes[4]; strTDActivityColour = testdataActivityTypes[5]; ActivityTypes.AddActivitydetails(strTDActivityShortCode, strTDActivityName, strTDActivityColour); //ActivityTypes.AddActivitydetails(strTDActivityShortCode, strTDActivityName); String[] strFPwebActivityName = ActivityTypes.RetrieveActivitydetails(strTDActivityName); try { Assert.AreEqual(strTDActivityName, strFPwebActivityName[1]); PropertiesCollection.test.Log(Status.Pass, "Activity: " + strFPwebActivityName[1] + " created and validated"); } catch { PropertiesCollection.test.Log(Status.Fail, "Activity Name: " + strTDActivityName +"and" + strFPwebActivityName[1] + "is not matching"); throw; } }