コード例 #1
0
        public void People_Filter_TableFiltered(string filtrName, string filtrSurname, string personValues, Boolean result)
        {
            LoginPageObject   loginPage   = new LoginPageObject();
            MySchedPageObject mySchedPage = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu        = new MenuLayoutObject();
            PeoplePageObject  peoplePage  = menu.EnterPeople();

            string id = "0";

            try
            {
                id = peoplePage.GetCellContent(0, 0);
            }
            catch {}

            peoplePage.AddPerson(personValues, personValues, personValues + id + "@" + personValues + id + ".pl", "1qazxsw2", "1");
            SeleniumUtilityMethods.WaitForJavascript();
            string tId = peoplePage.GetCellContent(0, 0);

            peoplePage.setFilter(filtrName, filtrSurname);
            SeleniumUtilityMethods.WaitForJavascript();
            string nId = "";

            try
            {
                nId = peoplePage.GetCellContent(0, 0);
            }
            catch { }

            Assert.That(result == (tId == nId));
        }
コード例 #2
0
        public void People_AddWithInCorrectValues_PersonNotAdded(string name, string surname, string email, string password, string hours)
        {
            LoginPageObject   loginPage   = new LoginPageObject();
            MySchedPageObject mySchedPage = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu        = new MenuLayoutObject();
            PeoplePageObject  peoplePage  = menu.EnterPeople();

            string id = "";

            try
            {
                id = peoplePage.GetCellContent(0, 0);
            }
            catch { }

            peoplePage.AddPerson(name, surname, id + email, password, hours);
            SeleniumUtilityMethods.WaitForJavascript();

            string nid = "";

            try
            {
                nid = peoplePage.GetCellContent(0, 0);
            }
            catch { }

            StringAssert.IsMatch(id, nid);
        }
コード例 #3
0
        public void Person_ChangeDataToAnotherInCorrectValue_DataChanged(string name, string surname, string email, string password, string hours)
        {
            String            personValues = "test";
            LoginPageObject   loginPage    = new LoginPageObject();
            MySchedPageObject mySchedPage  = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu         = new MenuLayoutObject();
            PeoplePageObject  peoplePage   = menu.EnterPeople();
            PersonPageObject  personPage;

            string id = "0";

            try
            {
                id = peoplePage.GetCellContent(0, 0);
            }
            catch { }
            peoplePage.AddPerson(personValues, personValues, personValues + id + "@" + personValues + id + ".pl", "1qazxsw2", "1");
            SeleniumUtilityMethods.WaitForJavascript();
            personPage = peoplePage.EneterPerson(0);

            personPage.setData(name, surname, email, hours, false, password);
            personPage.Save();
            peoplePage = menu.EnterPeople();
            personPage = peoplePage.EneterPerson(0);

            string nname    = personPage.getName();
            string nsurname = personPage.getSurname();
            string nemail   = personPage.getEmail();
            string nhours   = personPage.getHours();

            StringAssert.DoesNotMatch(name, nname);
            StringAssert.DoesNotMatch(surname, nsurname);
            StringAssert.DoesNotMatch(email, nemail);
            StringAssert.DoesNotMatch(hours, nhours);
        }
コード例 #4
0
        public void Person_SetWorkDayWithCorrectValues_SetedWorkDay(int day, string begin, string end)
        {
            String            personValues = "test";
            LoginPageObject   loginPage    = new LoginPageObject();
            MySchedPageObject mySchedPage  = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu         = new MenuLayoutObject();
            PeoplePageObject  peoplePage   = menu.EnterPeople();
            PersonPageObject  personPage;

            string id = "0";

            try
            {
                id = peoplePage.GetCellContent(0, 0);
            }
            catch { }
            peoplePage.AddPerson(personValues, personValues, personValues + id + "@" + personValues + id + ".pl", "1qazxsw2", "1");
            SeleniumUtilityMethods.WaitForJavascript();
            personPage = peoplePage.EneterPerson(0);

            personPage.setWorkDay(day, begin, end);
            personPage.Save();
            peoplePage = menu.EnterPeople();
            personPage = peoplePage.EneterPerson(0);

            string nbegin = personPage.getDayBegin(day);
            string nend   = personPage.getDayEnd(day);

            StringAssert.IsMatch(begin, nbegin);
            StringAssert.IsMatch(end, nend);
        }
コード例 #5
0
        public void Person_SetWorkDayWithInCorrectValues_SetedWorkDay(int day, string begin, string end)
        {
            String            personValues = "test";
            LoginPageObject   loginPage    = new LoginPageObject();
            MySchedPageObject mySchedPage  = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu         = new MenuLayoutObject();
            PeoplePageObject  peoplePage   = menu.EnterPeople();
            PersonPageObject  personPage;

            string id = "0";

            try
            {
                id = peoplePage.GetCellContent(0, 0);
            }
            catch { }
            peoplePage.AddPerson(personValues, personValues, personValues + id + "@" + personValues + id + ".pl", "1qazxsw2", "1");
            SeleniumUtilityMethods.WaitForJavascript();
            personPage = peoplePage.EneterPerson(0);

            personPage.setWorkDay(day, begin, end);
            personPage.Save();
            peoplePage = menu.EnterPeople();
            personPage = peoplePage.EneterPerson(0);

            Boolean isworking = personPage.isWorkDay(day);

            Assert.That(isworking == false);
        }
コード例 #6
0
        public void Positions_Add_PositionAdded(string name)
        {
            LoginPageObject     loginPage     = new LoginPageObject();
            MySchedPageObject   mySchedPage   = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject    menu          = new MenuLayoutObject();
            PositionsPageObject positionsPage = menu.EnterPositions();
            PositionPageObject  positionPage  = positionsPage.AddPosition();

            string url1 = PropertiesCollection.driver.Url;

            positionPage = positionPage.AddPosition(name);
            SeleniumUtilityMethods.WaitForJavascript();
            string url2 = PropertiesCollection.driver.Url;

            positionsPage = menu.EnterPositions();

            string sId   = url2.Substring(url1.Length + 4);
            int    id    = Int32.Parse(sId);
            string tId   = positionsPage.GetCellContent(0, 0);
            string tName = positionsPage.GetCellContent(0, 1);

            StringAssert.IsMatch(sId, tId);
            StringAssert.IsMatch(sId, tId);
            StringAssert.IsMatch(name, tName);
        }
コード例 #7
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);
        }
コード例 #8
0
        public PeoplePageObject EnterPeople()
        {
            btnShowMenu.Clicks();
            SeleniumUtilityMethods.WaitForNamedElement("btnPeoplePage");
            btnPeoplePage.Click();

            return(new PeoplePageObject());
        }
コード例 #9
0
        public SchedulesPageObject EnterSchedules()
        {
            btnShowMenu.Clicks();
            SeleniumUtilityMethods.WaitForNamedElement("btnSchedulesPage");
            btnSchedulesPage.Click();

            return(new SchedulesPageObject());
        }
コード例 #10
0
        /// <summary>
        /// Rozszerzona metoda klikajaca na dany wiersz tabeli
        /// </summary>
        /// <param name="element"></param>
        public static void ClickTableRow(this IWebElement element, int row)
        {
            SeleniumUtilityMethods.WaitForJavascript();
            IWebElement table = element.FindElements(By.ClassName("q-table"))[0];
            IWebElement tbody = table.FindElements(By.CssSelector("tbody"))[1];
            IWebElement tr    = tbody.FindElements(By.CssSelector("tr"))[row];

            tr.Clicks();
        }
コード例 #11
0
 public void unSetWorkDay(int day)
 {
     if (isWorkDay(day))
     {
         IWebElement chb = PropertiesCollection.driver.FindElement(By.Name("chbActiveDay" + day));
         chb.Check();
         SeleniumUtilityMethods.WaitForJavascript();
     }
 }
コード例 #12
0
 public string getPopUpText()
 {
     SeleniumUtilityMethods.WaitForJavascript();
     try
     {
         return(popUp.Text);
     }
     catch
     {
         return(null);
     }
 }
コード例 #13
0
        public void setWorkDay(int day, string begin, string end)
        {
            if (!isWorkDay(day))
            {
                IWebElement chb = PropertiesCollection.driver.FindElement(By.Name("chbActiveDay" + day));
                chb.Check();
                SeleniumUtilityMethods.WaitForJavascript();
            }
            IWebElement tbeg = PropertiesCollection.driver.FindElement(By.Name("txtBegin" + day));
            IWebElement tend = PropertiesCollection.driver.FindElement(By.Name("txtEnd" + day));

            tbeg.EnterText(begin);
            tend.EnterText(end);
        }
コード例 #14
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));
            }
        }
コード例 #15
0
        public void MyData_ChangeToShortPassword_PopUpWrongPasswordAndCannotLoginWithNewPassword(string email, string password, string newPassword)
        {
            LoginPageObject   loginPage  = new LoginPageObject();
            MySchedPageObject mSchedPage = loginPage.Login(email, password);
            MenuLayoutObject  menu       = new MenuLayoutObject();
            MyDataPageObject  mdataPage  = menu.EnterDataPage();

            mdataPage.changePassword(newPassword);
            SeleniumUtilityMethods.WaitForJavascript();
            string txt = mdataPage.getPopUpText();

            loginPage = menu.LogOut();

            StringAssert.IsMatch("Hasło musi zawierać conajmniej 5 znaków.", txt);
            Assert.That(() => loginPage.Login(email, newPassword), Throws.Exception);
        }
コード例 #16
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);
        }
コード例 #17
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);
        }
コード例 #18
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);
        }
コード例 #19
0
        public void People_ClickRow_EnteredPersonPage(int row)
        {
            String            personValues = "test";
            LoginPageObject   loginPage    = new LoginPageObject();
            MySchedPageObject mySchedPage  = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject  menu         = new MenuLayoutObject();
            PeoplePageObject  peoplePage   = menu.EnterPeople();
            PersonPageObject  personPage;

            string id = "0";

            try
            {
                id = peoplePage.GetCellContent(0, 0);
            }
            catch { }
            peoplePage.AddPerson(personValues, personValues, personValues + id + "@" + personValues + id + ".pl", "1qazxsw2", "1");
            SeleniumUtilityMethods.WaitForJavascript();
            personPage = peoplePage.EneterPerson(row);

            Assert.That(() => personPage.getEmail(), Throws.Nothing);
        }
コード例 #20
0
 public SchedulesPageObject()
 {
     PageFactory.InitElements(PropertiesCollection.driver, this);
     SeleniumUtilityMethods.WaitForNamedElement("tabSchedules");
 }
コード例 #21
0
 public void SetDate(string date)
 {
     txtDate.EnterDate(date);
     SeleniumUtilityMethods.WaitForJavascript(5);
 }
コード例 #22
0
 public string getId()
 {
     SeleniumUtilityMethods.WaitForClickableElement("lblScheduleId");
     return(lblScheduleId.Text);
 }
コード例 #23
0
 public string getDates()
 {
     SeleniumUtilityMethods.WaitForClickableElement("lblDates");
     return(lblDates.Text);
 }
コード例 #24
0
 public void ChangeOnlyMy()
 {
     SeleniumUtilityMethods.WaitForNamedElement("chbMy");
     //chbMy.Click();
     chbMy.Check();
 }
コード例 #25
0
 public PersonPageObject()
 {
     PageFactory.InitElements(PropertiesCollection.driver, this);
     SeleniumUtilityMethods.WaitForNamedElement("chbActiveDay6");
 }
コード例 #26
0
 public void Confirm()
 {
     btnConfirm.Clicks();
     SeleniumUtilityMethods.WaitForJavascript();
 }
コード例 #27
0
 public string getConfirmed()
 {
     SeleniumUtilityMethods.WaitForClickableElement("lblConfirmed");
     return(lblConfirmed.Text);
 }
コード例 #28
0
 public PeoplePageObject()
 {
     PageFactory.InitElements(PropertiesCollection.driver, this);
     SeleniumUtilityMethods.WaitForNamedElement("btnAdd");
 }
コード例 #29
0
 public void ChangeOnlyConfirmed()
 {
     SeleniumUtilityMethods.WaitForNamedElement("chbConfirmed");
     chbConfirmed.Check();
 }