|
|
@ -96,15 +96,35 @@ export class CellPageObject extends BasePage { |
|
|
|
|
|
|
|
|
|
|
|
async verify({ index, columnHeader, value }: CellProps & { value: string | string[] }) { |
|
|
|
async verify({ index, columnHeader, value }: CellProps & { value: string | string[] }) { |
|
|
|
const _verify = async text => { |
|
|
|
const _verify = async text => { |
|
|
|
await expect |
|
|
|
// await expect
|
|
|
|
.poll(async () => { |
|
|
|
// .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({ |
|
|
|
const innerTexts = await this.get({ |
|
|
|
index, |
|
|
|
index, |
|
|
|
columnHeader, |
|
|
|
columnHeader, |
|
|
|
}).allInnerTexts(); |
|
|
|
}).allInnerTexts(); |
|
|
|
return typeof innerTexts === 'string' ? [innerTexts] : innerTexts; |
|
|
|
const cellText = typeof innerTexts === 'string' ? [innerTexts] : innerTexts; |
|
|
|
}) |
|
|
|
|
|
|
|
.toContain(text); |
|
|
|
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)) { |
|
|
|
if (Array.isArray(value)) { |
|
|
|