mirror of https://github.com/nocodb/nocodb
Daniel Spaude
2 years ago
5 changed files with 82 additions and 5 deletions
@ -0,0 +1,47 @@ |
|||||||
|
import { CellPageObject } from '.'; |
||||||
|
import BasePage from '../../../Base'; |
||||||
|
|
||||||
|
export class GeoDataCellPageObject extends BasePage { |
||||||
|
readonly cell: CellPageObject; |
||||||
|
|
||||||
|
constructor(cell: CellPageObject) { |
||||||
|
super(cell.rootPage); |
||||||
|
this.cell = cell; |
||||||
|
} |
||||||
|
|
||||||
|
get({ index, columnHeader }: { index?: number; columnHeader: string }) { |
||||||
|
return this.cell.get({ index, columnHeader }); |
||||||
|
} |
||||||
|
|
||||||
|
async open({ index, columnHeader }: { index: number; columnHeader: string }) { |
||||||
|
// await this.rootPage.pause();
|
||||||
|
await this.cell.get({ index, columnHeader }).locator(`[data-testid="nc-geo-data-set-location-button"]`).click(); |
||||||
|
// await this.rootPage.pause();
|
||||||
|
// .dblclick({
|
||||||
|
// index,
|
||||||
|
// columnHeader,
|
||||||
|
// });
|
||||||
|
} |
||||||
|
|
||||||
|
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-longitude"]`).fill(long); |
||||||
|
} |
||||||
|
|
||||||
|
async clickSave() { |
||||||
|
await this.rootPage.locator(`[data-testid="nc-geo-data-save"]`).click(); |
||||||
|
} |
||||||
|
|
||||||
|
async selectDate({ |
||||||
|
// date in format `YYYY-MM-DD`
|
||||||
|
date, |
||||||
|
}: { |
||||||
|
date: string; |
||||||
|
}) { |
||||||
|
await this.rootPage.locator(`td[title="${date}"]`).click(); |
||||||
|
} |
||||||
|
|
||||||
|
async close() { |
||||||
|
await this.rootPage.keyboard.press('Escape'); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue