[UA] Enable a11y tests (#216599)

This commit is contained in:
Ignacio Rivas 2025-04-02 12:53:00 +02:00 committed by GitHub
parent 56c022371e
commit 78472d3709
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,41 +10,8 @@
* valid deprecations
*/
import type { IndicesCreateRequest } from '@elastic/elasticsearch/lib/api/types';
import { FtrProviderContext } from '../../ftr_provider_context';
const translogSettingsIndexDeprecation: IndicesCreateRequest = {
index: 'deprecated_settings',
settings: {
'translog.retention.size': '1b',
'translog.retention.age': '5m',
'index.soft_deletes.enabled': true,
},
};
const multiFieldsIndexDeprecation: IndicesCreateRequest = {
index: 'nested_multi_fields',
mappings: {
properties: {
text: {
type: 'text',
fields: {
english: {
type: 'text',
analyzer: 'english',
fields: {
english: {
type: 'text',
analyzer: 'english',
},
},
},
},
},
},
},
};
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['upgradeAssistant', 'common']);
const a11y = getService('a11y');
@ -53,14 +20,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const es = getService('es');
const log = getService('log');
describe.skip('Upgrade Assistant Accessibility', () => {
describe('Upgrade Assistant Accessibility', () => {
before(async () => {
await PageObjects.upgradeAssistant.navigateToPage();
try {
// Create two indices that will trigger deprecation warnings to test the ES deprecations page
await es.indices.create(multiFieldsIndexDeprecation);
await es.indices.create(translogSettingsIndexDeprecation);
// Create an ES deprecation
await es.cluster.putComponentTemplate({
name: 'deprecated_template',
template: {
mappings: {
_source: {
mode: 'stored',
},
},
},
});
} catch (e) {
log.debug('[Setup error] Error creating indices');
throw e;
@ -69,8 +44,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async () => {
try {
await es.indices.delete({
index: [multiFieldsIndexDeprecation.index, translogSettingsIndexDeprecation.index],
await es.cluster.deleteComponentTemplate({
name: 'deprecated_template',
});
} catch (e) {
log.debug('[Cleanup error] Error deleting indices');
@ -143,16 +118,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await a11y.testAppSnapshot();
});
it('Index settings deprecation flyout', async () => {
await PageObjects.upgradeAssistant.clickEsDeprecation(
'indexSettings' // An index setting deprecation was added in the before() hook so should be guaranteed
);
await retry.waitFor('ES index settings deprecation flyout to be visible', async () => {
return testSubjects.exists('indexSettingsDetails');
});
await a11y.testAppSnapshot();
});
it('Default deprecation flyout', async () => {
await PageObjects.upgradeAssistant.clickEsDeprecation(
'default' // A default deprecation was added in the before() hook so should be guaranteed