diff --git a/tests/playwright/pages/Dashboard/ViewSidebar/index.ts b/tests/playwright/pages/Dashboard/ViewSidebar/index.ts index 5f9f45b55a..c1b53c221f 100644 --- a/tests/playwright/pages/Dashboard/ViewSidebar/index.ts +++ b/tests/playwright/pages/Dashboard/ViewSidebar/index.ts @@ -35,6 +35,16 @@ export class ViewSidebarPage extends BasePage { } } + async activateGeoDataEasterEgg() { + const element = await this.rootPage.$('.nc-active-btn'); + const { x, y } = await element.boundingBox(); + + // Click the element 5 times in a row + for (let i = 0; i < 5; i++) { + await this.rootPage.mouse.click(x + 50, y); + } + } + private async createView({ title, locator }: { title: string; locator: Locator }) { await locator.click(); await this.rootPage.locator('input[id="form_item_title"]:visible').fill(title); diff --git a/tests/playwright/tests/columnGeoData.spec.ts b/tests/playwright/tests/columnGeoData.spec.ts new file mode 100644 index 0000000000..1b7faff0fd --- /dev/null +++ b/tests/playwright/tests/columnGeoData.spec.ts @@ -0,0 +1,57 @@ +import { expect, test } from '@playwright/test'; +import { DashboardPage } from '../pages/Dashboard'; +import setup from '../setup'; +import { GridPage } from '../pages/Dashboard/Grid'; + +type ExpectedQrCodeData = { + referencedValue: string; + base64EncodedSrc: string; +}; + +test.describe.only('Geo Data column', () => { + let dashboard: DashboardPage; + let grid: GridPage; + let context: any; + + test.beforeEach(async ({ page }) => { + context = await setup({ page }); + dashboard = new DashboardPage(page, context.project); + grid = dashboard.grid; + }); + + test('creation, validation, use "My Location" and deleting geo data column', async () => { + // Write Playwright test that tests the following for the Geo Data column: + // - creation + // - validation + // - use "My Location" + // - deleting geo data column + + // close 'Team & Auth' tab + await dashboard.closeTab({ title: 'Team & Auth' }); + + await dashboard.viewSidebar.activateGeoDataEasterEgg(); + + await dashboard.treeView.openTable({ title: 'City' }); + + await dashboard.rootPage.pause(); + + // await grid.column.create({ + // title: 'Geo Data 1', + // type: 'GeoData', + // }); + + expect(1 + 2).toBe(3); + + await dashboard.closeTab({ title: 'City' }); + + // await dashboard.treeView.openTable({ title: 'City' }); + // await grid.column.create({ + // title: 'Geo Data', + // type: 'Geo Data', + // }); + // await grid.column.openEdit({ + // title: 'Geo Data', + // type: 'Geo Data', + // }); + }); +});