public void VerticalOrientationOfMealMarks_OnEditMarks()
        {
            string[] featureList = { "Dinner Money Settings" };
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator, featureList);

            Wait.WaitForDocumentReady();
            SeleniumHelper.NavigateQuickLink("Edit Marks");
            AttendanceNavigations.ClickDayOrWeekRadioButton("Week");
            SeleniumHelper.Sleep(5);
            AttendanceNavigations.SelectClass("6A");
            AttendanceNavigations.ClickEditMarksSearchButton();

            Wait.WaitForDocumentReady();
            SeleniumHelper.Sleep(10);

            //Vertical Cursor Orientation in Preserve Mode
            EditMarksGridHelper grid = new EditMarksGridHelper();

            grid.ClickOrientationbutton(grid.orientationButton);
            grid.ClickOrientationbutton(grid.verticalMode);
            EditMarksGridHelper.ClickFirstCellofColumn("3");
            EditMarksGridHelper.GetEditor().SendKeys("A");
            EditMarksGridHelper.GetEditor().SendKeys("H");
            EditMarksGridHelper.GetEditor().SendKeys("P");
            EditMarksGridHelper.GetEditor().SendKeys("S");
            EditMarksGridHelper.GetEditor().SendKeys("H");
        }
        public void EnterMealTypeInMealCell_InEditMarks()
        {
            string[] featureList = { "Dinner Money Settings" };
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator, featureList);

            Wait.WaitForDocumentReady();
            SeleniumHelper.NavigateQuickLink("Edit Marks");
            AttendanceNavigations.ClickDayOrWeekRadioButton("Day");
            AttendanceNavigations.SelectClass("6A");
            AttendanceNavigations.ClickEditMarksSearchButton();

            Wait.WaitForDocumentReady();
            SeleniumHelper.Sleep(10);

            //Vertical Cursor Orientation in Preserve Mode
            EditMarksGridHelper grid = new EditMarksGridHelper();

            grid.ClickOrientationbutton(grid.preserveButton);
            grid.ClickOrientationbutton(grid.overwriteMode);
            EditMarksGridHelper.ClickFirstCellofColumn("3");
            EditMarksGridHelper.GetEditor().SendKeys("A");
            EditMarksGridHelper.GetEditor().SendKeys("H");
            EditMarksGridHelper.GetEditor().SendKeys("P");
            EditMarksGridHelper.GetEditor().SendKeys("S");

            List <IWebElement> cells = EditMarksGridHelper.FindAllcells();

            //check if edited cell has meal types (A, H, P or S) in it, if yes, return test as pass
            var mealCodes = cells.Skip(1).FirstOrDefault().Text;

            Assert.IsTrue(mealCodes.Contains("A") || mealCodes.Contains("H") || mealCodes.Contains("P") || mealCodes.Contains("S"));
        }
        public void OverwriteModeOfMarks_OnAttendanceRegister()
        {
            AttendanceNavigations.NavigateToEditMarksMenuPage();
            var registerView = new AttendanceSearchPanel();

            registerView.ClickRadioButton("Week");

            var group = new AttendanceSearchPanel();

            group.Select("Year Group", "Year 1", "Year 2");
            AttendanceDetails editMarksPage = group.EditMarksSearchButton();

            //Vertical Cursor Orientation in Preserve Mode
            EditMarksGridHelper grid = new EditMarksGridHelper();

            grid.ClickOrientationbutton(grid.preserveButton);
            grid.ClickOrientationbutton(grid.overwriteMode);
            EditMarksGridHelper.ClickFirstCellofColumn("3");
            EditMarksGridHelper.GetEditor().SendKeys("L");
            EditMarksGridHelper.GetEditor().SendKeys("L");
            EditMarksGridHelper.GetEditor().SendKeys("B");
            EditMarksGridHelper.GetEditor().SendKeys("C");
            EditMarksGridHelper.GetEditor().SendKeys("C");
            EditMarksGridHelper.GetEditor().SendKeys("D");
        }
        public void SaveMealTypes_InEditMarksToolBar()
        {
            string[] featureList = { "Dinner Money Settings" };
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator, featureList);

            Wait.WaitForDocumentReady();
            SeleniumHelper.NavigateQuickLink("Edit Marks");
            AttendanceNavigations.ClickDayOrWeekRadioButton("Day");
            AttendanceNavigations.SelectClass("6A");
            AttendanceNavigations.ClickEditMarksSearchButton();

            Wait.WaitForDocumentReady();
            SeleniumHelper.Sleep(5);

            EditMarksGridHelper grid = new EditMarksGridHelper();

            grid.ClickOrientationbutton(grid.preserveButton);
            grid.ClickOrientationbutton(grid.overwriteMode);
            EditMarksGridHelper.ClickFirstCellofColumn("3");
            EditMarksGridHelper.GetEditor().SendKeys("A");
            EditMarksGridHelper.GetEditor().SendKeys("H");
            EditMarksGridHelper.GetEditor().SendKeys("P");
            EditMarksGridHelper.GetEditor().SendKeys("S");

            var registerSave = WebContext.WebDriver.FindElement(EditMarksElements.Toolbar.Save);

            registerSave.Click();
            SeleniumHelper.Sleep(3);
            string saveMessage = WebContext.WebDriver.FindElement(By.XPath("//strong[contains(text(),'Register saved')]")).Text;

            SeleniumHelper.Logout();

            Assert.IsTrue(saveMessage == "Register saved");
        }
        public void PreseveModeOfMarks_OnAttendanceRegister()
        {
            AttendanceNavigations.NavigateToEditMarksMenuPage();
            var registerView = new AttendanceSearchPanel();

            registerView.ClickRadioButton("Week");

            var group = new AttendanceSearchPanel();

            group.Select("Year Group", "Year 1", "Year 2");
            AttendanceDetails editMarksPage = group.EditMarksSearchButton();

            var editMarksTripletPage = new EditMarksTriplet();
            var editPage             = editMarksTripletPage.SearchCriteria.Search <EditMarksPage>();

            var editmarkTable = editPage.Marks;
            IEnumerable <SchoolAttendanceCode> getHolidays = Queries.GetAttendanceNotRequiredCodes();
            List <string> codes = getHolidays.Select(x => x.Code).ToList <string>();

            if (codes.Contains(editmarkTable[1][2].Text))
            {
                Console.WriteLine("Marks can't be overwritten on Holidays");
                return;
            }

            //Vertical Cursor Orientation in Preserve Mode
            EditMarksGridHelper grid = new EditMarksGridHelper();

            grid.ClickOrientationbutton(grid.preserveButton);
            grid.ClickOrientationbutton(grid.preserveMode);
            EditMarksGridHelper.ClickFirstCellofColumn("3");
            EditMarksGridHelper.GetEditor().SendKeys("L");
            EditMarksGridHelper.GetEditor().SendKeys("L");
            EditMarksGridHelper.GetEditor().SendKeys("B");
            EditMarksGridHelper.GetEditor().SendKeys("C");
            EditMarksGridHelper.GetEditor().SendKeys("C");
            EditMarksGridHelper.GetEditor().SendKeys("D");
        }