Esempio 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 ViewItemStatisticsRow(gridCssSelector, webElement, rowIndex, rowType, ColumnList, ControlPrefix);
                RowList.Add(lineItem);
                rowIndex++;
            }
        }
Esempio 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 ConfigRow</returns>
        public new List <ViewItemStatisticsRow> GetsRowsContainingTextToFindFromList(string columnName, string textToFind)
        {
            if (RowList.Count == 0)
            {
                Assert.Fail("No items were found in the grid column list.");
                return(null);
            }
            else
            {
                List <ViewItemStatisticsRow> rowList = new List <ViewItemStatisticsRow>();
                string text  = null;
                int    index = 0;
                foreach (var row in RowList)
                {
                    ViewItemStatisticsRow viewItemStatisticsRow = (ViewItemStatisticsRow)row;
                    if (viewItemStatisticsRow.Type != GridRowType.Header && viewItemStatisticsRow.Type != GridRowType.Pagination)
                    {
                        //get the text by column name
                        if (columnName.Equals(ViewItemStatisticsColumnNames.Items))
                        {
                            text = viewItemStatisticsRow.GetItems();
                        }
                        if (columnName.Equals(ViewItemStatisticsColumnNames.Content))
                        {
                            text = viewItemStatisticsRow.GetContent();
                        }

                        //if the text is not null
                        if (text != null)
                        {
                            //if the text contains the text to find
                            if (text.Contains(textToFind))
                            {
                                rowList.Add(viewItemStatisticsRow);
                            }
                        }
                    }
                }
                //may return empty row list if text is not found
                return(rowList);
            }
        }
        /// <summary>
        /// select the row by title
        /// </summary>
        /// <param name="title">the title</param>
        public void SelectRowByTitle(string title)
        {
            ViewItemStatisticsRow row = FindRowByTitle(title);

            row.SelectTitle();
        }