Browse Source

work on geo data column tests - WIP

pull/4749/head
Daniel Spaude 2 years ago
parent
commit
598e76c063
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 2
      packages/nc-gui/components/smartsheet/sidebar/toolbar/GeodataSwitcher.vue
  2. 24
      tests/playwright/pages/Dashboard/ViewSidebar/index.ts
  3. 14
      tests/playwright/tests/columnGeoData.spec.ts

2
packages/nc-gui/components/smartsheet/sidebar/toolbar/GeodataSwitcher.vue

@ -10,6 +10,6 @@ function toggleGeodataFeature() {
<template #title>
<span> Toggle GeoData </span>
</template>
<mdi-map-marker class="cursor-pointer" @click="toggleGeodataFeature" />
<mdi-map-marker class="cursor-pointer" data-testid="toggle-geodata-feature-icon" @click="toggleGeodataFeature" />
</a-tooltip>
</template>

24
tests/playwright/pages/Dashboard/ViewSidebar/index.ts

@ -36,13 +36,33 @@ export class ViewSidebarPage extends BasePage {
}
async activateGeoDataEasterEgg() {
await this.rootPage.pause();
if (await this.get().isVisible()) {
// await this.get().click();
await (await this.rootPage.$('.nc-toggle-right-navbar')).click();
}
await this.rootPage.pause();
await this.verifyVisibility({ isVisible: true });
await this.rootPage.pause();
await this.rootPage.pause();
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);
await this.rootPage.mouse.click(x + 10, y);
}
await this.rootPage.pause();
if (!(await this.get().isVisible())) {
// await this.get().click();
await (await this.rootPage.$('.nc-toggle-right-navbar')).click();
}
await this.rootPage.pause();
// await this.verifyVisibility({ isVisible: true });
await this.rootPage.pause();
await this.rootPage.getByTestId('toggle-geodata-feature-icon').click();
}
private async createView({ title, locator }: { title: string; locator: Locator }) {

14
tests/playwright/tests/columnGeoData.spec.ts

@ -29,19 +29,19 @@ test.describe.only('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 dashboard.viewSidebar.activateGeoDataEasterEgg();
// await grid.column.create({
// title: 'Geo Data 1',
// type: 'GeoData',
// });
await grid.column.create({
title: 'Geo Data 1',
type: 'GeoData',
});
expect(1 + 2).toBe(3);
await dashboard.rootPage.pause();
await dashboard.closeTab({ title: 'City' });
// await dashboard.treeView.openTable({ title: 'City' });

Loading…
Cancel
Save