mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.9 KiB
73 lines
1.9 KiB
import { test } from '@playwright/test'; |
|
import { DashboardPage } from '../pages/Dashboard'; |
|
import setup from '../setup'; |
|
import { GridPage } from '../pages/Dashboard/Grid'; |
|
|
|
test.describe('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 and deleting geo data column', async () => { |
|
// close 'Team & Auth' tab |
|
await dashboard.closeTab({ title: 'Team & Auth' }); |
|
|
|
await dashboard.treeView.openTable({ title: 'City' }); |
|
|
|
await dashboard.viewSidebar.activateGeoDataEasterEgg(); |
|
|
|
await grid.column.create({ |
|
title: 'GeoData1', |
|
type: 'GeoData', |
|
}); |
|
|
|
await grid.column.verify({ title: 'GeoData1', isVisible: true }); |
|
|
|
await grid.cell.geoData.openSetLocation({ |
|
index: 0, |
|
columnHeader: 'GeoData1', |
|
}); |
|
await grid.cell.geoData.enterLatLong({ |
|
lat: '50.4501', |
|
long: '30.5234', |
|
}); |
|
await grid.cell.geoData.clickSave(); |
|
|
|
await grid.cell.verifyGeoDataCell({ |
|
index: 0, |
|
columnHeader: 'GeoData1', |
|
lat: '50.4501000', |
|
long: '30.5234000', |
|
}); |
|
|
|
// Trying to change to value that is not valid |
|
await grid.cell.geoData.openLatLngSet({ |
|
index: 0, |
|
columnHeader: 'GeoData1', |
|
}); |
|
await grid.cell.geoData.enterLatLong({ |
|
lat: '543210.4501', |
|
long: '30.5234', |
|
}); |
|
await grid.cell.geoData.clickSave(); |
|
|
|
// value should not be changed |
|
await grid.cell.verifyGeoDataCell({ |
|
index: 0, |
|
columnHeader: 'GeoData1', |
|
lat: '50.4501000', |
|
long: '30.5234000', |
|
}); |
|
|
|
await grid.column.delete({ title: 'GeoData1' }); |
|
await grid.column.verify({ title: 'GeoData1', isVisible: false }); |
|
|
|
await dashboard.closeTab({ title: 'City' }); |
|
}); |
|
});
|
|
|