예제 #1
0
        public void Position_AddRow_RowAdded(string day, string begin, string end, string min, string max)
        {
            LoginPageObject     loginPage     = new LoginPageObject();
            MySchedPageObject   mySchedPage   = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject    menu          = new MenuLayoutObject();
            PositionsPageObject positionsPage = menu.EnterPositions();
            PositionPageObject  positionPage  = positionsPage.AddPosition();

            positionPage.AddRow(day, begin, end, min, max);

            positionPage.AddPosition("tester");
            positionsPage = menu.EnterPositions();
            positionPage  = positionsPage.EnterPosition(0);

            string tday   = positionPage.getDayName(0);
            string tbegin = positionPage.getBegin(0);
            string tend   = positionPage.getEnd(0);
            string tmin   = positionPage.getMin(0);
            string tmax   = positionPage.getMax(0);

            StringAssert.IsMatch(day, tday);
            StringAssert.IsMatch(begin, tbegin);
            StringAssert.IsMatch(end, tend);
            StringAssert.IsMatch(min, tmin);
            StringAssert.IsMatch(max, tmax);
        }
예제 #2
0
        public void Position_RemoveRow_RowRemoved()
        {
            string day   = "niedziela";
            string begin = "8:00";
            string end   = "9:00";
            string min   = "1";
            string max   = "2";

            LoginPageObject     loginPage     = new LoginPageObject();
            MySchedPageObject   mySchedPage   = loginPage.Login("*****@*****.**", "admin");
            MenuLayoutObject    menu          = new MenuLayoutObject();
            PositionsPageObject positionsPage = menu.EnterPositions();
            PositionPageObject  positionPage  = positionsPage.AddPosition();

            positionPage.AddRow(day, begin, end, min, max);
            positionPage.AddPosition("tester");

            positionsPage = menu.EnterPositions();
            positionPage  = positionsPage.EnterPosition(0);

            positionPage.deleteRow(0);
            positionPage.Save();

            positionsPage = menu.EnterPositions();
            positionPage  = positionsPage.EnterPosition(0);

            Assert.That(() => positionPage.getDayName(0), Throws.Exception);
        }
예제 #3
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);
        }