[AAE-838]Add a method to wait until datatable contains less then a specific nr… (#5370)

* 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
This commit is contained in:
cristinaj
2020-01-15 15:44:40 +02:00
committed by Eugenio Romano
parent b931c4a85c
commit fd74811639

View File

@@ -120,4 +120,17 @@ export class PaginationPage {
const totalNumberOfFiles = await BrowserActions.getText(this.totalFiles); const totalNumberOfFiles = await BrowserActions.getText(this.totalFiles);
return totalNumberOfFiles.split('of ')[1]; return totalNumberOfFiles.split('of ')[1];
} }
async getNumberOfAllRows(): Promise<number> {
return +this.getTotalNumberOfFiles();
}
/*
* Wait until the total number of items is less then specified value
*/
async waitUntilNoOfItemsIsLessThenValue(expectedValue: number): Promise<any> {
await BrowserVisibility.waitUntilElementIsVisible(this.totalFiles);
const condition = () => this.totalFiles.getText().then(value => value && +value.split('of ')[1] < expectedValue);
return browser.wait(condition, 10000);
}
} }