From fd74811639b589e5c189c205caf7b4345a95c987 Mon Sep 17 00:00:00 2001 From: cristinaj Date: Wed, 15 Jan 2020 15:44:40 +0200 Subject: [PATCH] =?UTF-8?q?[AAE-838]Add=20a=20method=20to=20wait=20until?= =?UTF-8?q?=20datatable=20contains=20less=20then=20a=20specific=20nr?= =?UTF-8?q?=E2=80=A6=20(#5370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add a method to wait until datatable contains less then a specific nr of rows. This could be useful for waiting for datatable to load when searching or filtering it * Moved the method to pagination page * Renamed the method --- lib/testing/src/lib/core/pages/pagination.page.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/testing/src/lib/core/pages/pagination.page.ts b/lib/testing/src/lib/core/pages/pagination.page.ts index 887e994583..917b277732 100644 --- a/lib/testing/src/lib/core/pages/pagination.page.ts +++ b/lib/testing/src/lib/core/pages/pagination.page.ts @@ -120,4 +120,17 @@ export class PaginationPage { const totalNumberOfFiles = await BrowserActions.getText(this.totalFiles); return totalNumberOfFiles.split('of ')[1]; } + + async getNumberOfAllRows(): Promise { + return +this.getTotalNumberOfFiles(); + } + + /* + * Wait until the total number of items is less then specified value + */ + async waitUntilNoOfItemsIsLessThenValue(expectedValue: number): Promise { + await BrowserVisibility.waitUntilElementIsVisible(this.totalFiles); + const condition = () => this.totalFiles.getText().then(value => value && +value.split('of ')[1] < expectedValue); + return browser.wait(condition, 10000); + } }