public void VerifyErrorMessages() { string strTestCaseNo = "TC002_Reg"; strTestType = "Regression"; PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC02_VerifyErrorMessages"); string[] list; var connection = new ConnectToMySQL_Fetch_TestData(); var testdataRoster = connection.Select(strtblname, strTestCaseNo, strTestType); list = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); System.Threading.Thread.Sleep(2000); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); String strTDRosterName = testdataRoster[4]; String strTDPane = testdataRoster[5]; String strTDTimeZoneorLocation = testdataRoster[6]; String strTDTimeZone = testdataRoster[7]; String strTDLocation = testdataRoster[8]; String strTDPeople = testdataRoster[9]; String strTDShiftDetails = testdataRoster[10]; String strTDStatus = testdataRoster[11]; RosterAdministration.VerifyErrorMessages(strTDRosterName, strTDPane, strTDTimeZoneorLocation, strTDTimeZone, strTDLocation, strTDPeople, strTDShiftDetails, strTDStatus); }
public void TC03_FPWeb_Admin_Rostering_ShiftAdministration() { clsLoginPage loginPage = new clsLoginPage(); loginPage.LoginPage(); var TopbarMenu = new clsMainPage_TopbarMenu(); TopbarMenu.NavigatetoShiftAdministration(); var ShiftAdministration = new clsShiftAdministration(); ShiftAdministration.AddShiftdetails("Night", "N", "08:00", "9:00", "BFM"); TopbarMenu.NavigatetoShiftAdministration(); ShiftAdministration.EditShiftdetails("Night", "12:00"); TopbarMenu.NavigatetoShiftAdministration(); ShiftAdministration.CopyShiftdetails("Night", "Night-Copy", "11:00"); TopbarMenu.NavigatetoShiftAdministration(); ShiftAdministration.DeleteShiftdetails("Night"); // TopbarMenu.Logout(); }
public void TestCleanup() { var TopbarMenu = new clsMainPage_TopbarMenu(); TopbarMenu.Logout(); PropertiesCollection.driver.Close(); PropertiesCollection.driver.Quit(); PropertiesCollection.driver.Dispose(); }
public void TS03_TC05_RosterAdmin_DeleteRoster() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS03_TC04_RosterAdmin_DeleteRoster"); String strtblname = "automation_rosteradministration"; string[] list; var connection = new ConnectToMySQL_Fetch_TestData(); list = connection.Select(strtblname, strTestCaseNo, strTestType); string strTDRosterName = list[4]; Int64 RosterID = 0; var TopbarMenu = new clsMainPage_TopbarMenu(); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); string strConnectionString = "Data Source=" + ConfigurationManager.AppSettings["SQLServerDataSource"] + ";Initial Catalog=" + ConfigurationManager.AppSettings["SQLServerInitialCatalog"] + ";User Id=" + ConfigurationManager.AppSettings["SQLServerUserId"] + ";Password="******"SQLServerPassword"]; SqlConnection myConnection = new SqlConnection(strConnectionString); myConnection.Open(); SqlDataReader reader = null; String strQuery = "select RosterID from tblRoster where RosterName = '" + strTDRosterName + "';"; SqlCommand command = new SqlCommand(strQuery, myConnection); reader = command.ExecuteReader(); while (reader.Read()) { RosterID = Convert.ToInt64(reader.GetValue(0)); Console.WriteLine("RosterID" + RosterID); } reader.Close(); String strQuery1 = "delete from tblRoster where RosterID = '" + RosterID + "';"; SqlCommand command1 = new SqlCommand(strQuery1, myConnection); command1.ExecuteNonQuery(); myConnection.Close(); System.Threading.Thread.Sleep(3000); string[] rosterdetails = RosterAdministration.RetrieveRosterdetails(list[4]); string strfbwebrostername = rosterdetails[0]; //try //{ // Assert.IsNull(strfbwebrostername); // PropertiesCollection.test.Log(Status.Pass, "Roster : " + list[4] + " is deleted and validated on Roster Admin screen"); //} //catch //{ // PropertiesCollection.test.Log(Status.Fail, "Roster Status is not matching"); // throw; //} }
public void TC06_RosterAdmin_DeleteRoster() { string[] list; var connection = new ConnectToMySQL_Fetch_TestData(); list = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); RosterAdministration.DeleteRosterdetails(list[4]); }
public void DeleteRosterAdmin() { string strTestCaseNo = "TC004_Reg"; strTestType = "Regression"; PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC04_DeleteRosterAdmin"); string[] list; var connection = new ConnectToMySQL_Fetch_TestData(); list = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); RosterAdministration.DeleteRosterdetails(list[4]); }
public void EditRosterAdmin() { string strTestCaseNo = "TC003_Reg"; strTestType = "Regression"; PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC03_EditRosterAdmin"); string[] list; var connection = new ConnectToMySQL_Fetch_TestData(); var testdataRoster = connection.Select(strtblname, strTestCaseNo, strTestType); list = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); System.Threading.Thread.Sleep(2000); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); string strTDRosterName = testdataRoster[4]; string strTDShiftDetails = testdataRoster[10]; RosterAdministration.EditRosterdetails(strTDRosterName, strTDShiftDetails); string[] rosterdetails = RosterAdministration.RetrieveRosterdetails(strTDRosterName); string strfbwebrostername = rosterdetails[0]; string strfbwebshifttypes = rosterdetails[2]; try { Assert.AreEqual(strTDRosterName, strfbwebrostername); PropertiesCollection.test.Log(Status.Pass, strfbwebrostername + " Updated Roster Validated successfully"); } catch { PropertiesCollection.test.Log(Status.Fail, strfbwebrostername + " Updated Roster not Validated successfully"); } try { Assert.AreEqual(strTDShiftDetails, strfbwebshifttypes); PropertiesCollection.test.Log(Status.Pass, strfbwebshifttypes + " Updated ShiftTypes validated successfully"); } catch { PropertiesCollection.test.Log(Status.Fail, strfbwebshifttypes + " Updated ShiftTypes not validated successfully"); } }
public void NavigateRosterAdminBeforeSave() { string strTestCaseNo = "TC005_Reg"; strTestType = "Regression"; PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC05_NavigateRosterAdminBeforeSave"); string[] list; var connection = new ConnectToMySQL_Fetch_TestData(); var testdataRoster = connection.Select(strtblname, strTestCaseNo, strTestType); list = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); string strTDRosterName = testdataRoster[4]; RosterAdministration.NavigateRosterAdminBeforeSave(strTDRosterName); }
public void TC03_Admin_AddTemplates() { var connection = new Database.ConnectToMySQL_Fetch_TestData(); var testdataRoster = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); String strTDRosterName = testdataRoster[4]; String strTDPane = testdataRoster[5]; String strTDTimeZoneorLocation = testdataRoster[6]; String strTDTimeZone = testdataRoster[7]; String strTDLocation = testdataRoster[8]; String strTDPeople = testdataRoster[9]; String strTDShiftDetails = testdataRoster[10]; String strTDStatus = testdataRoster[11]; RosterAdministration.AddRosterdetails(strTDRosterName, strTDPane, strTDTimeZoneorLocation, strTDTimeZone, strTDLocation, strTDPeople, strTDShiftDetails, strTDStatus); System.Threading.Thread.Sleep(2000); String[] rosterdetails = RosterAdministration.RetrieveRosterdetails(strTDRosterName); String strfbwebrostername = rosterdetails[0]; String strfbwebpane = rosterdetails[1]; String strfbwebshifttypes = rosterdetails[2]; String strfbwebstatus = rosterdetails[3]; Assert.AreEqual(strTDRosterName, strfbwebrostername); Assert.AreEqual(strTDPane, strfbwebpane); Assert.AreEqual(strTDShiftDetails, strfbwebshifttypes); Assert.AreEqual(strTDStatus, strfbwebstatus); }
public void AddRosterAdmin() { strTestCaseNo = "TC001_Reg"; strtblname = "automation_rosteradministration"; strTestType = "Regression"; PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC01_AddRosterAdmin"); var connection = new Database.ConnectToMySQL_Fetch_TestData(); var testdataRoster = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); String strTDRosterName = testdataRoster[4]; String strTDPane = testdataRoster[5]; String strTDTimeZoneorLocation = testdataRoster[6]; String strTDTimeZone = testdataRoster[7]; String strTDLocation = testdataRoster[8]; String strTDPeople = testdataRoster[9]; String strTDShiftDetails = testdataRoster[10]; String strTDStatus = testdataRoster[11]; Console.WriteLine("RosterName" + strTDRosterName); RosterAdministration.AddRosterdetails(strTDRosterName, strTDPane, strTDTimeZoneorLocation, strTDTimeZone, strTDLocation, strTDPeople, strTDShiftDetails, strTDStatus); System.Threading.Thread.Sleep(2000); String[] rosterdetails = RosterAdministration.RetrieveRosterdetails(strTDRosterName); String strfbwebrostername = rosterdetails[0]; String strfbwebpane = rosterdetails[1]; String strfbwebshifttypes = rosterdetails[2]; String strfbwebstatus = rosterdetails[3]; try { Assert.AreEqual(strTDRosterName, strfbwebrostername); PropertiesCollection.test.Log(Status.Pass, strfbwebrostername + " Roster created Succesfully"); } catch { PropertiesCollection.test.Log(Status.Fail, strfbwebrostername + " Roster not created Succesfully"); } try { Assert.AreEqual(strTDPane, strfbwebpane); PropertiesCollection.test.Log(Status.Pass, strfbwebpane + " Pane validated Succesfully"); } catch { PropertiesCollection.test.Log(Status.Pass, strfbwebpane + " Pane not validated Succesfully"); } try { Assert.AreEqual(strTDShiftDetails, strfbwebshifttypes); PropertiesCollection.test.Log(Status.Pass, strfbwebshifttypes + " Shift Type Validated Succesfully"); } catch { PropertiesCollection.test.Log(Status.Pass, strfbwebshifttypes + " Shift Type not Validated Succesfully"); } try { Assert.AreEqual(strTDStatus, strfbwebstatus); PropertiesCollection.test.Log(Status.Pass, strfbwebstatus + " Status validated Succesfully"); } catch { PropertiesCollection.test.Log(Status.Pass, strfbwebstatus + " Status not validated Succesfully"); } }
public void TS03_TC01_ShiftAdmin_Addshift() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS03_TC01_Smoke_ShiftAdmin_Addshift"); var connection = new ConnectToMySQL_Fetch_TestData(); var testdataShift = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); var ShiftAdministration = new clsShiftAdministration(); TopbarMenu.NavigatetoShiftAdministration(); String strTDShiftName = testdataShift[4]; String strTDShortCode = testdataShift[5]; String strTDStartTime = testdataShift[6]; String strTDDuration = testdataShift[7]; String strTDCurrencies = testdataShift[8]; String strTDStatus = testdataShift[9]; /********* Move to Roster and check if the 'Exit Edit' is enabled***********/ /********* Delete the shift if its already present********/ String[] shiftdetails1 = ShiftAdministration.RetrieveShiftdetails(strTDShiftName); Console.WriteLine(shiftdetails1[0]); if (shiftdetails1[0].IsNullOrEmpty() == false) { ShiftAdministration.DeleteShiftdetails(shiftdetails1[0]); } /**********************************************************/ ShiftAdministration.AddShiftdetails(strTDShiftName, strTDShortCode, strTDStartTime, strTDDuration, strTDCurrencies); String[] shiftdetails = ShiftAdministration.RetrieveShiftdetails(strTDShiftName); String strfbwebshiftname = shiftdetails[0]; String strfbwebshortcode = shiftdetails[1]; String strfbwebstarttime = shiftdetails[2]; String strfbwebDuration = shiftdetails[3]; String strfbwebCurrencies = shiftdetails[4]; String strfbwebStatus = shiftdetails[5]; try { Assert.AreEqual(strTDShiftName, strfbwebshiftname); PropertiesCollection.test.Log(Status.Pass, "Shift Name: " + strfbwebshiftname + " created and validated"); } catch { PropertiesCollection.test.Log(Status.Fail, "Shift Name is not matching"); throw; } try { Assert.AreEqual(strTDStartTime, strfbwebstarttime); PropertiesCollection.test.Log(Status.Pass, "Shift Start time: " + strfbwebstarttime + " created and validated on Shift Admin Screen"); } catch { PropertiesCollection.test.Log(Status.Fail, "Shift Start time is not matching on Shift Admin screen"); throw; } try { Assert.AreEqual(strTDDuration, strfbwebDuration); PropertiesCollection.test.Log(Status.Pass, "Shift Duration: " + strfbwebDuration + " created and validated on Shift Admin Screen"); } catch { PropertiesCollection.test.Log(Status.Fail, "Shift Duration is not matching on Shift Admin screen"); throw; } try { Assert.AreEqual(strTDCurrencies, strfbwebCurrencies); PropertiesCollection.test.Log(Status.Pass, "Currency: " + strfbwebCurrencies + " created and validated on Shift Admin Screen"); } catch { PropertiesCollection.test.Log(Status.Fail, "Currencies are not matching on Shift Admin screen"); throw; } try { Assert.AreEqual(strTDStatus, strfbwebStatus); PropertiesCollection.test.Log(Status.Pass, "Shift Status Active?: " + strfbwebStatus + " created and validated on Shift Admin screen"); } catch { PropertiesCollection.test.Log(Status.Fail, "Shift Status is not matching"); throw; } }
public void TS03_TC06_ShiftAdmin_DeleteShift() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS03_TC06_ShiftAdmin_DeleteShift"); String strtblname = "automation_shiftadministration"; string[] list; var connection = new ConnectToMySQL_Fetch_TestData(); list = connection.Select(strtblname, strTestCaseNo, strTestType); string strTDShiftName = list[4]; Int64 ShiftTypeID = 0; Int64 PeopleID = 0; Int64 RosterID = 0; Int64 RosterShiftTypeID = 0; Int64 ShiftPersonID = 0; var TopbarMenu = new clsMainPage_TopbarMenu(); var ShiftAdministration = new clsShiftAdministration(); TopbarMenu.NavigatetoShiftAdministration(); string strConnectionString = "Data Source=" + ConfigurationManager.AppSettings["SQLServerDataSource"] + ";Initial Catalog=" + ConfigurationManager.AppSettings["SQLServerInitialCatalog"] + ";User Id=" + ConfigurationManager.AppSettings["SQLServerUserId"] + ";Password="******"SQLServerPassword"]; SqlConnection myConnection = new SqlConnection(strConnectionString); myConnection.Open(); SqlDataReader reader = null; string strQuery = "select ShiftTypeID from tblShiftType where ShiftTypeName = '" + strTDShiftName + "';"; SqlCommand command = new SqlCommand(strQuery, myConnection); reader = command.ExecuteReader(); while (reader.Read()) { ShiftTypeID = Convert.ToInt64(reader.GetValue(0)); Console.WriteLine("ShiftTypeID" + ShiftTypeID); } reader.Close(); string strQuery1 = "select RosterID from tblRosterShiftType where ShiftTypeID = '" + ShiftTypeID + "';"; SqlCommand command1 = new SqlCommand(strQuery1, myConnection); reader = command1.ExecuteReader(); while (reader.Read()) { RosterID = Convert.ToInt64(reader.GetValue(0)); Console.WriteLine("RosterID" + RosterID); } reader.Close(); string strQuery2 = "select RosterShiftTypeID from tblRosterShiftType where ShiftTypeID = '" + ShiftTypeID + "';"; SqlCommand command2 = new SqlCommand(strQuery2, myConnection); reader = command2.ExecuteReader(); while (reader.Read()) { RosterShiftTypeID = Convert.ToInt64(reader.GetValue(0)); Console.WriteLine("RosterShiftTypeID" + RosterShiftTypeID); } reader.Close(); string strQuery3 = "select PeopleID from tblPeople where Surname = 'testuser1';"; SqlCommand command3 = new SqlCommand(strQuery3, myConnection); reader = command3.ExecuteReader(); while (reader.Read()) { PeopleID = Convert.ToInt64(reader.GetValue(0)); Console.WriteLine("PeopleID" + PeopleID); } reader.Close(); string strQuery4 = "select ShiftPersonID from tblShiftPerson where PeopleID = '" + PeopleID + "';"; SqlCommand command4 = new SqlCommand(strQuery4, myConnection); reader = command4.ExecuteReader(); while (reader.Read()) { ShiftPersonID = Convert.ToInt64(reader.GetValue(0)); Console.WriteLine("ShiftPersonID " + ShiftPersonID); } reader.Close(); string strQuery5 = "delete from tblRosterShiftType where ShiftTypeID ='" + ShiftTypeID + "';"; SqlCommand command5 = new SqlCommand(strQuery5, myConnection); command5.ExecuteNonQuery(); string strQuery6 = "delete from tblShiftPersonCurrency where ShiftPersonID = '" + ShiftPersonID + "';"; SqlCommand command6 = new SqlCommand(strQuery6, myConnection); command6.ExecuteNonQuery(); string strQuery7 = "delete from tblShiftTypeCurrency where ShiftTypeID = '" + ShiftTypeID + "';"; SqlCommand command7 = new SqlCommand(strQuery7, myConnection); command7.ExecuteNonQuery(); string strQuery8 = "delete from tblShiftType where ShiftTypeName = '" + strTDShiftName + "';"; SqlCommand command8 = new SqlCommand(strQuery8, myConnection); command8.ExecuteNonQuery(); myConnection.Close(); string[] shiftdetails = ShiftAdministration.RetrieveShiftdetails(list[4]); string strfbwebshiftname = shiftdetails[0]; try { Assert.IsNull(strfbwebshiftname); PropertiesCollection.test.Log(Status.Pass, "Shift : " + list[4] + " is deleted and validated on Shift Admin screen"); } catch { PropertiesCollection.test.Log(Status.Fail, "Error: not deleted"); throw; } }
public void TS03_TC02_RosterAdmin_AddRoster() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS03_TC02_RosterAdmin_AddRoster"); String strtblname = "automation_rosteradministration"; var connection = new Database.ConnectToMySQL_Fetch_TestData(); var testdataRoster = connection.Select(strtblname, strTestCaseNo, strTestType); var TopbarMenu = new clsMainPage_TopbarMenu(); var RosterAdministration = new clsRosterAdministration(); TopbarMenu.NavigatetoRosterAdministration(); String strTDRosterName = testdataRoster[4]; String strTDPane = testdataRoster[5]; String strTDTimeZoneorLocation = testdataRoster[6]; String strTDTimeZone = testdataRoster[7]; String strTDLocation = testdataRoster[8]; String strTDPeople = testdataRoster[9]; String strTDShiftDetails = testdataRoster[10]; String strTDStatus = testdataRoster[11]; /********* Delete the Roster if its already present************/ String[] rosterdetails1 = RosterAdministration.RetrieveRosterdetails(strTDRosterName); Console.WriteLine(rosterdetails1[0]); if (rosterdetails1[0].IsNullOrEmpty() == false) { RosterAdministration.DeleteRosterdetails(rosterdetails1[0]); } /***************************************************************/ RosterAdministration.AddRosterdetails(strTDRosterName, strTDPane, strTDTimeZoneorLocation, strTDTimeZone, strTDLocation, strTDPeople, strTDShiftDetails, strTDStatus); System.Threading.Thread.Sleep(6000); String[] rosterdetails = RosterAdministration.RetrieveRosterdetails(strTDRosterName); String strfbwebrostername = rosterdetails[0]; String strfbwebpane = rosterdetails[1]; String strfbwebshifttypes = rosterdetails[2]; String strfbwebstatus = rosterdetails[3]; try { Assert.AreEqual(strTDRosterName, strfbwebrostername); PropertiesCollection.test.Log(Status.Pass, "Roster Name: " + strfbwebrostername + " created and validated on Roster Admin Screen"); } catch (AssertFailedException e) { PropertiesCollection.test.Log(Status.Fail, "Roster Name is not matching"); throw; } try { Assert.AreEqual(strTDPane, strfbwebpane); PropertiesCollection.test.Log(Status.Pass, "Pane: " + strfbwebpane + " created and validated on Roster Admin Screen"); } catch (AssertFailedException e) { PropertiesCollection.test.Log(Status.Fail, "Pane is not matching"); throw; } try { Assert.AreEqual(strTDShiftDetails, strfbwebshifttypes); PropertiesCollection.test.Log(Status.Pass, "Shift Types: " + strfbwebrostername + " created and validated on Roster Admin Screen"); } catch (AssertFailedException e) { PropertiesCollection.test.Log(Status.Fail, "Shift Types is not matching"); throw; } try { Assert.AreEqual(strTDStatus, strfbwebstatus); PropertiesCollection.test.Log(Status.Pass, "Roster : " + strfbwebrostername + " Status is validated "); } catch (AssertFailedException e) { PropertiesCollection.test.Log(Status.Fail, "Roster Status is not matching"); throw; } }