Skip to content

Commit

Permalink
re-enable a11y tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Aug 24, 2021
1 parent 90fbc51 commit 6f96185
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 68 deletions.
124 changes: 64 additions & 60 deletions x-pack/test/accessibility/apps/upgrade_assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,89 +5,93 @@
* 2.0.
*/

import { IndicesCreateRequest } from '@elastic/elasticsearch/api/types';
import { FtrProviderContext } from '../ftr_provider_context';

const translogSettingsIndexDeprecation: IndicesCreateRequest = {
index: 'deprecated_settings',
body: {
settings: {
'translog.retention.size': '1b',
'translog.retention.age': '5m',
'index.soft_deletes.enabled': true,
},
},
};

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

// These tests need to be completely refactored to account for new UI
describe.skip('Upgrade Assistant', () => {
describe('Upgrade Assistant', () => {
before(async () => {
await PageObjects.upgradeAssistant.navigateToPage();
});

it('Coming soon prompt', async () => {
await retry.waitFor('Upgrade Assistant coming soon prompt to be visible', async () => {
return testSubjects.exists('comingSoonPrompt');
});
await a11y.testAppSnapshot();
try {
// Create an index that will trigger a deprecation warning to test the ES deprecations page
await es.indices.create(translogSettingsIndexDeprecation);
} catch (e) {
log.debug('[Setup error] Error creating index');
throw e;
}
});

// These tests will be skipped until the last minor of the next major release
describe.skip('Upgrade Assistant content', () => {
it('Overview page', async () => {
await retry.waitFor('Upgrade Assistant overview page to be visible', async () => {
return testSubjects.exists('overviewPageContent');
});
await a11y.testAppSnapshot();
});

it('Elasticsearch cluster deprecations', async () => {
await PageObjects.common.navigateToUrl(
'management',
'stack/upgrade_assistant/es_deprecations/cluster',
{
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
shouldUseHashForSubUrl: false,
}
);

await retry.waitFor('Cluster tab to be visible', async () => {
return testSubjects.exists('clusterTabContent');
after(async () => {
try {
await es.indices.delete({
index: [translogSettingsIndexDeprecation.index],
});
} catch (e) {
log.debug('[Cleanup error] Error deleting index');
throw e;
}
});

await a11y.testAppSnapshot();
it('Overview page', async () => {
await retry.waitFor('Upgrade Assistant overview page to be visible', async () => {
return testSubjects.exists('overview');
});
await a11y.testAppSnapshot();
});

it('Elasticsearch index deprecations', async () => {
await PageObjects.common.navigateToUrl(
'management',
'stack/upgrade_assistant/es_deprecations/indices',
{
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
shouldUseHashForSubUrl: false,
}
);
it('Elasticsearch deprecations page', async () => {
await PageObjects.common.navigateToUrl(
'management',
'stack/upgrade_assistant/es_deprecations',
{
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
shouldUseHashForSubUrl: false,
}
);

await retry.waitFor('Indices tab to be visible', async () => {
return testSubjects.exists('indexTabContent');
});

await a11y.testAppSnapshot();
await retry.waitFor('Elasticsearch deprecations table to be visible', async () => {
return testSubjects.exists('esDeprecationsTable');
});

it('Kibana deprecations', async () => {
await PageObjects.common.navigateToUrl(
'management',
'stack/upgrade_assistant/kibana_deprecations',
{
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
shouldUseHashForSubUrl: false,
}
);
await a11y.testAppSnapshot();
});

await retry.waitFor('Kibana deprecations to be visible', async () => {
return testSubjects.exists('kibanaDeprecationsContent');
});
it('Kibana deprecations page', async () => {
await PageObjects.common.navigateToUrl(
'management',
'stack/upgrade_assistant/kibana_deprecations',
{
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
shouldUseHashForSubUrl: false,
}
);

await a11y.testAppSnapshot();
await retry.waitFor('Kibana deprecations to be visible', async () => {
return testSubjects.exists('kibanaDeprecationsContent');
});

await a11y.testAppSnapshot();
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* 2.0.
*/

import expect from '@kbn/expect';
import { IndicesCreateRequest } from '@elastic/elasticsearch/api/types';
import { FtrProviderContext } from '../../ftr_provider_context';

const multiFieldsDeprecation = {
const multiFieldsIndexDeprecation: IndicesCreateRequest = {
index: 'nested_multi_fields',
body: {
mappings: {
Expand All @@ -33,7 +33,7 @@ const multiFieldsDeprecation = {
},
};

const translogSettingsDeprecation = {
const translogSettingsIndexDeprecation: IndicesCreateRequest = {
index: 'deprecated_settings',
body: {
settings: {
Expand All @@ -48,7 +48,6 @@ export default function upgradeAssistantFunctionalTests({
getService,
getPageObjects,
}: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['upgradeAssistant', 'common']);
const retry = getService('retry');
const security = getService('security');
Expand All @@ -64,8 +63,8 @@ export default function upgradeAssistantFunctionalTests({

try {
// Create two indices that will trigger deprecation warnings to test the ES deprecations page
await es.indices.create(multiFieldsDeprecation);
await es.indices.create(translogSettingsDeprecation);
await es.indices.create(multiFieldsIndexDeprecation);
await es.indices.create(translogSettingsIndexDeprecation);
} catch (e) {
log.debug('[Setup error] Error creating indices');
throw e;
Expand All @@ -75,7 +74,7 @@ export default function upgradeAssistantFunctionalTests({
after(async () => {
try {
await es.indices.delete({
index: [multiFieldsDeprecation.index, translogSettingsDeprecation.index],
index: [multiFieldsIndexDeprecation.index, translogSettingsIndexDeprecation.index],
});
} catch (e) {
log.debug('[Cleanup error] Error deleting indices');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export class UpgradeAssistantPageObject extends FtrService {
private readonly retry = this.ctx.getService('retry');
private readonly log = this.ctx.getService('log');
private readonly browser = this.ctx.getService('browser');
private readonly find = this.ctx.getService('find');
private readonly testSubjects = this.ctx.getService('testSubjects');
private readonly common = this.ctx.getPageObject('common');

Expand Down

0 comments on commit 6f96185

Please sign in to comment.