From d9e03546dcb7ca6a9de2cc38cee57b9762845f6d Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 7 Oct 2020 15:04:50 -0400 Subject: [PATCH] a11y tests for roles page and modified a11y tests for users page --- .../services/a11y/analyze_with_axe.js | 4 ++++ x-pack/test/accessibility/apps/roles.ts | 23 +++++++++++++++---- x-pack/test/accessibility/config.ts | 1 + 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/test/accessibility/services/a11y/analyze_with_axe.js b/test/accessibility/services/a11y/analyze_with_axe.js index 4209a107cd3a2..aaecdbeb0e95d 100644 --- a/test/accessibility/services/a11y/analyze_with_axe.js +++ b/test/accessibility/services/a11y/analyze_with_axe.js @@ -37,6 +37,10 @@ export function analyzeWithAxe(context, options, callback) { id: 'label', selector: '[data-test-subj="comboBoxSearchInput"] *', }, + { + id: 'aria-roles', + selector: '[data-test-subj="comboBoxSearchInput"] *', + }, ], }); return window.axe.run(context, options); diff --git a/x-pack/test/accessibility/apps/roles.ts b/x-pack/test/accessibility/apps/roles.ts index c882bb8d672d5..36cebe45e3110 100644 --- a/x-pack/test/accessibility/apps/roles.ts +++ b/x-pack/test/accessibility/apps/roles.ts @@ -18,9 +18,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Kibana roles page a11y tests', () => { before(async () => { + await esArchiver.loadIfNeeded('logstash_functional'); + await kibanaServer.uiSettings.update({ + defaultIndex: 'logstash-*', + }); await PageObjects.security.clickElasticsearchRoles(); }); + after(async () => { + await esArchiver.unload('logstash_functional'); + }); + it('a11y test for Roles main page', async () => { await a11y.testAppSnapshot(); }); @@ -78,7 +86,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.click('cancelSpacePrivilegeButton'); }); - it('a11y test for role page after inputs', async () => { + it('a11y test for view privilege summary panel', async () => { await PageObjects.security.clickElasticsearchRoles(); await PageObjects.security.addRole('a11yRole', { elasticsearch: { @@ -93,13 +101,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { global: ['all'], }, }); + await testSubjects.click('edit-role-action-a11yRole'); + await testSubjects.click('viewPrivilegeSummaryButton'); + await a11y.testAppSnapshot(); + await testSubjects.click('euiFlyoutCloseButton'); + await testSubjects.click('roleFormCancelButton'); }); - it('a11y test for deleting a role', async () => { - await PageObjects.security.clickElasticsearchRoles(); - + it('a11y test for select and delete a role in roles listing table', async () => { + await testSubjects.click('checkboxSelectRow-a11yRole'); + await a11y.testAppSnapshot(); + await testSubjects.click('deleteRoleButton'); await a11y.testAppSnapshot(); + await testSubjects.click('confirmModalCancelButton'); }); }); } diff --git a/x-pack/test/accessibility/config.ts b/x-pack/test/accessibility/config.ts index 5ea5c03696479..6b3a2a9add89f 100644 --- a/x-pack/test/accessibility/config.ts +++ b/x-pack/test/accessibility/config.ts @@ -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/roles'), ], pageObjects,