Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
const tableCount = await spec.pageObject.getTableTotalCount();
await expect(dashCount).toBe(
tableCount,
- `Text of card ${spec.cardName} and regex ${spec.regexMatcher} resulted in ${dashCount} ` +
+ `Text of card "${spec.cardName}" and regex "${spec.regexMatcher}" resulted in ${dashCount} ` +
`but did not match table count ${tableCount}`
);
}
}
async getTableTotalCount(): Promise<number> {
- return Number(
- (await $$('.datatable-footer-inner .page-count span')
- .filter(async (e) => (await e.getText()).includes('total'))
- .first()
- .getText()).match(/.*(\d+\s+)total.*/)[1]
- );
+ const text = await $$('.datatable-footer-inner .page-count span')
+ .filter(async (e) => (await e.getText()).includes('total'))
+ .first()
+ .getText();
+ return Number(text.match(/(\d+)\s+total/)[1]);
}
getTableCell(content: string): ElementFinder {