From 3e5789a747906c3dbcd41cac65ca6413fb7c9963 Mon Sep 17 00:00:00 2001 From: rashmikulkarni Date: Thu, 9 Jun 2022 14:50:01 -0700 Subject: [PATCH] a11y test for stack monitoring --- .../accessibility/apps/stack_monitoring.ts | 64 +++++++++++++++++++ x-pack/test/accessibility/config.ts | 1 + 2 files changed, 65 insertions(+) create mode 100644 x-pack/test/accessibility/apps/stack_monitoring.ts diff --git a/x-pack/test/accessibility/apps/stack_monitoring.ts b/x-pack/test/accessibility/apps/stack_monitoring.ts new file mode 100644 index 00000000000000..7dad6d1068de53 --- /dev/null +++ b/x-pack/test/accessibility/apps/stack_monitoring.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +// a11y tests for spaces, space selection and space creation and feature controls + +import { FtrProviderContext } from '../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const PageObjects = getPageObjects(['common', 'spaceSelector', 'home', 'header', 'security']); + const a11y = getService('a11y'); + const testSubjects = getService('testSubjects'); + const retry = getService('retry'); + const noData = getService('monitoringNoData'); + const kibanaOverview = getService('monitoringKibanaOverview'); + const kibanaInstances = getService('monitoringKibanaInstances'); + const clusterOverview = getService('monitoringClusterOverview'); + + describe('Kibana Stack Monitoring', () => { + before(async () => { + await PageObjects.common.navigateToApp('monitoring'); + await a11y.testAppSnapshot(); + }); + + it('No monitoring data found should exist ', async () => { + await noData.isOnNoDataPage(); + await a11y.testAppSnapshot(); + }); + + it('Enable Monitoring', async function () { + await noData.enableMonitoring(); + await a11y.testAppSnapshot(); + await retry.waitForWithTimeout('alert button to be visible', 30000, async () => { + return await testSubjects.isDisplayed('alerts-modal-remind-later-button'); + }); + }); + + // a11y violation caught here - if this rest is unskipped remove the test below it. + // https://github.com/elastic/kibana/issues/134139 + it.skip('Alerts Page', async function () { + await testSubjects.click('alerts-modal-remind-later-button'); + await a11y.testAppSnapshot(); + }); + + it('Alerts Page', async function () { + await testSubjects.click('alerts-modal-remind-later-button'); + }); + + it('Kibana Overview', async function () { + await clusterOverview.clickKibanaOverview(); + await kibanaOverview.isOnOverview(); + await a11y.testAppSnapshot(); + }); + + it('Kibana Instances Page', async function () { + await kibanaOverview.clickOnInstancesTab(); + await kibanaInstances.isOnInstances(); + await a11y.testAppSnapshot(); + }); + }); +} diff --git a/x-pack/test/accessibility/config.ts b/x-pack/test/accessibility/config.ts index 30c130df23a15a..351865d296ec8d 100644 --- a/x-pack/test/accessibility/config.ts +++ b/x-pack/test/accessibility/config.ts @@ -44,6 +44,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { require.resolve('./apps/license_management'), require.resolve('./apps/tags'), require.resolve('./apps/search_sessions'), + require.resolve('./apps/stack_monitoring'), ], pageObjects,