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:
Rashmi Kulkarni 2021-02-11 15:01:41 -08:00 committed by GitHub
parent 53f4d4840b
commit a96aa5e34e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 95 additions and 31 deletions

View file

@ -101,7 +101,7 @@ export class EMSTMSSource extends AbstractTMSSource {
return tmsService; return tmsService;
} }
throw new Error(getErrorInfo()); throw new Error(getErrorInfo(emsTileLayerId));
} }
async getDisplayName() { async getDisplayName() {

View file

@ -10,7 +10,6 @@ import expect from '@kbn/expect';
export default function ({ getPageObjects }) { export default function ({ getPageObjects }) {
const PageObjects = getPageObjects(['maps', 'header']); const PageObjects = getPageObjects(['maps', 'header']);
// Failing: See https://github.com/elastic/kibana/issues/69617
describe.skip('layer errors', () => { describe.skip('layer errors', () => {
before(async () => { before(async () => {
await PageObjects.maps.loadSavedMap('layer with errors'); await PageObjects.maps.loadSavedMap('layer with errors');
@ -66,14 +65,15 @@ export default function ({ getPageObjects }) {
}); });
}); });
// FLAKY: https://github.com/elastic/kibana/issues/36011 describe('EMSFileSource with missing EMS id', () => {
describe.skip('EMSFileSource with missing EMS id', () => {
const MISSING_EMS_ID = 'idThatDoesNotExitForEMSFileSource'; const MISSING_EMS_ID = 'idThatDoesNotExitForEMSFileSource';
const LAYER_NAME = 'EMS_vector_shapes'; const LAYER_NAME = 'EMS_vector_shapes';
it('should diplay error message in layer panel', async () => { it('should diplay error message in layer panel', async () => {
const errorMsg = await PageObjects.maps.getLayerErrorText(LAYER_NAME); 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 () => { it('should allow deletion of layer', async () => {
@ -87,10 +87,13 @@ export default function ({ getPageObjects }) {
const MISSING_EMS_ID = 'idThatDoesNotExitForEMSTile'; const MISSING_EMS_ID = 'idThatDoesNotExitForEMSTile';
const LAYER_NAME = 'EMS_tiles'; 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); const errorMsg = await PageObjects.maps.getLayerErrorText(LAYER_NAME);
expect(errorMsg).to.equal( 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.`
); );
}); });

View file

@ -6,29 +6,82 @@
*/ */
import expect from '@kbn/expect'; import expect from '@kbn/expect';
import { UI_SETTINGS } from '../../../../../src/plugins/data/common';
export default function ({ getPageObjects, getService, updateBaselines }) { export default function ({ getPageObjects, getService, updateBaselines }) {
const PageObjects = getPageObjects(['common', 'maps', 'header', 'home', 'timePicker']); const PageObjects = getPageObjects(['common', 'maps', 'header', 'home', 'timePicker']);
const screenshot = getService('screenshots'); const screenshot = getService('screenshots');
const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer');
// FLAKY: https://github.com/elastic/kibana/issues/38137 // Only update the baseline images from Jenkins session images after comparing them
describe.skip('maps loaded from sample data', () => { // These tests might fail locally because of scaling factors and resolution.
// Sample data is shifted to be relative to current time
// This means that a static timerange will return different documents describe('maps loaded from sample data', () => {
// Setting the time range to a window larger than the sample data set before(async () => {
// ensures all documents are coverered by time query so the ES results will always be the same const SAMPLE_DATA_RANGE = `[
async function setTimerangeToCoverAllSampleData() { {
const past = new Date(); "from": "now-30d",
past.setMonth(past.getMonth() - 6); "to": "now+40d",
const future = new Date(); "display": "sample data range"
future.setMonth(future.getMonth() + 6); },
await PageObjects.maps.setAbsoluteRange( {
PageObjects.timePicker.formatDateToAbsoluteTimeString(past), "from": "now/d",
PageObjects.timePicker.formatDateToAbsoluteTimeString(future) "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', () => { describe('ecommerce', () => {
before(async () => { before(async () => {
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', { 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('France');
await PageObjects.maps.toggleLayerVisibility('United States'); await PageObjects.maps.toggleLayerVisibility('United States');
await PageObjects.maps.toggleLayerVisibility('World Countries'); await PageObjects.maps.toggleLayerVisibility('World Countries');
await setTimerangeToCoverAllSampleData(); await PageObjects.timePicker.setCommonlyUsedTime('sample_data range');
await PageObjects.maps.enterFullScreen(); await PageObjects.maps.enterFullScreen();
await PageObjects.maps.closeLegend();
const mapContainerElement = await testSubjects.find('mapContainer');
await mapContainerElement.moveMouseTo({ xOffset: 0, yOffset: 0 });
}); });
after(async () => { after(async () => {
@ -60,7 +116,7 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
'ecommerce_map', 'ecommerce_map',
updateBaselines 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.home.addSampleDataSet('flights');
await PageObjects.maps.loadSavedMap('[Flights] Origin and Destination Flight Time'); await PageObjects.maps.loadSavedMap('[Flights] Origin and Destination Flight Time');
await PageObjects.maps.toggleLayerVisibility('Road map'); await PageObjects.maps.toggleLayerVisibility('Road map');
await setTimerangeToCoverAllSampleData(); await PageObjects.timePicker.setCommonlyUsedTime('sample_data range');
await PageObjects.maps.enterFullScreen(); await PageObjects.maps.enterFullScreen();
await PageObjects.maps.closeLegend();
const mapContainerElement = await testSubjects.find('mapContainer');
await mapContainerElement.moveMouseTo({ xOffset: 0, yOffset: 0 });
}); });
after(async () => { after(async () => {
@ -91,11 +150,10 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
'flights_map', 'flights_map',
updateBaselines 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', () => { describe('web logs', () => {
before(async () => { before(async () => {
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', { 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.loadSavedMap('[Logs] Total Requests and Bytes');
await PageObjects.maps.toggleLayerVisibility('Road map'); await PageObjects.maps.toggleLayerVisibility('Road map');
await PageObjects.maps.toggleLayerVisibility('Total Requests by Country'); await PageObjects.maps.toggleLayerVisibility('Total Requests by Country');
await setTimerangeToCoverAllSampleData(); await PageObjects.timePicker.setCommonlyUsedTime('sample_data range');
await PageObjects.maps.enterFullScreen(); await PageObjects.maps.enterFullScreen();
await PageObjects.maps.closeLegend();
const mapContainerElement = await testSubjects.find('mapContainer');
await mapContainerElement.moveMouseTo({ xOffset: 0, yOffset: 0 });
}); });
after(async () => { after(async () => {
@ -124,7 +185,7 @@ export default function ({ getPageObjects, getService, updateBaselines }) {
'web_logs_map', 'web_logs_map',
updateBaselines 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