Hi all,
I want to check if some row within a table (array of rows) contains some text.
If I use the expect API - it will fail on the first not matching result.
I created a custom method as can be seen below and I use a regular JS forEach() function. Is any other solution that I missed? Orr if there is no one - is it possible to create it?
public async validateItemOnGrid(item: string) {
await this.searchWithQuickSearchField(item);
const gridRows = await this.page.$$('[data-uitestingname="body.Grid"] [data-uitestingname^="body.Grid.Row."] >> visible=true');
for (let gridRow of gridRows) {
const rowText = await gridRow.innerText();
console.log(rowText);
if (rowText.includes(item)) {
await gridRow.click();
await this.validator.validateContainText(rowText, item)
return;
}
}
}
Hi all,
I want to check if some row within a table (array of rows) contains some text.
If I use the expect API - it will fail on the first not matching result.
I created a custom method as can be seen below and I use a regular JS forEach() function. Is any other solution that I missed? Orr if there is no one - is it possible to create it?