mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
Unskip and Fix maps x-pack functional test - ( sample data and layer_errors) and also added baseline images (#91205)
* fixes https://github.com/elastic/kibana/issues/74449 * unskip maps tests (#90323) * unskip maps tests * checking the baseline images * updated the test to move the mouse away and close the Legend * more changes to the test * reducing the threshold limit * updating the baseline images * added a comment about the baseline images * updating flights baseline image and adjusting threshold * updated threshold and baseline image for web log * session image of weblogsmap * skipping layer_errors test * skip the test - as it fails on cloud and windows on snapshot
This commit is contained in:
parent
53f4d4840b
commit
a96aa5e34e
6 changed files with 95 additions and 31 deletions
|
@ -101,7 +101,7 @@ export class EMSTMSSource extends AbstractTMSSource {
|
|||
return tmsService;
|
||||
}
|
||||
|
||||
throw new Error(getErrorInfo());
|
||||
throw new Error(getErrorInfo(emsTileLayerId));
|
||||
}
|
||||
|
||||
async getDisplayName() {
|
||||
|
|
|
@ -10,7 +10,6 @@ import expect from '@kbn/expect';
|
|||
export default function ({ getPageObjects }) {
|
||||
const PageObjects = getPageObjects(['maps', 'header']);
|
||||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/69617
|
||||
describe.skip('layer errors', () => {
|
||||
before(async () => {
|
||||
await PageObjects.maps.loadSavedMap('layer with errors');
|
||||
|
@ -66,14 +65,15 @@ export default function ({ getPageObjects }) {
|
|||
});
|
||||
});
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/36011
|
||||
describe.skip('EMSFileSource with missing EMS id', () => {
|
||||
describe('EMSFileSource with missing EMS id', () => {
|
||||
const MISSING_EMS_ID = 'idThatDoesNotExitForEMSFileSource';
|
||||
const LAYER_NAME = 'EMS_vector_shapes';
|
||||
|
||||
it('should diplay error message in layer panel', async () => {
|
||||
const errorMsg = await PageObjects.maps.getLayerErrorText(LAYER_NAME);
|
||||
expect(errorMsg).to.equal(`Unable to find EMS vector shapes for id: ${MISSING_EMS_ID}`);
|
||||
expect(errorMsg).to.equal(
|
||||
`Unable to find EMS vector shapes for id: ${MISSING_EMS_ID}. Kibana is unable to access Elastic Maps Service. Contact your system administrator.`
|
||||
);
|
||||
});
|
||||
|
||||
it('should allow deletion of layer', async () => {
|
||||
|
@ -87,10 +87,13 @@ export default function ({ getPageObjects }) {
|
|||
const MISSING_EMS_ID = 'idThatDoesNotExitForEMSTile';
|
||||
const LAYER_NAME = 'EMS_tiles';
|
||||
|
||||
it('should diplay error message in layer panel', async () => {
|
||||
// Flaky test on cloud and windows when run against a snapshot build of 7.11.
|
||||
// https://github.com/elastic/kibana/issues/91043
|
||||
|
||||
it.skip('should diplay error message in layer panel', async () => {
|
||||
const errorMsg = await PageObjects.maps.getLayerErrorText(LAYER_NAME);
|
||||
expect(errorMsg).to.equal(
|
||||
`Unable to find EMS tile configuration for id: ${MISSING_EMS_ID}`
|
||||
`Unable to find EMS tile configuration for id: ${MISSING_EMS_ID}. Kibana is unable to access Elastic Maps Service. Contact your system administrator.`
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -6,29 +6,82 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { UI_SETTINGS } from '../../../../../src/plugins/data/common';
|
||||
|
||||
export default function ({ getPageObjects, getService, updateBaselines }) {
|
||||
const PageObjects = getPageObjects(['common', 'maps', 'header', 'home', 'timePicker']);
|
||||
const screenshot = getService('screenshots');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/38137
|
||||
describe.skip('maps loaded from sample data', () => {
|
||||
// Sample data is shifted to be relative to current time
|
||||
// This means that a static timerange will return different documents
|
||||
// Setting the time range to a window larger than the sample data set
|
||||
// ensures all documents are coverered by time query so the ES results will always be the same
|
||||
async function setTimerangeToCoverAllSampleData() {
|
||||
const past = new Date();
|
||||
past.setMonth(past.getMonth() - 6);
|
||||
const future = new Date();
|
||||
future.setMonth(future.getMonth() + 6);
|
||||
await PageObjects.maps.setAbsoluteRange(
|
||||
PageObjects.timePicker.formatDateToAbsoluteTimeString(past),
|
||||
PageObjects.timePicker.formatDateToAbsoluteTimeString(future)
|
||||
);
|
||||
}
|
||||
// Only update the baseline images from Jenkins session images after comparing them
|
||||
// These tests might fail locally because of scaling factors and resolution.
|
||||
|
||||
describe('maps loaded from sample data', () => {
|
||||
before(async () => {
|
||||
const SAMPLE_DATA_RANGE = `[
|
||||
{
|
||||
"from": "now-30d",
|
||||
"to": "now+40d",
|
||||
"display": "sample data range"
|
||||
},
|
||||
{
|
||||
"from": "now/d",
|
||||
"to": "now/d",
|
||||
"display": "Today"
|
||||
},
|
||||
{
|
||||
"from": "now/w",
|
||||
"to": "now/w",
|
||||
"display": "This week"
|
||||
},
|
||||
{
|
||||
"from": "now-15m",
|
||||
"to": "now",
|
||||
"display": "Last 15 minutes"
|
||||
},
|
||||
{
|
||||
"from": "now-30m",
|
||||
"to": "now",
|
||||
"display": "Last 30 minutes"
|
||||
},
|
||||
{
|
||||
"from": "now-1h",
|
||||
"to": "now",
|
||||
"display": "Last 1 hour"
|
||||
},
|
||||
{
|
||||
"from": "now-24h",
|
||||
"to": "now",
|
||||
"display": "Last 24 hours"
|
||||
},
|
||||
{
|
||||
"from": "now-7d",
|
||||
"to": "now",
|
||||
"display": "Last 7 days"
|
||||
},
|
||||
{
|
||||
"from": "now-30d",
|
||||
"to": "now",
|
||||
"display": "Last 30 days"
|
||||
},
|
||||
{
|
||||
"from": "now-90d",
|
||||
"to": "now",
|
||||
"display": "Last 90 days"
|
||||
},
|
||||
{
|
||||
"from": "now-1y",
|
||||
"to": "now",
|
||||
"display": "Last 1 year"
|
||||
}
|
||||
]`;
|
||||
|
||||
await kibanaServer.uiSettings.update({
|
||||
[UI_SETTINGS.TIMEPICKER_QUICK_RANGES]: SAMPLE_DATA_RANGE,
|
||||
});
|
||||
});
|
||||
|
||||
// Skipped because EMS vectors are not accessible in CI
|
||||
describe('ecommerce', () => {
|
||||
before(async () => {
|
||||
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
|
||||
|
@ -42,8 +95,11 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
|
|||
await PageObjects.maps.toggleLayerVisibility('France');
|
||||
await PageObjects.maps.toggleLayerVisibility('United States');
|
||||
await PageObjects.maps.toggleLayerVisibility('World Countries');
|
||||
await setTimerangeToCoverAllSampleData();
|
||||
await PageObjects.timePicker.setCommonlyUsedTime('sample_data range');
|
||||
await PageObjects.maps.enterFullScreen();
|
||||
await PageObjects.maps.closeLegend();
|
||||
const mapContainerElement = await testSubjects.find('mapContainer');
|
||||
await mapContainerElement.moveMouseTo({ xOffset: 0, yOffset: 0 });
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
@ -60,7 +116,7 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
|
|||
'ecommerce_map',
|
||||
updateBaselines
|
||||
);
|
||||
expect(percentDifference).to.be.lessThan(0.05);
|
||||
expect(percentDifference).to.be.lessThan(0.02);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -73,8 +129,11 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
|
|||
await PageObjects.home.addSampleDataSet('flights');
|
||||
await PageObjects.maps.loadSavedMap('[Flights] Origin and Destination Flight Time');
|
||||
await PageObjects.maps.toggleLayerVisibility('Road map');
|
||||
await setTimerangeToCoverAllSampleData();
|
||||
await PageObjects.timePicker.setCommonlyUsedTime('sample_data range');
|
||||
await PageObjects.maps.enterFullScreen();
|
||||
await PageObjects.maps.closeLegend();
|
||||
const mapContainerElement = await testSubjects.find('mapContainer');
|
||||
await mapContainerElement.moveMouseTo({ xOffset: 0, yOffset: 0 });
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
@ -91,11 +150,10 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
|
|||
'flights_map',
|
||||
updateBaselines
|
||||
);
|
||||
expect(percentDifference).to.be.lessThan(0.05);
|
||||
expect(percentDifference).to.be.lessThan(0.02);
|
||||
});
|
||||
});
|
||||
|
||||
// Skipped because EMS vectors are not accessible in CI
|
||||
describe('web logs', () => {
|
||||
before(async () => {
|
||||
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
|
||||
|
@ -106,8 +164,11 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
|
|||
await PageObjects.maps.loadSavedMap('[Logs] Total Requests and Bytes');
|
||||
await PageObjects.maps.toggleLayerVisibility('Road map');
|
||||
await PageObjects.maps.toggleLayerVisibility('Total Requests by Country');
|
||||
await setTimerangeToCoverAllSampleData();
|
||||
await PageObjects.timePicker.setCommonlyUsedTime('sample_data range');
|
||||
await PageObjects.maps.enterFullScreen();
|
||||
await PageObjects.maps.closeLegend();
|
||||
const mapContainerElement = await testSubjects.find('mapContainer');
|
||||
await mapContainerElement.moveMouseTo({ xOffset: 0, yOffset: 0 });
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
@ -124,7 +185,7 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
|
|||
'web_logs_map',
|
||||
updateBaselines
|
||||
);
|
||||
expect(percentDifference).to.be.lessThan(0.06);
|
||||
expect(percentDifference).to.be.lessThan(0.02);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 67 KiB |
Binary file not shown.
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 102 KiB |
Binary file not shown.
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 132 KiB |
Loading…
Add table
Add a link
Reference in a new issue