A11y base tests (#51893)

a11y base tests
This commit is contained in:
Bhavya RM 2019-12-12 17:20:55 -05:00 committed by GitHub
parent 7e822c5df5
commit 4765ed0fa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 167 additions and 3 deletions

View file

@ -211,6 +211,9 @@ function EditorUI() {
<button
onClick={sendCurrentRequestToES}
data-test-subj="sendRequestButton"
aria-label={i18n.translate('console.sendRequestButtonTooltip', {
defaultMessage: 'click to send request',
})}
className="conApp__editorActionButton conApp__editorActionButton--success"
>
<EuiIcon type="play" />

View file

@ -0,0 +1,40 @@
/*
* 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', 'console']);
const a11y = getService('a11y');
describe('Dev tools console', () => {
before(async () => {
await PageObjects.common.navigateToApp('console');
});
it('Dev tools console view', async () => {
await a11y.testAppSnapshot();
});
it('Dev tools settings page', async () => {
await PageObjects.console.setFontSizeSetting(20);
await a11y.testAppSnapshot();
});
});
}

View file

@ -0,0 +1,57 @@
/*
* 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', 'dashboard', 'header']);
const a11y = getService('a11y');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
describe('Dashboard', () => {
const dashboardName = 'Dashboard Listing A11y';
before(async () => {
await esArchiver.loadIfNeeded('logstash_functional');
await kibanaServer.uiSettings.update({
defaultIndex: 'logstash-*',
});
await PageObjects.common.navigateToApp('dashboard');
});
it('dashboard', async () => {
await a11y.testAppSnapshot();
});
it('create dashboard button', async () => {
await PageObjects.dashboard.clickCreateDashboardPrompt();
await a11y.testAppSnapshot();
});
it('save empty dashboard', async () => {
await PageObjects.dashboard.saveDashboard(dashboardName);
await a11y.testAppSnapshot();
});
it('Dashboard listing table', async () => {
await PageObjects.dashboard.gotoDashboardLandingPage();
await a11y.testAppSnapshot();
});
});
}

View file

@ -20,7 +20,7 @@
import { FtrProviderContext } from '../ftr_provider_context';
export default function({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common']);
const PageObjects = getPageObjects(['common', 'home']);
const a11y = getService('a11y');
describe('Kibana Home', () => {
@ -31,5 +31,15 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
it('Kibana Home view', async () => {
await a11y.testAppSnapshot();
});
it('Add Kibana sample data page', async () => {
await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData');
await a11y.testAppSnapshot();
});
it('Add flights sample data set', async () => {
await PageObjects.home.addSampleDataSet('flights');
await a11y.testAppSnapshot();
});
});
}

View file

@ -21,6 +21,8 @@ import { FtrProviderContext } from '../ftr_provider_context';
export default function({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'settings']);
const testSubjects = getService('testSubjects');
const a11y = getService('a11y');
describe('Management', () => {
@ -42,6 +44,12 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
await a11y.testAppSnapshot();
});
it('Create Index pattern wizard', async () => {
await PageObjects.settings.clickKibanaIndexPatterns();
await (await testSubjects.find('createIndexPatternButton')).click();
await a11y.testAppSnapshot();
});
it('Saved objects view', async () => {
await PageObjects.settings.clickKibanaSavedObjects();
await a11y.testAppSnapshot();

View file

@ -0,0 +1,45 @@
/*
* 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', 'visualize', 'header']);
const a11y = getService('a11y');
describe('Visualize', () => {
before(async () => {
await PageObjects.common.navigateToApp('visualize');
});
it('visualize', async () => {
await a11y.testAppSnapshot();
});
it('click on create visualize wizard', async () => {
await PageObjects.visualize.navigateToNewVisualization();
await a11y.testAppSnapshot();
});
it.skip('create visualize button', async () => {
await PageObjects.visualize.clickNewVisualization();
await a11y.testAppSnapshot();
});
});
}

View file

@ -29,7 +29,10 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) {
testFiles: [
require.resolve('./apps/discover'),
require.resolve('./apps/dashboard'),
require.resolve('./apps/visualize'),
require.resolve('./apps/management'),
// require.resolve('./apps/console'),
require.resolve('./apps/home'),
],
pageObjects,

View file

@ -13,9 +13,7 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) {
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('./apps/login_page')],
pageObjects,
services,