Browse Source

test: eslint fix

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5018/head
Raju Udava 1 year ago
parent
commit
c21b8cc942
  1. 38
      tests/playwright/pages/Dashboard/common/Cell/index.ts

38
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -96,15 +96,35 @@ export class CellPageObject extends BasePage {
async verify({ index, columnHeader, value }: CellProps & { value: string | string[] }) {
const _verify = async text => {
await expect
.poll(async () => {
const innerTexts = await this.get({
index,
columnHeader,
}).allInnerTexts();
return typeof innerTexts === 'string' ? [innerTexts] : innerTexts;
})
.toContain(text);
// await expect
// .poll(async () => {
// const innerTexts = await this.get({
// index,
// columnHeader,
// }).allInnerTexts();
// return typeof innerTexts === 'string' ? [innerTexts] : innerTexts;
// })
// .toContain(text);
// retrieve text from cell
// loop for 5 seconds
// if text is found, return
// if text is not found, throw error
let count = 0;
while (count < 5) {
const innerTexts = await this.get({
index,
columnHeader,
}).allInnerTexts();
const cellText = typeof innerTexts === 'string' ? [innerTexts] : innerTexts;
if (cellText.includes(text) || cellText[0].includes(text)) {
return;
}
await this.rootPage.waitForTimeout(1000);
count++;
if (count === 5) throw new Error(`Cell text ${text} not found`);
}
};
if (Array.isArray(value)) {

Loading…
Cancel
Save