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();
        }
Ejemplo n.º 2
0
            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 AddShiftAdmin()
        {
            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC01_AddShiftAdmin");
            FpAdminMenus adminmenus = new FpAdminMenus();

            adminmenus.AdminClick();
            adminmenus.LnkShiftAdministration.Click();

            clsShiftAdministration shiftadmin = new clsShiftAdministration();

            strTestCaseNo = "TC001_Reg";
            strtblname    = "automation_shiftadministration";
            strTestType   = "Regression";

            var connection    = new Database.ConnectToMySQL_Fetch_TestData();
            var testdataShift = connection.Select(strtblname, strTestCaseNo, strTestType);

            string strTDShiftName  = testdataShift[4];
            string strTDShortCode  = testdataShift[5];
            string strTDStartTime  = testdataShift[6];
            string strTDDuration   = testdataShift[7];
            string strTDCurrencies = testdataShift[8];
            string strTDStatus     = testdataShift[9];

            shiftadmin.AddShiftdetails(strTDShiftName, strTDShortCode, strTDStartTime, strTDDuration, strTDCurrencies);
            string[] shiftdetails = shiftadmin.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, strfbwebshiftname + " Shift created Succesfully");
            }
            catch {
                PropertiesCollection.test.Log(Status.Fail, strfbwebshiftname + " Shift not created Succesfully");
                throw;
            }
            try
            {
                Assert.AreEqual(strTDStartTime, strfbwebstarttime);
                PropertiesCollection.test.Log(Status.Pass, strfbwebstarttime + " Shift Start time validated Succesfully");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, strfbwebstarttime + " Shift Start Time not validated Succesfully");
                throw;
            }
            try
            {
                Assert.AreEqual(strTDDuration, strfbwebDuration);
                PropertiesCollection.test.Log(Status.Pass, strfbwebDuration + " Shift Duration validated Succesfully");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, strfbwebDuration + " Shift Duration not validated Succesfully");
                throw;
            }
            try
            {
                Assert.AreEqual(strTDCurrencies, strfbwebCurrencies);
                PropertiesCollection.test.Log(Status.Pass, strfbwebDuration + " Shift Currencies validated Succesfully");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, strfbwebCurrencies + " Shift Currencies not validated Succesfully");
                throw;
            }
            try
            {
                Assert.AreEqual(strTDStatus, strfbwebStatus);
                PropertiesCollection.test.Log(Status.Pass, strfbwebDuration + " Shift Status validated Succesfully");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, strfbwebStatus + " Shift Status not validated Succesfully");
                throw;
            }
        }