Skip to content

Commit

Permalink
a11y test for stack monitoring (#134140)
Browse files Browse the repository at this point in the history
* a11y test for stack monitoring

* monitoring tests a11y

* removed unused constants

* addressed review comments

* review changes

* changed the description of a test

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
rashmivkulkarni and kibanamachine authored Jun 15, 2022
1 parent 842ec27 commit 2a872ab
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
63 changes: 63 additions & 0 deletions x-pack/test/accessibility/apps/stack_monitoring.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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 clusterOverview = getService('monitoringClusterOverview');

describe('Kibana Stack Monitoring a11y tests', () => {
before(async () => {
await PageObjects.common.navigateToApp('monitoring');
await a11y.testAppSnapshot();
});

it('a11y tests for no monitoring data found page', async () => {
await noData.isOnNoDataPage();
await a11y.testAppSnapshot();
});

it('a11y tests for self monitoring home page', 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('a11y tests for Alerts modal remind later button', 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('a11y tests for Kibana Overview', async function () {
await clusterOverview.clickKibanaOverview();
await kibanaOverview.isOnOverview();
await a11y.testAppSnapshot();
});

it('a11y tests for Kibana Instances Page', async function () {
await kibanaOverview.isOnOverview();
await kibanaOverview.clickInstanceTab();
await a11y.testAppSnapshot();
});
});
}
1 change: 1 addition & 0 deletions x-pack/test/accessibility/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions x-pack/test/functional/services/monitoring/kibana_overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ export function MonitoringKibanaOverviewProvider({ getService }) {
const retry = getService('retry');

const SUBJ_OVERVIEW_PAGE = 'kibanaOverviewPage';
const SUBJ_KBN_INSTANCES = 'kibanaInstancesPage';

return new (class KibanaOverview {
async isOnOverview() {
const pageId = await retry.try(() => testSubjects.find(SUBJ_OVERVIEW_PAGE));
return pageId !== null;
}

async clickInstanceTab() {
return testSubjects.click(SUBJ_KBN_INSTANCES);
}
})();
}

0 comments on commit 2a872ab

Please sign in to comment.