Browse Source

fix: Fixed issue with test

pull/6499/head
Muhammed Mustafa 1 year ago
parent
commit
de8d70f39b
  1. 7
      tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts
  2. 3
      tests/playwright/pages/Dashboard/common/Cell/CheckboxCell.ts
  3. 6
      tests/playwright/tests/db/features/verticalFillHandle.spec.ts
  4. 2
      tests/playwright/tests/db/general/projectOperations.spec.ts

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

@ -27,7 +27,10 @@ export class AttachmentCellPageObject extends BasePage {
const attachFileAction = this.get({ index, columnHeader })
.locator('[data-testid="attachment-cell-file-picker-button"]')
.click();
return await this.attachFile({ filePickUIAction: attachFileAction, filePath });
await this.attachFile({ filePickUIAction: attachFileAction, filePath });
// wait for file to be uploaded
await this.rootPage.waitForTimeout(750);
}
async expandModalAddFile({ filePath }: { filePath: string[] }) {
@ -52,7 +55,7 @@ export class AttachmentCellPageObject extends BasePage {
async verifyFileCount({ index, columnHeader, count }: { index: number; columnHeader: string; count: number }) {
// retry below logic for 5 times, with 1 second delay
const attachments = this.get({ index, columnHeader }).locator('.nc-attachment');
await expect(await attachments).toHaveCount(count);
await expect(attachments).toHaveCount(count);
}
async expandModalClose() {

3
tests/playwright/pages/Dashboard/common/Cell/CheckboxCell.ts

@ -15,7 +15,8 @@ export class CheckboxCellPageObject extends BasePage {
}
async click({ index, columnHeader }: { index?: number; columnHeader: string }) {
return await this.get({ index, columnHeader }).locator('.nc-cell').click();
await this.get({ index, columnHeader }).locator('.nc-cell').click();
await this.rootPage.waitForTimeout(500);
}
// async isChecked({ index, columnHeader }: { index?: number; columnHeader: string }) {

6
tests/playwright/tests/db/features/verticalFillHandle.spec.ts

@ -162,7 +162,7 @@ test.describe('Fill Handle', () => {
await unsetup(p.context);
});
test('Select based', async () => {
test('Select based', async ({ page }) => {
const fields = [
{ title: 'SingleSelect', value: 'jan', type: 'singleSelect' },
{ title: 'MultiSelect', value: 'jan,feb,mar', type: 'multiSelect' },
@ -170,7 +170,7 @@ test.describe('Fill Handle', () => {
await dragDrop({ firstColumn: 'SingleSelect', lastColumn: 'MultiSelect', params: p });
await new Promise((r) => setTimeout(r, 500));
await page.waitForTimeout(1000);
// verify data on grid
const displayOptions = ['jan', 'feb', 'mar'];
@ -212,7 +212,7 @@ test.describe('Fill Handle', () => {
await unsetup(p.context);
});
test('Miscellaneous (Checkbox, attachment)', async () => {
test('Miscellaneous (Checkbox, attachment) @flaky', async () => {
const fields = [
{ title: 'Checkbox', value: 'true', type: 'checkbox' },
{ title: 'Attachment', value: `${process.cwd()}/fixtures/sampleFiles/1.json`, type: 'attachment' },

2
tests/playwright/tests/db/general/projectOperations.spec.ts

@ -11,7 +11,7 @@ test.describe('Project operations', () => {
let dashboard: DashboardPage;
let context: NcContext;
let api: Api<any>;
test.setTimeout(100000);
test.setTimeout(150000);
async function getProjectList(workspaceId?: string) {
let projectList: ProjectListType;

Loading…
Cancel
Save