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 VerifyFloodFillForMealType_InEditMarksToolBar() { //login with Dinner Money feature bee on 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); AttendanceDetails editMarksGrid = new AttendanceDetails(); SeleniumHelper.FindAndClick(By.CssSelector("tr[section='header']:nth-child(3) td[column='3']")); SeleniumHelper.Sleep(2); editMarksGrid.ClickMealColumn(); // check Overwrite existing values check box SeleniumHelper.FindAndClick(By.CssSelector(".grid-menu:nth-child(9) .checkbox input")); //select H (Home) meal choice SeleniumHelper.FindElement(By.XPath("//*[@id='screen-viewer']/div/div[2]/div/div/div[2]/div[7]/div[3]/div[2]/div[1]/div/select")).SelectByText("H"); //click column button SeleniumHelper.FindAndClick(By.XPath("//*[@id='screen-viewer']/div/div[2]/div/div/div[2]/div[7]/div[3]/div[2]/div[3]/div/button[1]")); List <IWebElement> cells = EditMarksGridHelper.FindAllcells(); var cellValues = cells.Skip(1).FirstOrDefault().Text; string[] stringSeparators = new string[] { "\r\n" }; IEnumerable <string> distinctMealCode = cellValues.Split(stringSeparators, StringSplitOptions.None).Distinct(); //if flood fill is successful, all the cells would have been populated with 'H', so distinctMealCode collection should have only one //item 'H' Assert.IsTrue(distinctMealCode.Count() == 1 || distinctMealCode.FirstOrDefault() == "H"); }