mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Upgrade] Fix tests for 8.3 snapshots (#132374)
* Update canvas url check and widen maps pixel diff * Move maps screenshots to upgrade dir and update paths/names * Hide map tooltip if exists Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9aa26549b5
commit
ac5d00381c
7 changed files with 35 additions and 14 deletions
|
@ -39,14 +39,16 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
it('renders elements on workpad ' + name + ' page ' + page, async () => {
|
||||
const currentUrl = await browser.getCurrentUrl();
|
||||
const [, hash] = currentUrl.split('#/');
|
||||
if (hash.length === 0) {
|
||||
const browserUrl = await browser.getCurrentUrl();
|
||||
const currentUrl = new URL(browserUrl);
|
||||
const pathname = currentUrl.pathname;
|
||||
const hash = currentUrl.hash;
|
||||
if (hash.length === 0 && pathname.replace(/\/$/, '') === basePath + '/app/canvas') {
|
||||
throw new Error('Did not launch canvas sample data for ' + name);
|
||||
}
|
||||
if (name === 'ecommerce') {
|
||||
if (!currentUrl.includes('page/' + page)) {
|
||||
await browser.get(currentUrl.replace(/\/[^\/]*$/, '/' + page), false);
|
||||
if (!browserUrl.includes('page/' + page)) {
|
||||
await browser.get(browserUrl.replace(/\/[^\/]*$/, '/' + page), false);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,10 +123,10 @@ export default function ({
|
|||
});
|
||||
it('should load layers', async () => {
|
||||
const percentDifference = await screenshot.compareAgainstBaseline(
|
||||
'ecommerce_map',
|
||||
'upgrade_ecommerce_map',
|
||||
updateBaselines
|
||||
);
|
||||
expect(percentDifference.toFixed(3)).to.be.lessThan(0.031);
|
||||
expect(percentDifference.toFixed(3)).to.be.lessThan(0.05);
|
||||
});
|
||||
});
|
||||
describe('space: ' + space + ', name: flights', () => {
|
||||
|
@ -147,10 +147,10 @@ export default function ({
|
|||
});
|
||||
it('should load saved object and display layers', async () => {
|
||||
const percentDifference = await screenshot.compareAgainstBaseline(
|
||||
'flights_map',
|
||||
'upgrade_flights_map',
|
||||
updateBaselines
|
||||
);
|
||||
expect(percentDifference.toFixed(3)).to.be.lessThan(0.031);
|
||||
expect(percentDifference.toFixed(3)).to.be.lessThan(0.05);
|
||||
});
|
||||
});
|
||||
describe('space: ' + space + ', name: web logs', () => {
|
||||
|
@ -172,10 +172,10 @@ export default function ({
|
|||
});
|
||||
it('should load saved object and display layers', async () => {
|
||||
const percentDifference = await screenshot.compareAgainstBaseline(
|
||||
'web_logs_map',
|
||||
'upgrade_web_logs_map',
|
||||
updateBaselines
|
||||
);
|
||||
expect(percentDifference.toFixed(3)).to.be.lessThan(0.031);
|
||||
expect(percentDifference.toFixed(3)).to.be.lessThan(0.05);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { resolve } from 'path';
|
||||
|
||||
import { FtrConfigProviderContext } from '@kbn/test';
|
||||
import { pageObjects } from '../functional/page_objects';
|
||||
import { ReportingAPIProvider } from './services/reporting_upgrade_services';
|
||||
|
@ -36,6 +38,10 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|||
mapsHelper: MapsHelper,
|
||||
},
|
||||
|
||||
screenshots: {
|
||||
directory: resolve(__dirname, 'screenshots'),
|
||||
},
|
||||
|
||||
junit: {
|
||||
reportName: 'Kibana Core Tests',
|
||||
},
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
BIN
x-pack/test/upgrade/screenshots/baseline/upgrade_flights_map.png
Normal file
BIN
x-pack/test/upgrade/screenshots/baseline/upgrade_flights_map.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
Binary file not shown.
After Width: | Height: | Size: 120 KiB |
|
@ -8,10 +8,23 @@
|
|||
import { FtrProviderContext } from '../ftr_provider_context';
|
||||
|
||||
export function MapsHelper({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const PageObjects = getPageObjects(['maps']);
|
||||
const PageObjects = getPageObjects(['maps', 'common']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const log = getService('log');
|
||||
|
||||
return {
|
||||
async toggleLayerVisibility(layerName: string) {
|
||||
log.debug('Inside toggleLayerVisibility');
|
||||
await PageObjects.maps.openLayerTocActionsPanel(layerName);
|
||||
await testSubjects.click('layerVisibilityToggleButton');
|
||||
await PageObjects.common.sleep(3000);
|
||||
const isTooltipOpen = await testSubjects.exists(`layerTocTooltip`, { timeout: 5000 });
|
||||
if (isTooltipOpen) {
|
||||
await testSubjects.click(`layerTocTooltip`);
|
||||
await PageObjects.common.sleep(1000);
|
||||
}
|
||||
},
|
||||
|
||||
// In v8.0, the default base map switched from bright to desaturated.
|
||||
// https://github.com/elastic/kibana/pull/116179
|
||||
// Maps created before this change will have a base map called "Road map"
|
||||
|
@ -26,10 +39,10 @@ export function MapsHelper({ getPageObjects, getService }: FtrProviderContext) {
|
|||
throw new Error('Layer road map not found');
|
||||
}
|
||||
if (isRoadMapDesaturated) {
|
||||
await PageObjects.maps.toggleLayerVisibility('Road map - desaturated');
|
||||
await this.toggleLayerVisibility('Road map - desaturated');
|
||||
}
|
||||
if (isRoadMap) {
|
||||
await PageObjects.maps.toggleLayerVisibility('Road map');
|
||||
await this.toggleLayerVisibility('Road map');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue