2023-09-08 10:51:59 -05:00
|
|
|
import { e2e } from '../utils';
|
2022-08-25 16:34:24 -05:00
|
|
|
|
|
|
|
const DASHBOARD_ID = 'P2jR04WVk';
|
|
|
|
|
2023-09-13 07:24:20 -05:00
|
|
|
describe('Geomap spatial operations', () => {
|
|
|
|
beforeEach(() => {
|
2023-09-27 05:33:00 -05:00
|
|
|
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Tests location auto option', () => {
|
2022-08-25 16:34:24 -05:00
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
2023-10-04 14:24:21 -05:00
|
|
|
e2e.components.Tab.title('Transform data').should('be.visible').click();
|
2022-08-25 16:34:24 -05:00
|
|
|
|
|
|
|
e2e.components.TransformTab.newTransform('Spatial operations').scrollIntoView().should('be.visible').click();
|
|
|
|
e2e.components.Transforms.SpatialOperations.actionLabel().type('Prepare spatial field{enter}');
|
|
|
|
e2e.components.Transforms.SpatialOperations.locationLabel().should('be.visible');
|
2023-09-21 14:06:56 -05:00
|
|
|
e2e.components.Transforms.SpatialOperations.locationLabel().type('Auto{enter}');
|
2022-08-25 16:34:24 -05:00
|
|
|
|
|
|
|
e2e.components.PanelEditor.toggleTableView().click({ force: true });
|
|
|
|
e2e.components.Panels.Visualization.Table.header()
|
|
|
|
.should('be.visible')
|
|
|
|
.within(() => {
|
|
|
|
cy.contains('Point').should('be.visible');
|
|
|
|
});
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
2022-08-25 16:34:24 -05:00
|
|
|
|
2023-09-13 07:24:20 -05:00
|
|
|
it('Tests location coords option', () => {
|
2022-08-25 16:34:24 -05:00
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
2023-10-04 14:24:21 -05:00
|
|
|
e2e.components.Tab.title('Transform data').should('be.visible').click();
|
2022-08-25 16:34:24 -05:00
|
|
|
|
|
|
|
e2e.components.TransformTab.newTransform('Spatial operations').scrollIntoView().should('be.visible').click();
|
|
|
|
e2e.components.Transforms.SpatialOperations.actionLabel().type('Prepare spatial field{enter}');
|
|
|
|
e2e.components.Transforms.SpatialOperations.locationLabel().should('be.visible');
|
2023-09-21 14:06:56 -05:00
|
|
|
e2e.components.Transforms.SpatialOperations.locationLabel().type('Coords{enter}');
|
2022-08-25 16:34:24 -05:00
|
|
|
|
|
|
|
e2e.components.Transforms.SpatialOperations.location.coords.latitudeFieldLabel().should('be.visible');
|
|
|
|
e2e.components.Transforms.SpatialOperations.location.coords.latitudeFieldLabel().type('Lat{enter}');
|
|
|
|
|
|
|
|
e2e.components.Transforms.SpatialOperations.location.coords.longitudeFieldLabel().should('be.visible');
|
|
|
|
e2e.components.Transforms.SpatialOperations.location.coords.longitudeFieldLabel().type('Lng{enter}');
|
|
|
|
|
|
|
|
e2e.components.PanelEditor.toggleTableView().click({ force: true });
|
|
|
|
e2e.components.Panels.Visualization.Table.header()
|
|
|
|
.should('be.visible')
|
|
|
|
.within(() => {
|
|
|
|
cy.contains('Point').should('be.visible');
|
|
|
|
});
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
2022-08-25 16:34:24 -05:00
|
|
|
|
2023-09-13 07:24:20 -05:00
|
|
|
it('Tests geoshash field column appears in table view', () => {
|
2022-08-25 16:34:24 -05:00
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
2023-10-04 14:24:21 -05:00
|
|
|
e2e.components.Tab.title('Transform data').should('be.visible').click();
|
2022-08-25 16:34:24 -05:00
|
|
|
|
|
|
|
e2e.components.TransformTab.newTransform('Spatial operations').scrollIntoView().should('be.visible').click();
|
|
|
|
e2e.components.Transforms.SpatialOperations.actionLabel().type('Prepare spatial field{enter}');
|
|
|
|
e2e.components.Transforms.SpatialOperations.locationLabel().should('be.visible');
|
2023-09-21 14:06:56 -05:00
|
|
|
e2e.components.Transforms.SpatialOperations.locationLabel().type('Geohash{enter}');
|
|
|
|
|
2022-08-25 16:34:24 -05:00
|
|
|
e2e.components.Transforms.SpatialOperations.location.geohash
|
|
|
|
.geohashFieldLabel()
|
|
|
|
.should('be.visible')
|
|
|
|
.type('State{enter}');
|
|
|
|
|
|
|
|
e2e.components.PanelEditor.toggleTableView().click({ force: true });
|
|
|
|
e2e.components.Panels.Visualization.Table.header()
|
|
|
|
.should('be.visible')
|
|
|
|
.within(() => {
|
|
|
|
cy.contains('State 1').should('be.visible');
|
|
|
|
});
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
2022-08-25 16:34:24 -05:00
|
|
|
|
2023-09-13 07:24:20 -05:00
|
|
|
it('Tests location lookup option', () => {
|
2022-08-25 16:34:24 -05:00
|
|
|
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
|
2023-10-04 14:24:21 -05:00
|
|
|
e2e.components.Tab.title('Transform data').should('be.visible').click();
|
2022-08-25 16:34:24 -05:00
|
|
|
|
|
|
|
e2e.components.TransformTab.newTransform('Spatial operations').scrollIntoView().should('be.visible').click();
|
|
|
|
e2e.components.Transforms.SpatialOperations.actionLabel().type('Prepare spatial field{enter}');
|
|
|
|
e2e.components.Transforms.SpatialOperations.locationLabel().should('be.visible');
|
2023-09-21 14:06:56 -05:00
|
|
|
e2e.components.Transforms.SpatialOperations.locationLabel().type('Lookup{enter}');
|
2022-08-25 16:34:24 -05:00
|
|
|
|
|
|
|
e2e.components.Transforms.SpatialOperations.location.lookup.lookupFieldLabel().should('be.visible');
|
|
|
|
e2e.components.Transforms.SpatialOperations.location.lookup.lookupFieldLabel().type('State{enter}');
|
|
|
|
|
|
|
|
e2e.components.Transforms.SpatialOperations.location.lookup.gazetteerFieldLabel().should('be.visible');
|
|
|
|
e2e.components.Transforms.SpatialOperations.location.lookup.gazetteerFieldLabel().type('USA States{enter}');
|
|
|
|
|
|
|
|
e2e.components.PanelEditor.toggleTableView().click({ force: true });
|
|
|
|
e2e.components.Panels.Visualization.Table.header()
|
|
|
|
.should('be.visible')
|
|
|
|
.within(() => {
|
|
|
|
cy.contains('Geometry').should('be.visible');
|
|
|
|
});
|
2023-09-13 07:24:20 -05:00
|
|
|
});
|
2022-08-25 16:34:24 -05:00
|
|
|
});
|