Skip to content

Commit

Permalink
a11y tests for roles page and modified a11y tests for users page
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavyarm committed Oct 7, 2020
1 parent 336dfc8 commit d9e0354
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions test/accessibility/services/a11y/analyze_with_axe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
23 changes: 19 additions & 4 deletions x-pack/test/accessibility/apps/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down Expand Up @@ -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: {
Expand All @@ -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');
});
});
}
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/roles'),
],

pageObjects,
Expand Down

0 comments on commit d9e0354

Please sign in to comment.