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

[Upgrade Assistant] Add A11y Tests #90265

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,15 @@ export class UpgradeAssistantTabs extends React.Component<Props, TabsState> {
return [
{
id: 'overview',
'data-test-subj': 'upgradeAssistantOverviewTab',
name: i18n.translate('xpack.upgradeAssistant.overviewTab.overviewTabTitle', {
defaultMessage: 'Overview',
}),
content: <OverviewTab checkupData={checkupData} {...commonProps} />,
},
{
id: 'cluster',
'data-test-subj': 'upgradeAssistantClusterTab',
name: i18n.translate('xpack.upgradeAssistant.checkupTab.clusterTabLabel', {
defaultMessage: 'Cluster',
}),
Expand All @@ -213,6 +215,7 @@ export class UpgradeAssistantTabs extends React.Component<Props, TabsState> {
},
{
id: 'indices',
'data-test-subj': 'upgradeAssistantIndicesTab',
name: i18n.translate('xpack.upgradeAssistant.checkupTab.indicesTabLabel', {
defaultMessage: 'Indices',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const CheckupTab: FunctionComponent<CheckupTabProps> = ({
strongCheckupLabel: <strong>{checkupLabel}</strong>,
nextEsVersion: `${nextMajor}.x`,
}}
data-test-subj="upgradeAssistant{checkupLabel}tabDetail"
/>
</p>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const OverviewTab: FunctionComponent<UpgradeAssistantTabProps> = (props)
<>
<EuiSpacer />

<EuiText grow={false}>
<EuiText data-test-subj="upgradeAssistantOverviewTabDetail" grow={false}>
<p>
<FormattedMessage
id="xpack.upgradeAssistant.overviewTab.tabDetail"
Expand Down
36 changes: 36 additions & 0 deletions x-pack/test/accessibility/apps/upgrade_assistant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

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

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

describe('Upgrade Assistant Home', () => {
before(async () => {
await PageObjects.upgradeAssistant.navigateToPage();
});

it('Overview', async () => {
await retry.waitFor('Upgrade Assistant overview tab to be visible', async () => {
return testSubjects.exists('upgradeAssistantOverviewTabDetail') ? true : false;
cuff-links marked this conversation as resolved.
Show resolved Hide resolved
});
await a11y.testAppSnapshot();
});

it('List View', async () => {
await testSubjects.click('upgradeAssistantClusterTab');
cuff-links marked this conversation as resolved.
Show resolved Hide resolved
await retry.waitFor('Upgrade Assistant Cluster tab to be visible', async () => {
return testSubjects.exists('upgradeAssistantOverviewTab') ? true : false;
cuff-links marked this conversation as resolved.
Show resolved Hide resolved
});
return testSubjects.isDisplayed('pipelineDetails') ? true : false;
cuff-links marked this conversation as resolved.
Show resolved Hide resolved
await a11y.testAppSnapshot();
});
});
}