Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[a11y] add initial accessibility functional tests #43584

Merged
merged 34 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
92cd57e
[a11y] add initial accessibility functional tests
Aug 20, 2019
1391d9a
add accessibility jobs
Aug 20, 2019
bd3893b
fix config path
Aug 20, 2019
fd2d75d
remove percy setup from scripts
Aug 20, 2019
9285c8c
disable color-contrast rule
Aug 20, 2019
fa10f27
Merge branch 'master' of github.com:elastic/kibana into implement/a11…
Aug 22, 2019
ef171f8
Merge branch 'master' of github.com:elastic/kibana into implement/a11…
Aug 30, 2019
20df175
apply changes from @myasonik
Aug 30, 2019
6f59b22
define aria-controls/owns props even when suggestions aren't visible
Aug 30, 2019
e3e9dea
Merge branch 'master' of github.com:elastic/kibana into implement/a11…
Aug 30, 2019
160d273
[ftr/a11y] only throw error when there are errors
Aug 30, 2019
2cb6e37
Merge branch 'master' of github.com:elastic/kibana into implement/a11…
Sep 6, 2019
5c2b840
Merge remote-tracking branch 'upstream/master' into a11y-functional-t…
Oct 4, 2019
b9d81f6
adding tests for management page
bhavyarm Oct 4, 2019
629b20c
add a11y test for management page
bhavyarm Oct 4, 2019
2323ea9
Merge branch 'master' into implement/a11y-functional-tests
elasticmachine Oct 6, 2019
924ef04
adding ignore rules' to a11y
bhavyarm Oct 10, 2019
2df8e7c
accessibility test for kibana home
bhavyarm Oct 16, 2019
9fe47e2
Merge remote-tracking branch 'upstream/master' into a11y-functional-t…
Oct 18, 2019
e3993b9
Merge remote-tracking branch 'upstream/master' into a11y-functional-t…
Oct 22, 2019
963900a
7 passing tests, 0 failures
Oct 22, 2019
abededd
jest snapshot update
Oct 23, 2019
cd14c2b
Merge remote-tracking branch 'upstream/master' into a11y-functional-t…
Oct 23, 2019
cafa5c2
Merge remote-tracking branch 'upstream/master' into a11y-functional-t…
Oct 23, 2019
2c8231e
Merge branch 'master' into implement/a11y-functional-tests
elasticmachine Oct 28, 2019
6d6d75a
Merge branch 'master' into implement/a11y-functional-tests
elasticmachine Oct 28, 2019
eee51fe
Merge branch 'master' into implement/a11y-functional-tests
elasticmachine Oct 29, 2019
e31e6d9
support a11y test in pipeline job
Oct 29, 2019
784c70f
Merge branch 'master' of github.com:elastic/kibana into implement/a11…
Oct 29, 2019
ddebf90
update a11y test script for pipelines
Oct 29, 2019
8bc2291
use oss compatible ci setup
Oct 29, 2019
dd5a12e
fix exclude syntax
Oct 30, 2019
ed10982
add default exclusion syntax
Nov 5, 2019
8b9171a
Merge remote-tracking branch 'upstream/master' into pr/43584
Nov 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ci/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ JOB:
- kibana-ciGroup10
- kibana-ciGroup11
- kibana-ciGroup12
- kibana-accessibility
- kibana-visualRegression

# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
Expand All @@ -28,6 +29,7 @@ JOB:
- x-pack-ciGroup8
- x-pack-ciGroup9
- x-pack-ciGroup10
- x-pack-accessibility
- x-pack-visualRegression

# `~` is yaml for `null`
Expand Down
6 changes: 6 additions & 0 deletions .ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ kibana-ciGroup*)
kibana-visualRegression*)
./test/scripts/jenkins_visual_regression.sh
;;
kibana-accessibility*)
./test/scripts/jenkins_accessibility.sh
;;
kibana-firefoxSmoke*)
./test/scripts/jenkins_firefox_smoke.sh
;;
Expand All @@ -34,6 +37,9 @@ x-pack-ciGroup*)
x-pack-visualRegression*)
./test/scripts/jenkins_xpack_visual_regression.sh
;;
x-pack-accessibility*)
./test/scripts/jenkins_xpack_accessibility.sh
;;
x-pack-firefoxSmoke*)
./test/scripts/jenkins_xpack_firefox_smoke.sh
;;
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ module.exports = {
'x-pack/test/functional/apps/**/*.js',
'x-pack/legacy/plugins/apm/**/*.js',
'test/*/config.ts',
'test/*/{tests,test_suites,apis,apps}/**/*',
'test/visual_regression/tests/**/*',
'x-pack/test/*/{tests,test_suites,apis,apps}/**/*',
'x-pack/test/*/*config.*ts',
Expand Down
4 changes: 3 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld './test/scripts/jenkins_firefox_smoke.sh' }),
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', { runbld './test/scripts/jenkins_accessibility.sh' }),
'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld './test/scripts/jenkins_visual_regression.sh' }),
]),
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
Expand All @@ -39,6 +40,7 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld './test/scripts/jenkins_xpack_firefox_smoke.sh' }),
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', { runbld './test/scripts/jenkins_xpack_accessibility.sh' }),
'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld './test/scripts/jenkins_xpack_visual_regression.sh' }),
]),
])
Expand All @@ -47,4 +49,4 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
}
}
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@
"@typescript-eslint/parser": "^2.5.0",
"angular-mocks": "^1.7.8",
"archiver": "^3.1.1",
"axe-core": "^3.3.2",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-plugin-dynamic-import-node": "^2.3.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class Field extends PureComponent {
this.setState({
unsavedValue: newUnsavedValue,
isInvalid,
error
error,
});
};

Expand Down Expand Up @@ -764,6 +764,7 @@ export class Field extends PureComponent {
helpText={this.renderHelpText(setting)}
describedByIds={[`${setting.name}-aria`]}
className="mgtAdvancedSettings__fieldRow"
hasChildLabel={setting.type !== 'boolean'}
>
{this.renderField(setting)}
</EuiFormRow>
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/chrome/directives/kbn_chrome.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="app-wrapper-panel">
<div class="app-wrapper-panel" data-test-subj="appA11yRoot">
<div id="globalBannerList"></div>

<div
Expand Down
46 changes: 46 additions & 0 deletions test/accessibility/apps/discover.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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';

const FROM_TIME = '2015-09-19 06:31:44.000';
const TO_TIME = '2015-09-23 18:31:44.000';

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

describe('Discover', () => {
before(async () => {
await esArchiver.load('discover');
await esArchiver.loadIfNeeded('logstash_functional');
await kibanaServer.uiSettings.update({
defaultIndex: 'logstash-*',
});
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setAbsoluteRange(FROM_TIME, TO_TIME);
});

it('main view', async () => {
await a11y.testAppSnapshot();
});
});
}
35 changes: 35 additions & 0 deletions test/accessibility/apps/home.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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']);
const a11y = getService('a11y');

describe('Kibana Home', () => {
before(async () => {
await PageObjects.common.navigateToApp('home');
});

it('Kibana Home view', async () => {
await a11y.testAppSnapshot();
});
});
}
55 changes: 55 additions & 0 deletions test/accessibility/apps/management.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', 'settings']);
const a11y = getService('a11y');

describe('Management', () => {
before(async () => {
await PageObjects.common.navigateToApp('settings');
});

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

it('index pattern page', async () => {
await PageObjects.settings.clickKibanaIndexPatterns();
await a11y.testAppSnapshot();
});

it('Single indexpattern view', async () => {
await PageObjects.settings.clickIndexPatternLogstash();
await a11y.testAppSnapshot();
});

it('Saved objects view', async () => {
await PageObjects.settings.clickKibanaSavedObjects();
await a11y.testAppSnapshot();
});

it('Advanced settings', async () => {
await PageObjects.settings.clickKibanaSettings();
await a11y.testAppSnapshot();
});
});
}
42 changes: 42 additions & 0 deletions test/accessibility/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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 { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { services } from './services';
import { pageObjects } from './page_objects';

export default async function({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../functional/config'));

return {
...functionalConfig.getAll(),

testFiles: [
require.resolve('./apps/discover'),
require.resolve('./apps/management'),
require.resolve('./apps/home'),
],
pageObjects,
services,

junit: {
reportName: 'Accessibility Tests',
},
};
}
25 changes: 25 additions & 0 deletions test/accessibility/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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 { GenericFtrProviderContext } from '@kbn/test/types/ftr';

import { pageObjects } from './page_objects';
import { services } from './services';

export type FtrProviderContext = GenericFtrProviderContext<typeof services, typeof pageObjects>;
20 changes: 20 additions & 0 deletions test/accessibility/page_objects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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.
*/

export { pageObjects } from '../functional/page_objects';
Loading