Browse Source

tests: update attachments tests

pull/8990/head
DarkPhoenix2704 4 months ago
parent
commit
1be7d6a6da
No known key found for this signature in database
GPG Key ID: 3F76B10622A07849
  1. 17
      tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts
  2. 2
      tests/playwright/tests/db/views/viewForm.spec.ts

17
tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts

@ -52,9 +52,22 @@ export class AttachmentCellPageObject extends BasePage {
await this.rootPage.waitForTimeout(750);
}
async removeFile({ attIndex, index, columnHeader }: { attIndex: number; index?: number; columnHeader: string }) {
async removeFile({
attIndex,
index,
columnHeader,
skipElemClick,
}: {
attIndex: number;
index?: number;
columnHeader: string;
skipElemClick?: boolean;
}) {
await this.get({ index, columnHeader }).scrollIntoViewIfNeeded();
await this.get({ index, columnHeader }).click({ position: { x: 1, y: 1 } });
if (!skipElemClick) {
await this.get({ index, columnHeader }).click({ position: { x: 1, y: 1 } });
}
await this.get({ index, columnHeader }).locator('.nc-attachment-item').nth(attIndex).hover();
await this.get({ index, columnHeader })

2
tests/playwright/tests/db/views/viewForm.spec.ts

@ -1366,6 +1366,7 @@ test.describe('Form view: field validation', () => {
await sharedForm.cell.attachment.removeFile({
columnHeader: 'Attachment',
attIndex: 0,
skipElemClick: true,
});
await sharedForm.cell.attachment.addFile({
@ -1414,6 +1415,7 @@ test.describe('Form view: field validation', () => {
await surveyForm.cell.attachment.removeFile({
columnHeader: 'Attachment',
attIndex: 0,
skipElemClick: true,
});
await surveyForm.cell.attachment.addFile({

Loading…
Cancel
Save