Browse Source

fix test failures of columnGeoData.spec.ts

pull/4749/head
flisowna 2 years ago
parent
commit
8ab6fab008
  1. 6
      tests/playwright/pages/Dashboard/common/Cell/GeoDataCell.ts
  2. 2
      tests/playwright/pages/Dashboard/common/Cell/index.ts
  3. 4
      tests/playwright/tests/columnGeoData.spec.ts

6
tests/playwright/pages/Dashboard/common/Cell/GeoDataCell.ts

@ -13,10 +13,14 @@ export class GeoDataCellPageObject extends BasePage {
return this.cell.get({ index, columnHeader }); return this.cell.get({ index, columnHeader });
} }
async open({ index, columnHeader }: { index: number; columnHeader: string }) { async openSetLocation({ index, columnHeader }: { index: number; columnHeader: string }) {
await this.cell.get({ index, columnHeader }).locator(`[data-testid="nc-geo-data-set-location-button"]`).click(); await this.cell.get({ index, columnHeader }).locator(`[data-testid="nc-geo-data-set-location-button"]`).click();
} }
async openLatLngSet({ index, columnHeader }: { index: number; columnHeader: string }) {
await this.cell.get({ index, columnHeader }).locator(`[data-testid="nc-geo-data-latLong-set"]`).click();
}
async enterLatLong({ lat, long }: { lat: string; long: string }) { async enterLatLong({ lat, long }: { lat: string; long: string }) {
await this.rootPage.locator(`[data-testid="nc-geo-data-latitude"]`).fill(lat); await this.rootPage.locator(`[data-testid="nc-geo-data-latitude"]`).fill(lat);
await this.rootPage.locator(`[data-testid="nc-geo-data-longitude"]`).fill(long); await this.rootPage.locator(`[data-testid="nc-geo-data-longitude"]`).fill(long);

2
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -158,7 +158,7 @@ export class CellPageObject extends BasePage {
const cell = await this.get({ const cell = await this.get({
index, index,
columnHeader, columnHeader,
}).locator('button'); }).locator(`[data-testid="nc-geo-data-latLong-set"]`);
return await cell.textContent(); //.getAttribute('title'); return await cell.textContent(); //.getAttribute('title');
}) })
.toEqual(expectedValue); .toEqual(expectedValue);

4
tests/playwright/tests/columnGeoData.spec.ts

@ -29,7 +29,7 @@ test.describe('Geo Data column', () => {
await grid.column.verify({ title: 'GeoData1', isVisible: true }); await grid.column.verify({ title: 'GeoData1', isVisible: true });
await grid.cell.geoData.open({ await grid.cell.geoData.openSetLocation({
index: 0, index: 0,
columnHeader: 'GeoData1', columnHeader: 'GeoData1',
}); });
@ -47,7 +47,7 @@ test.describe('Geo Data column', () => {
}); });
// Trying to change to value that is not valid // Trying to change to value that is not valid
await grid.cell.geoData.open({ await grid.cell.geoData.openLatLngSet({
index: 0, index: 0,
columnHeader: 'GeoData1', columnHeader: 'GeoData1',
}); });

Loading…
Cancel
Save