|
|
@ -48,15 +48,21 @@ export class AttachmentCellPageObject extends BasePage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async verifyFileCount({ index, columnHeader, count }: { index: number; columnHeader: string; count: number }) { |
|
|
|
async verifyFileCount({ index, columnHeader, count }: { index: number; columnHeader: string; count: number }) { |
|
|
|
const attachments = await this.get({ index, columnHeader }).locator( |
|
|
|
// retry below logic for 5 times, with 1 second delay
|
|
|
|
'.nc-cell > .nc-attachment-cell > .flex > .nc-attachment' |
|
|
|
let retryCount = 0; |
|
|
|
); |
|
|
|
while (retryCount < 5) { |
|
|
|
|
|
|
|
const attachments = await this.get({ index, columnHeader }).locator('.nc-attachment'); |
|
|
|
console.log(await attachments.count()); |
|
|
|
console.log(await attachments.count()); |
|
|
|
expect(await attachments.count()).toBe(count); |
|
|
|
if ((await attachments.count()) === count) { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
retryCount++; |
|
|
|
|
|
|
|
await this.rootPage.waitForTimeout(1000); |
|
|
|
|
|
|
|
|
|
|
|
// attachments should be of count 'count'
|
|
|
|
if (retryCount === 5) { |
|
|
|
// await expect(await attachments.count()).toBe(count);
|
|
|
|
expect(await attachments.count()).toBe(count); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async expandModalClose() { |
|
|
|
async expandModalClose() { |
|
|
|