Skip to content

Commit

Permalink
A11y tests for license management page (#127497)
Browse files Browse the repository at this point in the history
(cherry picked from commit faa3fc6)
  • Loading branch information
bhavyarm committed Mar 14, 2022
1 parent 5151a3e commit 50fedc1
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.

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 @@ -183,7 +183,10 @@ export class UploadLicense extends React.PureComponent {
<EuiSpacer size="m" />
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiButtonEmpty {...reactRouterNavigate(history, '/home')}>
<EuiButtonEmpty
data-test-subj="cancelUploadButton"
{...reactRouterNavigate(history, '/home')}
>
<FormattedMessage
id="xpack.licenseMgmt.uploadLicense.cancelButtonLabel"
defaultMessage="Cancel"
Expand Down
41 changes: 41 additions & 0 deletions x-pack/test/accessibility/apps/license_management.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

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

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

describe('Upgrade Assistant a11y tests', () => {
before(async () => {
await PageObjects.common.navigateToApp('licenseManagement');
});

it('License management page overview meets a11y requirements', async () => {
await a11y.testAppSnapshot();
});

it('Update license panel meets a11y requirements', async () => {
await testSubjects.click('updateLicenseButton');
await a11y.testAppSnapshot();
});

it('Upload license error panel meets a11y requirements', async () => {
await testSubjects.click('uploadLicenseButton');
await a11y.testAppSnapshot();
});

it('Revert to basic license confirmation panel meets a11y requirements', async () => {
await testSubjects.click('cancelUploadButton');
await testSubjects.click('revertToBasicButton');
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 @@ -40,6 +40,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
require.resolve('./apps/remote_clusters'),
require.resolve('./apps/reporting'),
require.resolve('./apps/enterprise_search'),
require.resolve('./apps/license_management'),
],

pageObjects,
Expand Down

0 comments on commit 50fedc1

Please sign in to comment.