Browse Source

work on geo data column tests - WIP

pull/4749/head
Daniel Spaude 2 years ago
parent
commit
983298648a
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 10
      tests/playwright/pages/Dashboard/ViewSidebar/index.ts
  2. 57
      tests/playwright/tests/columnGeoData.spec.ts

10
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);

57
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',
// });
});
});
Loading…
Cancel
Save