From 970f2cc4e878f7e3bc26af346dfb2b8b67446a34 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Thu, 19 Sep 2019 09:16:32 -0700 Subject: [PATCH] [Infra UI] Visual Regression Test for Inventory View (#44189) * [Infra UI] Visual Regression Test for Inventory View * removing extra code * Updating tests --- x-pack/test/visual_regression/config.js | 1 + .../visual_regression/tests/infra/index.js | 18 +++++++++++++ .../tests/infra/waffle_map.js | 25 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 x-pack/test/visual_regression/tests/infra/index.js create mode 100644 x-pack/test/visual_regression/tests/infra/waffle_map.js 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(); + }); + }); +}