private void NavigateToGridInitialPage(KendoGrid kendoGrid, int initialPageNumber) { var gridFilterPage = new GridFilterPage(_driver); gridFilterPage.NavigateTo(); kendoGrid.Filter(ShipNameColumnName, FilterOperator.EqualTo, _uniqueShippingName); kendoGrid.ChangePageSize(1); WaitForGridToLoad(1, kendoGrid); kendoGrid.NavigateToPage(initialPageNumber); WaitForPageToLoad(initialPageNumber, kendoGrid); AssertPagerInfoLabel(gridFilterPage, initialPageNumber, initialPageNumber, _testPagingItems.Count); }
public void NextMorePageButtonDisabled_WhenLastPageIsLoaded() { var kendoGrid = new KendoGrid(_driver, _driver.FindElement(By.Id("grid"))); InitializeInvoicesForPaging(); NavigateToGridInitialPage(kendoGrid, 1); var targetPage = 11; var gridFilterPage = new GridFilterPage(_driver); gridFilterPage.GoToLastPage.Click(); WaitForPageToLoad(targetPage, kendoGrid); Assert.IsFalse(gridFilterPage.PreviousMorePages.Enabled); }
public void GoToNextPageButtonDisabled_WhenLastPageIsLoaded() { var kendoGrid = new KendoGrid(this.driver, this.driver.FindElement(By.Id("grid"))); this.InitializeInvoicesForPaging(); this.NavigateToGridInitialPage(kendoGrid, 1); int targetPage = 11; GridFilterPage gridFilterPage = new GridFilterPage(this.driver); gridFilterPage.GoToLastPage.Click(); this.WaitForPageToLoad(targetPage, kendoGrid); Assert.IsFalse(gridFilterPage.GoToNextPage.Enabled); }
public void PreviousMorePagesButtonDisabled_WhenFirstPageIsLoaded() { var kendoGrid = new KendoGrid(this.driver, this.driver.FindElement(By.Id("grid"))); this.InitializeInvoicesForPaging(); this.NavigateToGridInitialPage(kendoGrid, 11); int targetPage = 1; GridFilterPage gridFilterPage = new GridFilterPage(this.driver); gridFilterPage.GoToFirstPageButton.Click(); this.WaitForPageToLoad(targetPage, kendoGrid); Assert.IsFalse(gridFilterPage.PreviousMorePages.Displayed); }
public void NavigateToPageNine_GoToPreviousPageButton() { var kendoGrid = new KendoGrid(_driver, _driver.FindElement(By.Id("grid"))); InitializeInvoicesForPaging(); NavigateToGridInitialPage(kendoGrid, 11); var targetPage = 10; var gridFilterPage = new GridFilterPage(_driver); gridFilterPage.GoToPreviousPage.Click(); WaitForPageToLoad(targetPage, kendoGrid); var results = kendoGrid.GetItems <Order>(); Assert.AreEqual(_testPagingItems[targetPage - 1].OrderId, results.First().OrderId); AssertPagerInfoLabel(gridFilterPage, targetPage, targetPage, _testPagingItems.Count()); }
public void NavigateToPageOne_MorePagesPreviousButton() { var kendoGrid = new KendoGrid(this.driver, this.driver.FindElement(By.Id("grid"))); this.InitializeInvoicesForPaging(); this.NavigateToGridInitialPage(kendoGrid, 11); int targetPage = 1; GridFilterPage gridFilterPage = new GridFilterPage(this.driver); gridFilterPage.PreviousMorePages.Click(); this.WaitForPageToLoad(targetPage, kendoGrid); var results = kendoGrid.GetItems <Order>(); Assert.AreEqual(this.testPagingItems[targetPage - 1].OrderId, results.First().OrderId); this.AssertPagerInfoLabel(gridFilterPage, targetPage, targetPage, this.testPagingItems.Count()); }
private void AssertPagerInfoLabel(GridFilterPage page, int startItems, int endItems, int totalItems) { var expectedLabel = string.Format("{0} - {1} of {2} items", startItems, endItems, totalItems); Assert.AreEqual(expectedLabel, page.PagerInfoLabel.Text); }