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

[ML] Stabilize accessibility tests for data frame analytics pages #89423

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions test/accessibility/services/a11y/a11y.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ export function A11yProvider({ getService }: FtrProviderContext) {
exclude: ([] as string[])
.concat(excludeTestSubj || [])
.map((ts) => [testSubjectToCss(ts)])
.concat([
[
'.leaflet-vega-container[role="graphics-document"][aria-roledescription="visualization"]',
],
]),
.concat([['[role="graphics-document"][aria-roledescription="visualization"]']]),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { Fragment, useState, useEffect } from 'react';
import { PropTypes } from 'prop-types';
import React, { Fragment, useState, useEffect, useMemo } from 'react';
import {
htmlIdGenerator,
EuiCheckbox,
EuiSearchBar,
EuiFlexGroup,
Expand All @@ -25,6 +25,7 @@ import {
EuiTableRowCellCheckbox,
EuiTableHeaderMobile,
} from '@elastic/eui';
import { PropTypes } from 'prop-types';

import { Pager } from '@elastic/eui/lib/services';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -179,14 +180,16 @@ export function CustomSelectionTable({
return indexOfUnselectedItem === -1;
}

const selectAllCheckboxId = useMemo(() => htmlIdGenerator()(), []);

function renderSelectAll(mobile) {
const selectAll = i18n.translate('xpack.ml.jobSelector.customTable.selectAllCheckboxLabel', {
defaultMessage: 'Select all',
});

return (
<EuiCheckbox
id="selectAllCheckbox"
id={`${mobile ? `mobile-` : ''}${selectAllCheckboxId}`}
label={mobile ? selectAll : null}
checked={areAllItemsSelected()}
onChange={toggleAll}
Expand Down
14 changes: 6 additions & 8 deletions x-pack/test/accessibility/apps/ml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export default function ({ getService }: FtrProviderContext) {
const a11y = getService('a11y');
const ml = getService('ml');

// flaky tests, see https://github.com/elastic/kibana/issues/88592
describe.skip('ml', () => {
describe('ml', () => {
const esArchiver = getService('esArchiver');

before(async () => {
Expand Down Expand Up @@ -238,16 +237,13 @@ export default function ({ getService }: FtrProviderContext) {
await a11y.testAppSnapshot();
});

it('data frame analytics create job select index pattern modal', async () => {
await ml.navigation.navigateToDataFrameAnalytics();
await ml.dataFrameAnalytics.startAnalyticsCreation();
await a11y.testAppSnapshot();
});

it('data frame analytics create job configuration step', async () => {
await ml.testExecution.logTestStep(
'job creation selects the source data and loads the DFA job wizard page'
);
await ml.navigation.navigateToMl();
await ml.navigation.navigateToDataFrameAnalytics();
await ml.dataFrameAnalytics.startAnalyticsCreation();
await ml.jobSourceSelection.selectSourceForAnalyticsJob(ihpIndexPattern);
await ml.dataFrameAnalyticsCreation.assertConfigurationStepActive();
await a11y.testAppSnapshot();
Expand All @@ -261,6 +257,8 @@ export default function ({ getService }: FtrProviderContext) {
await ml.dataFrameAnalyticsCreation.assertSourceDataPreviewExists();
await ml.testExecution.logTestStep('enables the source data preview histogram charts');
await ml.dataFrameAnalyticsCreation.enableSourceDataPreviewHistogramCharts();
await ml.testExecution.logTestStep('displays the include fields selection');
await ml.dataFrameAnalyticsCreation.assertIncludeFieldsSelectionExists();
await a11y.testAppSnapshot();
});

Expand Down