Ejemplo n.º 1
0
        public void FindModalWindowAppearingOnDoubleClick()
        {
            ListViewRows rows = listView.Rows;

            rows[0].DoubleClick();
            CloseModal(window);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Конструктор с заполнением данных
 /// </summary>
 /// <param name="listViewsRows">Строки формы</param>
 public ReadDataCalc(ListViewRows listViewsRows)
 {
     item       = new List <RegistryLine>();
     cellsCount = listViewsRows[0].Cells.Count();
     product    = (ProductEnum)(cellsCount == 17 || cellsCount == 24 ? cellsCount : 0);
     AddItem(listViewsRows);
 }
Ejemplo n.º 3
0
        private void setCandidate(string candidateName)
        {
            ListView candidates = windowTools.GetListView(window, SearchCriteria.ByAutomationId("listView"));

            //ListView candidates = (ListView)window.Items[16];
            ListViewRows rows           = candidates.Rows;
            bool         candidateFound = false;

            foreach (ListViewRow row in rows)
            {
                if (row.Cells[0].Name == candidateName)
                {
                    row.Select();
                    row.DoubleClick();
                    candidateFound = true;
                    break;
                }
            }

            if (candidateFound == false)
            {
                rows[0].Select();
                rows[1].DoubleClick();
            }
        }
Ejemplo n.º 4
0
        public void SelectedRows()
        {
            listView.Rows[5].Select();
            listView.Rows[0].Select();
            ListViewRows rows = listView.SelectedRows;

            Assert.AreEqual(1, rows.Count);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Добавление данных
 /// </summary>
 /// <param name="listViewsRows"></param>
 public void AddItem(ListViewRows listViewsRows)
 {
     for (int i = 0; i < listViewsRows.Count(); i++)
     {
         var RegistryLine = new RegistryLine()
         {
             NumDog        = listViewsRows[i].Cells[1].Text
             , DateDog     = listViewsRows[i].Cells[2].Text
             , Division    = listViewsRows[i].Cells[3].Text
             , NSICode     = listViewsRows[i].Cells[4].Text
             , Strah       = listViewsRows[i].Cells[5].Text
             , SaleChannel = listViewsRows[i].Cells[6].Text
             , VidSatrah   = listViewsRows[i].Cells[7].Text
             , StrSumm     = listViewsRows[i].Cells[8].Text
             , KT          = product == ProductEnum.DS ? (listViewsRows[i].Cells[9].Text.Replace(",", ".") != ""?
                                                          listViewsRows[i].Cells[9].Text.Replace(",", "."): null) :
                             null
             , Power = product == ProductEnum.DS ? listViewsRows[i].Cells[10].Text.Replace(",", ".") :
                       null
             , TypeTS = product == ProductEnum.DS ? listViewsRows[i].Cells[11].Text :
                        null
             , CelIspolzovania = product == ProductEnum.DS ? listViewsRows[i].Cells[12].Text :
                                 null
             , KBC = product == ProductEnum.DS ? listViewsRows[i].Cells[13].Text.Replace(",", ".") :
                     null
             , VozrastTS = product == ProductEnum.DS ? listViewsRows[i].Cells[14].Text :
                           null
             , VozrastLica = product == ProductEnum.DS ?  listViewsRows[i].Cells[15].Text:
                             null
             , PlatehzDoc = product == ProductEnum.KaskoOpoZv ? listViewsRows[i].Cells[9].Text :
                            product == ProductEnum.DS ? listViewsRows[i].Cells[16].Text :
                            null
             , Vznos = product == ProductEnum.KaskoOpoZv ? listViewsRows[i].Cells[10].Text :
                       product == ProductEnum.DS ? listViewsRows[i].Cells[17].Text :
                       null
             , DataVznosa = product == ProductEnum.KaskoOpoZv ? listViewsRows[i].Cells[11].Text :
                            product == ProductEnum.DS ? listViewsRows[i].Cells[18].Text :
                            null
             , KV = product == ProductEnum.KaskoOpoZv ? listViewsRows[i].Cells[12].Text :
                    product == ProductEnum.DS ? listViewsRows[i].Cells[19].Text :
                    null
             , MaxKV = product == ProductEnum.KaskoOpoZv ? listViewsRows[i].Cells[13].Text :
                       product == ProductEnum.DS ? listViewsRows[i].Cells[20].Text :
                       null
             , Stavka = product == ProductEnum.KaskoOpoZv ? listViewsRows[i].Cells[14].Text :
                        product == ProductEnum.DS ? listViewsRows[i].Cells[21].Text :
                        null
             , Summ = product == ProductEnum.KaskoOpoZv ? listViewsRows[i].Cells[15].Text :
                      product == ProductEnum.DS ? listViewsRows[i].Cells[22].Text :
                      null
             , Primachanie = product == ProductEnum.KaskoOpoZv ? listViewsRows[i].Cells[16].Text :
                             product == ProductEnum.DS ? listViewsRows[i].Cells[23].Text :
                             null
         };
         item.Add(RegistryLine);
     }
 }
Ejemplo n.º 6
0
        public void Select()
        {
            ListView listView = window.Get <ListView>("listViewForScenarioTest");

            listView.Select("", "foo");
            ListViewRows rows = listView.SelectedRows;

            Assert.AreEqual(1, rows.Count);
            Assert.AreEqual("foo", rows[0].Cells[0].Text);
        }
Ejemplo n.º 7
0
 void SelectedRows()
 {
     using (var window = StartScenario("OpenListView", "ListViewWindow"))
     {
         var listView = window.Get <ListView>("ListView");
         listView.Rows[2].Select();
         listView.Rows[0].Select();
         ListViewRows rows = listView.SelectedRows;
         Assert.Equal(1, rows.Count);
     }
 }
Ejemplo n.º 8
0
        private ListViewRows GetGridRows(ListView Grid)
        {
            ListViewRows Collection = Grid.Rows;

            do
            {
                Grid.ScrollBars.Vertical.ScrollDown();

                Collection.AddRange(Grid.Rows);
            } while (Grid.ScrollBars.Vertical.Value < Grid.ScrollBars.Vertical.MaximumValue);

            return(Collection);
        }
Ejemplo n.º 9
0
        private void SelectBatchFromList(string batchName, ListView listview)
        {
            logger.LogInfo($"Trying to select batch {batchName}");
            ListViewRows rows = listview.Rows;

            /*foreach (var listViewRow in rows)
             * {
             * logger.LogInfo($"Row found {listViewRow.Cells[0].Name}");
             * }*/

            ListViewRow row = rows.First(r => r.Cells[0].Name.Equals(batchName));

            logger.LogInfo($"Selecting Batch with name: {row.Cells[0].Name}");
            row.Select();
        }
Ejemplo n.º 10
0
        public void ThenThatGridHasRows(int numberOfRows)
        {
            ListViewRows rows = null;
            // try for 3 seconds to get what we're looking for
            var retryNumber = 0;

            Retry.For(() =>
            {
                Console.WriteLine("Looking for # of grid rows try # {0}",
                                  retryNumber++);
                Context.MostRecentElementLocateAction();
                // seems like Grid.Rows is replaced once it's populated, so keep refreshing
                rows = Context.Grid.Rows;
                Console.WriteLine("Current row count {0}, expected row count {1}",
                                  rows.Count,
                                  numberOfRows);
                return(rows.Count == numberOfRows);
            },
                      NumberOfRetrySeconds);
            rows
            .Should()
            .HaveCount(numberOfRows);
        }
Ejemplo n.º 11
0
        ListViewRow GetRowFromIndex(int gridRow)
        {
            var          grid         = Context.Grid;
            ListViewRows listViewRows = null;
            // try for 3 seconds to get what we're looking for
            var retryNumber = 0;

            Retry.For(() =>
            {
                Console.WriteLine("Looking for grid row try # {0}",
                                  retryNumber++);
                // seems like Grid.Rows is replaced once it's populated, so keep refreshing
                listViewRows = grid.Rows;
                return(gridRow < listViewRows.Count);
            },
                      NumberOfRetrySeconds);
            gridRow
            .Should()
            .BeLessThan(listViewRows.Count,
                        "The index of the item you are trying to access should be at less than the total row count of the grid");
            var row = listViewRows[gridRow];

            return(row);
        }