Esempio n. 1
0
        /// <summary>
        /// edit row
        /// </summary>
        /// <returns>ConfigRow</returns>
        public ConfigRow EditRow()
        {
            ConfigRow configRow = FindRow();

            configRow.SelectAddEditElement();
            return(configRow);
        }
Esempio n. 2
0
        /// <summary>
        /// delete row
        /// </summary>
        public void DeleteRow()
        {
            ConfigRow configRow = EditRow();

            this.DriverCommands.WaitAndMeasurePageLoadTime();
            InitElements();

            configRow = FindRow();
            configRow.SelectDelete();
            this.DriverCommands.WaitAndMeasurePageLoadTime();
            InitElements();
        }
Esempio n. 3
0
        /// <summary>
        /// update row
        /// </summary>
        public void UpdateRow()
        {
            ConfigRow configRow = EditRow();

            this.DriverCommands.WaitAndMeasurePageLoadTime();
            InitElements();

            configRow = FindRow();
            configRow.SetValue(Data.Value);
            configRow.SelectUpdate();
            this.DriverCommands.WaitAndMeasurePageLoadTime();
            InitElements();
        }
        /// <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 ConfigRow(gridCssSelector, webElement, rowIndex, rowType, ColumnList, ControlPrefix);
                RowList.Add(lineItem);
                rowIndex++;
            }
        }
Esempio n. 5
0
        /// <summary>
        /// add row
        /// </summary>
        /// <returns>ConfigRow</returns>
        public ConfigRow AddRow()
        {
            ConfigRow        configRow = null;
            List <SNGridRow> list      = this.Grid.GetRowList();

            foreach (var row in list)
            {
                if (row.Type == GridRowType.Header)
                {
                    configRow = (ConfigRow)row;
                    configRow.SelectAddEditElement();
                    break;
                }
            }
            return(configRow);
        }
        /// <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 <ConfigRow> GetsRowsContainingTextToFindFromList(string columnName, string textToFind)
        {
            if (RowList.Count == 0)
            {
                Assert.Fail("No items were found in the grid column list.");
                return(null);
            }
            else
            {
                List <ConfigRow> rowList = new List <ConfigRow>();
                string           text    = null;
                int index = 0;
                foreach (var row in RowList)
                {
                    ConfigRow configRow = (ConfigRow)row;
                    if (configRow.Type != GridRowType.Header && configRow.Type != GridRowType.Pagination)
                    {
                        //get the text by column name
                        if (columnName.Equals(ConfigColumnnNames.Name))
                        {
                            text = configRow.GetName();
                        }
                        if (columnName.Equals(ConfigColumnnNames.Value))
                        {
                            text = configRow.GetValue();
                        }

                        //if the text is not null
                        if (text != null)
                        {
                            //if the text contains the text to find
                            if (text.Contains(textToFind))
                            {
                                rowList.Add(configRow);
                            }
                        }
                    }
                }
                //may return empty row list if text is not found
                return(rowList);
            }
        }