diff --git a/tests/playwright/pages/Dashboard/Grid/Column/index.ts b/tests/playwright/pages/Dashboard/Grid/Column/index.ts index 48107c7800..370ee2894d 100644 --- a/tests/playwright/pages/Dashboard/Grid/Column/index.ts +++ b/tests/playwright/pages/Dashboard/Grid/Column/index.ts @@ -34,7 +34,7 @@ export class ColumnPageObject extends BasePage { childColumn = '', relationType = '', rollupType = '', - format = '', + format, insertAfterColumnTitle, insertBeforeColumnTitle, }: { @@ -81,12 +81,14 @@ export class ColumnPageObject extends BasePage { }); break; case 'Duration': - await this.get().locator('.ant-select-single').nth(1).click(); - await this.rootPage - .locator(`.ant-select-item`, { - hasText: format, - }) - .click(); + if (format) { + await this.get().locator('.ant-select-single').nth(1).click(); + await this.rootPage + .locator(`.ant-select-item`, { + hasText: format, + }) + .click(); + } break; case 'Formula': await this.get().locator('.nc-formula-input').fill(formula); diff --git a/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts b/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts index e5ec9a7bc9..da8b44d9f7 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts @@ -14,6 +14,14 @@ export class RatingCellPageObject extends BasePage { return this.cell.get({ index, columnHeader }); } + async select({ index, columnHeader, rating }: { index?: number; columnHeader: string; rating: number }) { + await this.waitForResponse({ + uiAction: this.get({ index, columnHeader }).locator('.ant-rate-star > div').nth(rating).click(), + httpMethodsToMatch: ['POST', 'PATCH'], + requestUrlPathToMatch: 'api/v1/db/data/noco/', + }); + } + async verify({ index, columnHeader, rating }: { index?: number; columnHeader: string; rating: number }) { await expect(await this.get({ index, columnHeader }).locator(`div[role="radio"][aria-checked="true"]`)).toHaveCount( rating diff --git a/tests/playwright/tests/keyboardShortcuts.spec.ts b/tests/playwright/tests/keyboardShortcuts.spec.ts index d9af966294..d9de119030 100644 --- a/tests/playwright/tests/keyboardShortcuts.spec.ts +++ b/tests/playwright/tests/keyboardShortcuts.spec.ts @@ -140,6 +140,18 @@ test.describe('Verify shortcuts', () => { title: 'Percent', type: 'Percent', }); + await dashboard.grid.column.create({ + title: 'Currency', + type: 'Currency', + }); + await dashboard.grid.column.create({ + title: 'Duration', + type: 'Duration', + }); + await dashboard.grid.column.create({ + title: 'Rating', + type: 'Rating', + }); await dashboard.grid.column.create({ title: 'SingleSelect', type: 'SingleSelect', @@ -258,6 +270,31 @@ test.describe('Verify shortcuts', () => { text: '80', }); + await dashboard.grid.cell.click({ + index: 0, + columnHeader: 'Currency', + }); + await dashboard.grid.cell.fillText({ + index: 0, + columnHeader: 'Currency', + text: '20', + }); + + await dashboard.grid.cell.click({ + index: 0, + columnHeader: 'Duration', + }); + await dashboard.grid.cell.fillText({ + index: 0, + columnHeader: 'Duration', + text: '0008', + }); + + await dashboard.grid.cell.rating.select({ + index: 0, + columnHeader: 'Rating', + rating: 3, + }); await dashboard.grid.cell.click({ index: 0, columnHeader: 'Checkbox', @@ -279,7 +316,7 @@ test.describe('Verify shortcuts', () => { filePath: `${process.cwd()}/fixtures/sampleFiles/1.json`, }); - // // ######################################## + // ######################################## await dashboard.grid.cell.copyToClipboard({ index: 0, @@ -354,6 +391,27 @@ test.describe('Verify shortcuts', () => { }); expect(await dashboard.grid.cell.getClipboardText()).toBe('80'); + await dashboard.grid.cell.copyToClipboard({ + index: 0, + columnHeader: 'Currency', + }); + expect(await dashboard.grid.cell.getClipboardText()).toBe('20'); + + await dashboard.grid.cell.copyToClipboard({ + index: 0, + columnHeader: 'Duration', + }); + expect(await dashboard.grid.cell.getClipboardText()).toBe('480'); + + await dashboard.grid.cell.copyToClipboard( + { + index: 0, + columnHeader: 'Rating', + }, + { position: { x: 1, y: 1 } } + ); + expect(await dashboard.grid.cell.getClipboardText()).toBe('4'); + await dashboard.grid.cell.copyToClipboard( { index: 0,