Exemplo n.º 1
0
        /// <summary>
        /// Sets the Rows List
        /// </summary>
        public override void SetRowLists()
        {
            base.SetRowLists();
            int rowIndex = 0;

            foreach (var webElement in WebElementRows)
            {
                Report.Write("GridRow by index: " + rowIndex);
                GridRowType rowType = GetGridRowType(rowIndex);
                Report.Write("GridRowType: " + rowType);
                var lineItem = new ViewPortalRecommendedTestResultsRow(gridCssSelector, webElement, rowIndex, rowType, ColumnList, ControlPrefix);
                RowList.Add(lineItem);
                rowIndex++;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// gets a list of rows containing the text to find from the row list
        /// </summary>
        /// <param name="columnName">the column name</param>
        /// <param name="textToFind">the text to find</param>
        /// <returns>list of ViewPortalRecommendedTestResultsRow</returns>
        public new List <ViewPortalRecommendedTestResultsRow> GetsRowsContainingTextToFindFromList(string columnName, string textToFind)
        {
            if (RowList.Count == 0)
            {
                Assert.Fail("No items were found in the search results column list.");
                return(null);
            }

            else
            {
                List <ViewPortalRecommendedTestResultsRow> viewPortalRecommendedTestResultsRowList = new List <ViewPortalRecommendedTestResultsRow>();
                string text  = null;
                int    index = 0;
                foreach (var row in RowList)
                {
                    ViewPortalRecommendedTestResultsRow viewPortalRecommendedTestResultsRow = (ViewPortalRecommendedTestResultsRow)row;

                    if (viewPortalRecommendedTestResultsRow.Type != GridRowType.Header && viewPortalRecommendedTestResultsRow.Type != GridRowType.Pagination)
                    {
                        //get the text by column name
                        if (columnName.Equals(ViewPortalRecommendedTestResultsColumnNames.TestName))
                        {
                            text = viewPortalRecommendedTestResultsRow.GetTestName();
                        }

                        if (columnName.Equals(ViewPortalRecommendedTestResultsColumnNames.TestCategory))
                        {
                            text = viewPortalRecommendedTestResultsRow.GetTestCategory();
                        }

                        if (columnName.Equals(ViewPortalRecommendedTestResultsColumnNames.Subject))
                        {
                            text = viewPortalRecommendedTestResultsRow.GetTestSubject();
                        }

                        if (columnName.Equals(ViewPortalRecommendedTestResultsColumnNames.GradeLevel))
                        {
                            text = viewPortalRecommendedTestResultsRow.GetTestGradeLevel();
                        }

                        if (columnName.Equals(ViewPortalRecommendedTestResultsColumnNames.StartDate))
                        {
                            text = viewPortalRecommendedTestResultsRow.GetTestStartDate();
                        }

                        if (columnName.Equals(ViewPortalRecommendedTestResultsColumnNames.EndDate))
                        {
                            text = viewPortalRecommendedTestResultsRow.GetTestEndDate();
                        }

                        if (columnName.Equals(ViewPortalRecommendedTestResultsColumnNames.ScoresDueDate))
                        {
                            text = viewPortalRecommendedTestResultsRow.GetTestScoresDueDate();
                        }

                        if (columnName.Equals(ViewPortalRecommendedTestResultsColumnNames.AssignmentStatus))
                        {
                            text = viewPortalRecommendedTestResultsRow.GetTestAssignmentStatus();
                        }

                        //if the text is not null
                        if (text != null)
                        {
                            //if the text contains the text to find
                            if (text.Contains(textToFind))
                            {
                                viewPortalRecommendedTestResultsRowList.Add(viewPortalRecommendedTestResultsRow);
                            }
                        }
                    }
                }

                //may return empty row list if text is not found
                return(viewPortalRecommendedTestResultsRowList);
            }
        }