public CreateMarksheetForDataEntry AssignGradeSet()
        {
            IWebElement propertiesGrid = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);
            IWebElement gradesetColumn = propertiesGrid.FindElement(MarksheetConstants.GradesetColumn);
            ReadOnlyCollection <IWebElement> gradesetColumnCell = gradesetColumn.FindElements(MarksheetConstants.ColumnCell);

            const int   newi             = 2;
            IWebElement gradeDetailsLink = gradesetColumnCell[newi].FindElement(By.TagName("button"));

            gradeDetailsLink.Click();
            MarksheetGridHelper.GradesetDetailsSelector("Age -99/11-99/11");

            Thread.Sleep(5000);

            //To avoid stale references.
            IWebElement propertiesGrid1 = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);
            IWebElement gradesetColumn1 = propertiesGrid1.FindElement(MarksheetConstants.GradesetColumn);
            ReadOnlyCollection <IWebElement> gradesetColumnCell1 = gradesetColumn1.FindElements(MarksheetConstants.ColumnCell);

            IWebElement gradeDetailsLink1 = gradesetColumnCell1[newi + 1].FindElement(By.TagName("button"));

            gradeDetailsLink1.Click();
            MarksheetGridHelper.GradesetDetailsSelector("Marks 0 - 6");
            return(this);
        }
        public CreateMarksheetForDataEntry ApplyColouronHeader(int cellNumber, int Colour)
        {
            IWebElement propertiesGrid = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);

            IWebElement colourColumn = propertiesGrid.FindElement(MarksheetConstants.ColourColumn);
            ReadOnlyCollection <IWebElement> colourColumnCell = colourColumn.FindElements(MarksheetConstants.ColumnCell);

            int newi = cellNumber;

            colourColumnCell[newi].Click();

            propertiesGrid = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);
            ReadOnlyCollection <IWebElement> colourColumnEditedCell = propertiesGrid.FindElements(MarksheetConstants.ColumnEditedCell);

            if (colourColumnEditedCell.Count == 0)
            {
                colourColumnEditedCell = propertiesGrid.FindElements(MarksheetConstants.ColumnEditedCellUp);
            }
            ReadOnlyCollection <IWebElement> colourCells = colourColumnEditedCell[0].FindElements(By.CssSelector("ul[class='stylepicker'] > li[class='stylepicker-swatch-wrapper']"));
            IWebElement selectedColour = colourCells[Colour].FindElement(By.CssSelector("input[type='radio']"));

            selectedColour.Click();

            return(this);
        }
        public CreateMarksheetForDataEntry ShowPropertyScreenValidations()
        {
            IWebElement propertiesGrid = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);

            IWebElement cellDiv   = propertiesGrid.FindElement(By.CssSelector(MarksheetGridHelper.propertycolumnsselection));
            IWebElement parnetDiv = cellDiv.FindElement(By.CssSelector("[column='2']"));

            List <IWebElement> ElementList = MarksheetGridHelper.GetPropertiesHeaderList(parnetDiv);

            ElementList[1].Click();
            MarksheetGridHelper.GetEditor().Clear();
            MarksheetGridHelper.GetEditor().SendKeys("Test");
            MarksheetGridHelper.PerformEnterKeyBehavior();

            List <IWebElement> ElementList2 = MarksheetGridHelper.GetPropertiesHeaderList(parnetDiv);

            ElementList2[0].Click();
            MarksheetGridHelper.GetEditor().Clear();
            MarksheetGridHelper.PerformEnterKeyBehavior();

            MarksheetGridHelper.GetEditor().SendKeys("Actual Actual Actual Actual Actual Actual Actual Actual Actual Actual Actual Actual Actual Actual Actual"); //Check 100 character length in header text

            MarksheetGridHelper.PerformEnterKeyBehavior();

            List <IWebElement> ElementList3 = MarksheetGridHelper.GetPropertiesHeaderList(parnetDiv);

            ElementList3[2].Click();
            return(this);
        }
Example #4
0
        public static IWebElement FindColumnByColumnName(string columnName)
        {
            List <IWebElement> allColumns = MarksheetGridHelper.FindAllColumns();
            IWebElement        getColumn  = allColumns.FirstOrDefault(col => col.Text.Contains(columnName));

            return(getColumn);
        }
Example #5
0
        public static String GetColumnName(string columnHeaderText)
        {
            List <IWebElement> allColumns = MarksheetGridHelper.FindAllColumns();
            IWebElement        ageColumn  = allColumns.FirstOrDefault(col => col.Text.Contains(columnHeaderText));
            String             ColumnName = ageColumn.GetText();

            return(ColumnName);
        }
Example #6
0
        public static List <IWebElement> FindCellsOfColumnByColumnNamePOSExpectation(string columnHeaderText, string columnHeaderFooterText)
        {
            List <IWebElement> allColumns = MarksheetGridHelper.FindAllColumns();
            IWebElement        ageColumn  = allColumns.FirstOrDefault(col => col.Text.Contains(columnHeaderText));
            string             columnNo   = ageColumn.GetAttribute("column");

            return(MarksheetGridHelper.FindcellsForColumn(columnNo));
        }
Example #7
0
        public static List <IWebElement> FindCellsOfColumnByColumnNameForPOS(string columnHeaderText)
        {
            string             textTocompare = columnHeaderText.Replace(" ", string.Empty).ToLower();
            List <IWebElement> allColumns    = MarksheetGridHelper.FindAllColumns();
            IWebElement        ageColumn     = allColumns.FirstOrDefault(col => col.Text.Replace(" ", string.Empty).ToLower().StartsWith(textTocompare)) ??
                                               allColumns.FirstOrDefault(col => col.Text.Replace(" ", string.Empty).ToLower().Contains(textTocompare));
            string columnNo = ageColumn.GetAttribute("column");

            return(MarksheetGridHelper.FindcellsForColumn(columnNo));
        }
Example #8
0
        public ResultHistory ClearValueInCell()
        {
            WebDriverWait waiter = new WebDriverWait(WebContext.WebDriver, TimeSpan.FromSeconds(MarksheetConstants.Timeout));

            waiter.Until(ExpectedConditions.ElementToBeClickable(By.CssSelector("[data-automation-id='save_button']")));

            List <IWebElement> editableCells = MarksheetGridHelper.FindAllEditablecells();

            Thread.Sleep(1000);
            editableCells.First().FindElements(By.CssSelector(MarksheetGridHelper.SelectedCellSelector)).First().Click();
            GetEditor().Clear();
            return(this);
        }
        public CreateMarksheetForDataEntry RearrangeColumns()
        {
            IWebElement propertiesGrid = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);
            IWebElement cellDiv        = propertiesGrid.FindElement(By.CssSelector(MarksheetGridHelper.propertycolumnsselection));
            IWebElement parnetDiv      = cellDiv.FindElement(By.CssSelector("[column='1']"));

            List <IWebElement> ElementList = MarksheetGridHelper.GetPropertiesHeaderList(parnetDiv);

            ElementList[1].Click();

            IJavaScriptExecutor js = WebContext.WebDriver as IJavaScriptExecutor;

            js.ExecuteScript("document.getElementsByClassName('webix_row_select')[1].getElementsByClassName('marksheet-properties-move up')[0].click();");
            return(this);
        }
        public AssessmentMarksheetDetail selectFilterOptions()
        {
            WaitForElement(By.CssSelector("[data-dropdown-container='']"));
            IEnumerable <IWebElement> elements = WebContext.WebDriver.FindElements(By.CssSelector("[data-dropdown-container='']"));

            foreach (IWebElement webElement in elements)
            {
                if (webElement.Text == "Assessment Period")
                {
                    webElement.Click();
                    Thread.Sleep(1000);
                    MarksheetGridHelper.PerformEnterKeyBehavior();
                    Thread.Sleep(1000);
                }
            }
            return(this);
        }
Example #11
0
        //to multiple cells
        public FormulaBarPage AddValueToColumn(string columnName, string value)
        {
            List <IWebElement> allColumns = MarksheetGridHelper.FindAllColumns();
            IWebElement        column     = allColumns.FirstOrDefault(col => col.Text == columnName);
            string             columnNo   = column != null?column.GetAttribute("column") : "1";

            MarksheetGridHelper.FindColumnByColumnNumber(columnNo).Click();

            Actions action = new Actions(WebContext.WebDriver);

            _formulaBarElement.Click();
            _formulaBarElement.Clear();
            _formulaBarElement.SendKeys(value);
            action.SendKeys(Keys.Enter).Perform();

            return(this);
        }
Example #12
0
        public static void ScrollToRight(string columnNo)
        {
            List <IWebElement> editableCells = MarksheetGridHelper.FindAllEditablecells();
            Actions            action        = new Actions(WebContext.WebDriver);

            if (editableCells.Any(cell => cell.GetAttribute("column") == columnNo))
            {
                editableCells.Find(cell => cell.GetAttribute("column") == columnNo).Click();
                action.SendKeys(Keys.Right).Perform();
            }
            else
            {
                string lastColNo = editableCells.LastOrDefault().GetAttribute("column");
                editableCells.LastOrDefault().Click();
                for (int i = Convert.ToInt16(lastColNo); i < Convert.ToInt16(columnNo); i++)
                {
                    action.SendKeys(Keys.Right).Perform();
                }
            }
        }
Example #13
0
        public FormulaBarPage AddValue(string columnName, string value)
        {
            List <IWebElement> allColumns = MarksheetGridHelper.FindAllColumns();
            IWebElement        column     = allColumns.FirstOrDefault(col => col.Text == columnName);
            string             columnNo   = column != null?column.GetAttribute("column") : "1";

            List <IWebElement> editableCellsforColumn = MarksheetGridHelper.FindcellsForColumn(columnNo);

            if (editableCellsforColumn != null && editableCellsforColumn.Count > 0)
            {
                Actions action = new Actions(WebContext.WebDriver);

                editableCellsforColumn.First().Click();
                _formulaBarElement.Click();
                _formulaBarElement.Clear();
                _formulaBarElement.SendKeys(value);
                action.SendKeys(Keys.Enter).Perform();
            }

            return(this);
        }
Example #14
0
        public void SelectYearsOfTheRow(int rowID)
        {
            IWebElement periodSelectorTable = WebContext.WebDriver.FindElement(By.CssSelector(AssessmentPeriodSelector));

            if (periodSelectorTable != null)
            {
                List <IWebElement> rowElements = periodSelectorTable.FindElements(By.CssSelector(PeriodSelector)).ToList();
                if (rowElements != null && rowElements.Count > 0)
                {
                    rowElements[rowID].Click();
                }
                MarksheetGridHelper.DownArrowKeyBehavior();
                MarksheetGridHelper.PerformEnterKeyBehavior();

                IWebElement        YearSelector = periodSelectorTable.FindElements(By.CssSelector(AssessmentPeriodRowSelector)).ToList()[rowID];
                List <IWebElement> checkboxList = YearSelector.FindElements(By.CssSelector(CheckBxSelector)).ToList();
                if (checkboxList != null && checkboxList.Count > 0)
                {
                    checkboxList[0].Click();
                }
            }
        }
Example #15
0
        public FormulaBarPage AddComment(string columnName, string value, bool haveToClick)
        {
            List <IWebElement> allColumns = MarksheetGridHelper.FindAllColumns();
            IWebElement        column     = allColumns.FirstOrDefault(col => col.Text == columnName);
            string             columnNo   = column != null?column.GetAttribute("column") : "1";

            List <IWebElement> editableCellsforColumn = MarksheetGridHelper.FindcellsForColumn(columnNo);

            if (editableCellsforColumn != null && editableCellsforColumn.Count > 0)
            {
                Actions action = new Actions(WebContext.WebDriver);
                editableCellsforColumn.First().WaitUntilState(ElementState.Enabled);

                if (haveToClick)
                {
                    editableCellsforColumn.First().Click();
                }

                _commentBarElement.Click();
                _commentBarElement.WaitUntilState(ElementState.Enabled);
                _commentBarElement.Clear();

                if (value.Length > 500)
                {
                    _commentBarElement.SendKeys(value.Substring(0, 500));
                    _commentBarElement.SendKeys(value.Substring(500, (value.Length - 500)));
                }
                else
                {
                    _commentBarElement.SendKeys(value);
                }
                action.SendKeys(Keys.Enter).Perform();
            }

            return(this);
        }
Example #16
0
        public GroupFilterDetail CreateMarksheet(string groupFilter)
        {
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator, false);
            SeleniumHelper.NavigateMenu("Tasks", "Assessment", "Set Up Marksheets and Parental Reports");
            //Create page object of marksheet home
            CreateMarksheetTypeSelectionPage marksheetTypeMenuPage = new CreateMarksheetTypeSelectionPage();
            MarksheetBuilder marksheetBuilder = (MarksheetBuilder)marksheetTypeMenuPage.MarksheetTypeSelection("New Marksheet");

            //Randomly generate Unique Marksheet Name
            var MarksheetTemplateName = marksheetBuilder.RandomString(8);

            //Verifying the saved marksheet
            marksheetBuilder.setMarksheetProperties(MarksheetTemplateName, "Description", true);
            marksheetBuilder.SelectPropertiesTab();

            AddAssessments addAssessments = marksheetBuilder.NavigateAssessments();
            AddAspects     addAspects     = addAssessments.NavigateAssessmentsviaAssessment();

            addAspects.SelectNReturnSelectedAssessments(2);
            AddAssessmentPeriod addAssessmentPeriod = addAspects.AspectNextButton();

            addAssessmentPeriod.AspectAssessmentPeriodSelection(1);
            addAssessmentPeriod.ClickAspectAssessmentPeriodDone();

            marksheetBuilder.NavigateAssessments();
            AddSubjects addSubjects = addAssessments.NavigateAssessmentsviaSubject();

            addSubjects.SelectSubjectResultfromName("Language and Literacy");
            AddModeMethodPurpose addModeMethodPurpose = addSubjects.SubjectNextButton();

            addModeMethodPurpose.purposeAssessmentPeriodSelection(1);
            addModeMethodPurpose.modeAssessmentPeriodSelection(2);
            addModeMethodPurpose.methodAssessmentPeriodSelection(1);


            addAssessmentPeriod = addModeMethodPurpose.modeMethodPurposeNextButton();
            //addAssessmentPeriod.subjectAssessmentPeriodSelection(2);
            marksheetBuilder = addAssessmentPeriod.ClickSubjectAssessmentPeriodDone();


            AddGroups addgroups = marksheetBuilder.NavigateGroups();

            addgroups.SelectYearGroup("Year 1");
            List <string> selectedGroups = addgroups.GetSelectedGroupOrGroupfilter(MarksheetConstants.SelectYearGroups);

            addgroups.ClickDoneButton();
            GroupFilters groupfilter = new GroupFilters();

            groupfilter.SelectClassFilterName("");
            WebContext.WebDriver.FindElements(By.CssSelector("[name='ClassesFilter.SelectedIds']"))
            .FirstOrDefault()
            .Click();
            marksheetBuilder = groupfilter.ClickDoneButton();

            ReadOnlyCollection <IWebElement> hiddenElementsCollection = WebContext.WebDriver.FindElements(By.CssSelector("[data-createmarksheet-hidden='']"));
            int count = hiddenElementsCollection.Count;

            hiddenElementsCollection[count - 1].Click();
            hiddenElementsCollection[count - 2].Click();

            IWebElement propertiesGrid = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);

            propertiesGrid = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);
            IWebElement gradesetColumn = propertiesGrid.FindElement(MarksheetConstants.GradesetColumn);
            ReadOnlyCollection <IWebElement> gradesetColumnCell = gradesetColumn.FindElements(MarksheetConstants.ColumnCell);
            IWebElement gradeDetailsLink;
            int         posMode   = -1;
            int         endOfYear = 0;

            gradesetColumn     = propertiesGrid.FindElement(MarksheetConstants.GradesetColumn);
            gradesetColumnCell = gradesetColumn.FindElements(MarksheetConstants.ColumnCell);

            posMode = 0;

            int newi = 6;

            Assert.AreEqual(gradesetColumnCell[newi].Text, "Assign");
            gradeDetailsLink = gradesetColumnCell[newi].FindElement(By.TagName("button"));
            gradeDetailsLink.Click();
            MarksheetGridHelper.GradesetDetailsSelector("Age -99/11-99/11");
            // waiter.Until(ExpectedConditions.ElementToBeClickable(gradeDetailsLink));
            posMode++;

            //To avoid stale references.
            propertiesGrid     = MarksheetGridHelper.GetGridDetails(MarksheetGridHelper.PropertiesGridId);
            gradesetColumn     = propertiesGrid.FindElement(MarksheetConstants.GradesetColumn);
            gradesetColumnCell = gradesetColumn.FindElements(MarksheetConstants.ColumnCell);
            // Assert.AreEqual("MIST Grades", gradesetColumnCell[newi].Text);

            gradeDetailsLink = gradesetColumnCell[newi + 1].FindElement(By.TagName("button"));
            gradeDetailsLink.Click();
            MarksheetGridHelper.GradesetDetailsSelector("Marks 0 - 6");
            // marksheetBuilder.CheckMarksheetIsAvailable();
            marksheetBuilder.Save();
            marksheetBuilder.SaveMarksheetAssertionSuccess();

            //Navigate to Marksheet Data Entry and check the marksheet is displayed
            SeleniumHelper.NavigatebackToMenu("Tasks", "Assessment", "Marksheets");
            WaitForAndClick(BrowserDefaults.TimeOut, By.LinkText(MarksheetTemplateName + " - " + selectedGroups[0]));
            Thread.Sleep(3000);

            AdditionalColumns addcolumn = new AdditionalColumns();

            addcolumn.ClickAdditionalColumns();
            addcolumn.SelectClassAdditionalColumns();
            addcolumn.ClickOk();
            addcolumn.ClickMarksheeyColumns();
            Thread.Sleep(2000);
            return(this);
        }