|
|
|
@ -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 () => { |
|
|
|
|
// 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(); |
|
|
|
|
return typeof innerTexts === 'string' ? [innerTexts] : innerTexts; |
|
|
|
|
}) |
|
|
|
|
.toContain(text); |
|
|
|
|
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)) { |
|
|
|
|