Skip to content

Commit 42faf22

Browse files
author
John Dorlus
committed
Added overview a11y test. Added data test subjects to the tabs in the app.
1 parent 2065438 commit 42faf22

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

x-pack/plugins/upgrade_assistant/public/application/components/tabs.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,15 @@ export class UpgradeAssistantTabs extends React.Component<Props, TabsState> {
189189
return [
190190
{
191191
id: 'overview',
192+
'data-test-subj': 'upgradeAssistantOverviewTab',
192193
name: i18n.translate('xpack.upgradeAssistant.overviewTab.overviewTabTitle', {
193194
defaultMessage: 'Overview',
194195
}),
195196
content: <OverviewTab checkupData={checkupData} {...commonProps} />,
196197
},
197198
{
198199
id: 'cluster',
200+
'data-test-subj': 'upgradeAssistantClusterTab',
199201
name: i18n.translate('xpack.upgradeAssistant.checkupTab.clusterTabLabel', {
200202
defaultMessage: 'Cluster',
201203
}),
@@ -212,6 +214,7 @@ export class UpgradeAssistantTabs extends React.Component<Props, TabsState> {
212214
},
213215
{
214216
id: 'indices',
217+
'data-test-subj': 'upgradeAssistantIndicesTab',
215218
name: i18n.translate('xpack.upgradeAssistant.checkupTab.indicesTabLabel', {
216219
defaultMessage: 'Indices',
217220
}),

x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export const CheckupTab: FunctionComponent<CheckupTabProps> = ({
102102
strongCheckupLabel: <strong>{checkupLabel}</strong>,
103103
nextEsVersion: `${nextMajor}.x`,
104104
}}
105+
data-test-subj="upgradeAssistant{checkupLabel}tabDetail"
105106
/>
106107
</p>
107108
</EuiText>

x-pack/plugins/upgrade_assistant/public/application/components/tabs/overview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const OverviewTab: FunctionComponent<UpgradeAssistantTabProps> = (props)
3030
<>
3131
<EuiSpacer />
3232

33-
<EuiText grow={false}>
33+
<EuiText data-test-subj="upgradeAssistantOverviewTabDetail" grow={false}>
3434
<p>
3535
<FormattedMessage
3636
id="xpack.upgradeAssistant.overviewTab.tabDetail"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import { FtrProviderContext } from '../ftr_provider_context';
8+
9+
export default function ({ getService, getPageObjects }: FtrProviderContext) {
10+
const PageObjects = getPageObjects(['upgradeAssistant', 'common']);
11+
const a11y = getService('a11y');
12+
const testSubjects = getService('testSubjects');
13+
const retry = getService('retry');
14+
15+
describe('Upgrade Assistant Home', () => {
16+
before(async () => {
17+
await PageObjects.upgradeAssistant.navigateToPage();
18+
});
19+
20+
it('Overview', async () => {
21+
await retry.waitFor('Upgrade Assistant overview tab to be visible', async () => {
22+
return testSubjects.exists('upgradeAssistantOverviewTabDetail') ? true : false;
23+
});
24+
await a11y.testAppSnapshot();
25+
});
26+
27+
it('List View', async () => {
28+
await testSubjects.click('upgradeAssistantClusterTab');
29+
await retry.waitFor('Upgrade Assistant Cluster tab to be visible', async () => {
30+
return testSubjects.exists('upgradeAssistantOverviewTab') ? true : false;
31+
});
32+
return testSubjects.isDisplayed('pipelineDetails') ? true : false;
33+
await a11y.testAppSnapshot();
34+
});
35+
});
36+
}

0 commit comments

Comments
 (0)