示例#1
0
        public void Leaves_ChangeDateFilter_FilterTable(string date, string filter)
        {
            LoginPageObject   loginPage   = new LoginPageObject();
            MySchedPageObject mySchedPage = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu        = new MenuLayoutObject();
            LeavePageObject   leavesPage  = menu.EnterLeavesage();

            leavesPage.SetDate(date);
            leavesPage.AddLeave(date, date, "test");
            leavesPage.AddLeave(filter, filter, "test");
            SeleniumUtilityMethods.WaitForJavascript();

            string Id1 = leavesPage.tabLeaves.GetTableCell(0, 0);
            string Id2 = leavesPage.tabLeaves.GetTableCell(1, 0);

            leavesPage.SetDate(filter);
            string Id3 = leavesPage.tabLeaves.GetTableCell(0, 0);
            string Id4 = "";

            try
            {
                Id4 = leavesPage.tabLeaves.GetTableCell(1, 0);
            }
            catch { }

            StringAssert.IsMatch(Id1, Id3);
            StringAssert.DoesNotMatch(Id3, Id4);
        }
示例#2
0
        public void Leaves_CheckOnlyConfirmed_HideNotConfirmed(int firsts, int secounds, Boolean firstsConfirmed)
        {
            LoginPageObject   loginPage   = new LoginPageObject();
            MySchedPageObject mySchedPage = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu        = new MenuLayoutObject();
            LeavePageObject   leavesPage  = menu.EnterLeavesage();

            leavesPage.SetDate("2021-04-20");
            for (int i = 0; i < firsts + secounds; i++)
            {
                leavesPage.AddLeave("2021-04-20", "2021-05-21", "test");
                SeleniumUtilityMethods.WaitForJavascript();
            }
            int start;
            int end;
            int count;

            if (firstsConfirmed)
            {
                start = 0;
                end   = firsts;
                count = firsts;
            }
            else
            {
                start = firsts;
                end   = firsts + secounds;
                count = secounds;
            }
            string[] tab = new string[count];
            int      j   = 0;

            for (int i = start; i < end; i++)
            {
                leavesPage.Confirm(i);
                SeleniumUtilityMethods.WaitForJavascript();
                tab[j] = leavesPage.GetCellContent(i, 0);
                j++;
            }

            leavesPage.ChangeOnlyConfirmed();
            SeleniumUtilityMethods.WaitForJavascript();

            for (int i = 0; i < count; i++)
            {
                StringAssert.IsMatch(tab[i], leavesPage.GetCellContent(i, 0));
            }
        }
示例#3
0
        public void Leaves_Add_LeaveAdded(string email, string password, string name, string begin, string end, string purpose, Boolean admin)
        {
            LoginPageObject   loginPage   = new LoginPageObject();
            MySchedPageObject mySchedPage = loginPage.Login(email, password);
            MenuLayoutObject  menu        = new MenuLayoutObject();
            LeavePageObject   leavesPage  = menu.EnterLeavesage();

            leavesPage.SetDate(begin);
            leavesPage.AddLeave(begin, end, purpose);
            SeleniumUtilityMethods.WaitForJavascript();

            int    i   = 0;
            string pId = leavesPage.GetCellContent(0, i);

            i++;
            string pPerson = "";

            if (admin)
            {
                pPerson = leavesPage.GetCellContent(0, i);
                i++;
            }
            string pBegin = leavesPage.GetCellContent(0, i);

            i++;
            string pEnd = leavesPage.GetCellContent(0, i);

            i++;
            string pPurpose = leavesPage.GetCellContent(0, i);

            i++;
            string pConfirm = leavesPage.GetCellContent(0, i);

            string rBegin = begin.Split('-')[2] + "." + begin.Split('-')[1] + "." + begin.Split('-')[0];
            string rEnd   = end.Split('-')[2] + "." + end.Split('-')[1] + "." + end.Split('-')[0];

            StringAssert.IsMatch("[0-9]*", pId);
            if (admin)
            {
                StringAssert.IsMatch(name, pPerson);
            }
            StringAssert.IsMatch(rBegin, pBegin);
            StringAssert.IsMatch(rEnd, pEnd);
            StringAssert.IsMatch(purpose, pPurpose);
            StringAssert.IsMatch("NIE", pConfirm);
        }
示例#4
0
        public void Leaves_TryConfirm_CorrectConfirmPopUpText(string begin, string end)
        {
            LoginPageObject   loginPage   = new LoginPageObject();
            MySchedPageObject mySchedPage = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu        = new MenuLayoutObject();
            LeavePageObject   leavesPage  = menu.EnterLeavesage();

            leavesPage.SetDate(begin);
            leavesPage.AddLeave(begin, end, "test");
            SeleniumUtilityMethods.WaitForJavascript();

            string pconfirm = leavesPage.GetConfirmText(0);

            string rBegin = begin.Split('-')[2] + "-" + begin.Split('-')[1] + "-" + begin.Split('-')[0];
            string rEnd   = end.Split('-')[2] + "-" + end.Split('-')[1] + "-" + end.Split('-')[0];

            StringAssert.IsMatch("Czy zatwierdzasz urlop admin admin w okresie od " + rBegin + " do " + rEnd + "?", pconfirm);
        }
示例#5
0
        public void Leaves_PretendConfirm_NotConfirmed(int row)
        {
            LoginPageObject   loginPage   = new LoginPageObject();
            MySchedPageObject mySchedPage = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu        = new MenuLayoutObject();
            LeavePageObject   leavesPage  = menu.EnterLeavesage();

            leavesPage.SetDate("2020-04-20");
            for (int i = 0; i < row; i++)
            {
                leavesPage.AddLeave("2020-04-20", "2020-04-23", "test");
                SeleniumUtilityMethods.WaitForJavascript();
            }
            leavesPage.PretendConfirm(row);
            SeleniumUtilityMethods.WaitForJavascript();

            string pconfirm = leavesPage.GetCellContent(row, 5);

            StringAssert.IsMatch("NIE", pconfirm);
        }