Skip to content

Commit

Permalink
[Core UI] A11y tests for Kibana overview page (#80285) (#80696)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	x-pack/test/accessibility/config.ts
  • Loading branch information
cqliu1 authored Oct 15, 2020
1 parent fa6efe6 commit dcbab30
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
55 changes: 55 additions & 0 deletions test/accessibility/apps/kibana_overview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { FtrProviderContext } from '../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'home']);
const a11y = getService('a11y');

describe('Kibana overview', () => {
const esArchiver = getService('esArchiver');

before(async () => {
await esArchiver.load('empty_kibana');
await PageObjects.common.navigateToApp('kibanaOverview');
});

after(async () => {
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
useActualUrl: true,
});
await PageObjects.home.removeSampleDataSet('flights');
await esArchiver.unload('empty_kibana');
});

it('Getting started view', async () => {
await a11y.testAppSnapshot();
});

it('Overview view', async () => {
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
useActualUrl: true,
});
await PageObjects.home.addSampleDataSet('flights');
await PageObjects.common.navigateToApp('kibanaOverview');
await a11y.testAppSnapshot();
});
});
}
1 change: 1 addition & 0 deletions test/accessibility/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
require.resolve('./apps/console'),
require.resolve('./apps/home'),
require.resolve('./apps/filter_panel'),
require.resolve('./apps/kibana_overview'),
],
pageObjects,
services,
Expand Down
42 changes: 42 additions & 0 deletions x-pack/test/accessibility/apps/kibana_overview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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 { FtrProviderContext } from '../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'home']);
const a11y = getService('a11y');

describe('Kibana overview', () => {
const esArchiver = getService('esArchiver');

before(async () => {
await esArchiver.load('empty_kibana');
await PageObjects.common.navigateToApp('kibanaOverview');
});

after(async () => {
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
useActualUrl: true,
});
await PageObjects.home.removeSampleDataSet('flights');
await esArchiver.unload('empty_kibana');
});

it('Getting started view', async () => {
await a11y.testAppSnapshot();
});

it('Overview view', async () => {
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
useActualUrl: true,
});
await PageObjects.home.addSampleDataSet('flights');
await PageObjects.common.navigateToApp('kibanaOverview');
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 @@ -24,6 +24,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
require.resolve('./apps/advanced_settings'),
require.resolve('./apps/dashboard_edit_panel'),
require.resolve('./apps/users'),
require.resolve('./apps/kibana_overview'),
],

pageObjects,
Expand Down

0 comments on commit dcbab30

Please sign in to comment.