diff --git a/x-pack/test/visual_regression/config.js b/x-pack/test/visual_regression/config.js index 22bf5d753b62..4f77098d6a45 100644 --- a/x-pack/test/visual_regression/config.js +++ b/x-pack/test/visual_regression/config.js @@ -15,6 +15,7 @@ export default async function ({ readConfigFile }) { testFiles: [ require.resolve('./tests/login_page'), require.resolve('./tests/maps'), + require.resolve('./tests/infra'), ], services: { diff --git a/x-pack/test/visual_regression/tests/infra/index.js b/x-pack/test/visual_regression/tests/infra/index.js new file mode 100644 index 000000000000..e9e6c0666ae7 --- /dev/null +++ b/x-pack/test/visual_regression/tests/infra/index.js @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export default function ({ loadTestFile, getService }) { + const browser = getService('browser'); + + describe('InfraUI Visual Regression', function () { + before(async () => { + await browser.setWindowSize(1600, 1000); + }); + + this.tags('ciGroup10'); + loadTestFile(require.resolve('./waffle_map')); + }); +} diff --git a/x-pack/test/visual_regression/tests/infra/waffle_map.js b/x-pack/test/visual_regression/tests/infra/waffle_map.js new file mode 100644 index 000000000000..68fbcaf6e7ee --- /dev/null +++ b/x-pack/test/visual_regression/tests/infra/waffle_map.js @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { DATES } from '../../../functional/apps/infra/constants'; +const DATE_WITH_DATA = DATES.metricsAndLogs.hosts.withData; + +export default function ({ getPageObjects, getService }) { + const PageObjects = getPageObjects(['common', 'infraHome']); + const visualTesting = getService('visualTesting'); + const esArchiver = getService('esArchiver'); + + describe('waffle map', () => { + before(() => esArchiver.load('infra/metrics_and_logs')); + after(() => esArchiver.unload('infra/metrics_and_logs')); + + it('should just work', async () => { + await PageObjects.common.navigateToApp('infraOps'); + await PageObjects.infraHome.goToTime(DATE_WITH_DATA); + await PageObjects.infraHome.getWaffleMap(); + await visualTesting.snapshot(); + }); + }); +}