mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
767df617c6
commit
190c626eb0
1 changed files with 0 additions and 122 deletions
|
@ -166,129 +166,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
expect(afterSaveMapBounds).to.not.be(undefined);
|
||||
});
|
||||
|
||||
/*
|
||||
** NOTE: Since we don't have a reliable way to know the zoom level, we can
|
||||
** check some data after we save the viz, then zoom in and check that the data
|
||||
** changed, then open the saved viz and check that it's back to the original data.
|
||||
*/
|
||||
it('should save with zoom level and load, take screenshot', async function () {
|
||||
|
||||
const expectedZoom5Data = [
|
||||
`- 9q5 91 { "lat": 34.2934322102855, "lon": -118.57068326651722 }`,
|
||||
`- 9qc 89 { "lat": 38.64546895785822, "lon": -121.59105236401383 }`,
|
||||
`- 9qh 74 { "lat": 34.18319454366291, "lon": -117.426273193009 }`,
|
||||
`- 9y7 73 { "lat": 35.87868071952197, "lon": -96.3330221912275 }`,
|
||||
`- 9ys 71 { "lat": 37.31065319536228, "lon": -94.82038319412567 }`,
|
||||
`- 9yn 71 { "lat": 34.57203017311617, "lon": -92.17198946946104 }`,
|
||||
`- 9q9 70 { "lat": 37.327310177098425, "lon": -121.70855726221842 }`,
|
||||
`- 9zv 65 { "lat": 44.39887339514322, "lon": -93.34879252386207 }`,
|
||||
`- 9yu 65 { "lat": 38.83211174621605, "lon": -94.76601768729205 }`,
|
||||
`- 9y6 64 { "lat": 35.743489960441366, "lon": -97.75019769280334 }`
|
||||
];
|
||||
|
||||
const expectedZoom6Data = [
|
||||
`- c20g 16 { "lat": 45.59211894578766, "lon": -122.47455075674225 }`,
|
||||
`- c28c 13 { "lat": 48.0181491561234, "lon": -122.43847891688347 }`,
|
||||
`- c40b 11 { "lat": 56.34347582997923, "lon": -133.61804031343624 }`,
|
||||
`- c2e5 11 { "lat": 48.46440218389034, "lon": -119.51805034652352 }`,
|
||||
`- c262 10 { "lat": 46.56816971953958, "lon": -120.5440594162792 }`,
|
||||
`- c23n 10 { "lat": 47.51524904742837, "lon": -122.26747375912964 }`,
|
||||
`- 9rw6 10 { "lat": 42.59157135151327, "lon": -114.79671782813966 }`,
|
||||
`- c2mq 9 { "lat": 47.547698873095214, "lon": -116.18850083090365 }`,
|
||||
`- c27x 9 { "lat": 47.753206375055015, "lon": -118.7438936624676 }`,
|
||||
`- c25p 9 { "lat": 46.30563497543335, "lon": -119.30418533273041 }`
|
||||
];
|
||||
const vizName1 = 'Visualization TileMap';
|
||||
|
||||
// For some reason the map bounds right after saving a tile map for the first time are slightly different
|
||||
// than when the map is opened from the landing page. This causes the data to be slightly different.
|
||||
// We should figure out why that is, but it doesn't actually affect the map the user views.
|
||||
// In order to get this test to pass we'll re-open the saved visualization from the landing page.
|
||||
await PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
|
||||
const firstMapBounds = await PageObjects.visualize.getMapBounds();
|
||||
|
||||
await PageObjects.visualize.openSpyPanel();
|
||||
await PageObjects.visualize.selectTableInSpyPaneSelect();
|
||||
const actualZoom5Data = await PageObjects.visualize.getDataTableData();
|
||||
compareTableData(expectedZoom5Data, actualZoom5Data.trim().split('\n'));
|
||||
|
||||
await PageObjects.visualize.closeSpyPanel();
|
||||
await PageObjects.visualize.clickMapZoomIn();
|
||||
await PageObjects.visualize.openSpyPanel();
|
||||
|
||||
const actualZoom6Data = await PageObjects.visualize.getDataTableData();
|
||||
compareTableData(expectedZoom6Data, actualZoom6Data.trim().split('\n'));
|
||||
|
||||
await PageObjects.visualize.closeSpyPanel();
|
||||
|
||||
await PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
await PageObjects.visualize.waitForVisualization();
|
||||
|
||||
const secondMapBounds = await PageObjects.visualize.getMapBounds();
|
||||
|
||||
expect(firstMapBounds.top_left.lat).to.equal(secondMapBounds.top_left.lat);
|
||||
expect(firstMapBounds.top_left.long).to.equal(secondMapBounds.top_left.long);
|
||||
expect(firstMapBounds.bottom_right.lat).to.equal(secondMapBounds.bottom_right.lat);
|
||||
expect(firstMapBounds.bottom_right.long).to.equal(secondMapBounds.bottom_right.long);
|
||||
|
||||
await PageObjects.visualize.openSpyPanel();
|
||||
|
||||
await PageObjects.visualize.selectTableInSpyPaneSelect();
|
||||
const actualReOpenedZoom5Data = await PageObjects.visualize.getDataTableData();
|
||||
compareTableData(expectedZoom5Data, actualReOpenedZoom5Data.trim().split('\n'));
|
||||
|
||||
await PageObjects.visualize.closeSpyPanel();
|
||||
});
|
||||
|
||||
it('should zoom in to level 10', function () {
|
||||
// 6
|
||||
return PageObjects.visualize.clickMapZoomIn()
|
||||
.then(function () {
|
||||
// 7
|
||||
return PageObjects.visualize.clickMapZoomIn();
|
||||
})
|
||||
.then(function () {
|
||||
// 8
|
||||
return PageObjects.visualize.clickMapZoomIn();
|
||||
})
|
||||
.then(function () {
|
||||
// 9
|
||||
return PageObjects.visualize.clickMapZoomIn();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMapZoomInEnabled()
|
||||
.then(function (enabled) {
|
||||
expect(enabled).to.be(true);
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.clickMapZoomIn();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.getMapZoomInEnabled();
|
||||
})
|
||||
// now we're at level 10 and zoom out should be disabled
|
||||
.then(function (enabled) {
|
||||
expect(enabled).to.be(false);
|
||||
});
|
||||
});
|
||||
|
||||
it('wms switch should change allow to zoom in further', async function () {
|
||||
await PageObjects.visualize.openSpyPanel();
|
||||
await PageObjects.visualize.clickOptions();
|
||||
await PageObjects.visualize.selectWMS();
|
||||
await PageObjects.visualize.clickGo();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.common.sleep(2000);
|
||||
let enabled = await PageObjects.visualize.getMapZoomInEnabled();
|
||||
expect(enabled).to.be(true);
|
||||
await PageObjects.visualize.clickMapZoomIn();
|
||||
enabled = await PageObjects.visualize.getMapZoomInEnabled();
|
||||
expect(enabled).to.be(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue