Replacing empty_kibana in xpack a11y tests with Kibana server's cleanStandardList function to fix test failures (#135657)

This commit is contained in:
Bhavya RM 2022-07-06 09:23:18 -04:00 committed by GitHub
parent 62bd8980a8
commit bce1836e54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 15 deletions

View file

@ -9,17 +9,21 @@ import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const a11y = getService('a11y');
const esArchiver = getService('esArchiver');
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const { common } = getPageObjects(['common']);
const kibanaServer = getService('kibanaServer');
describe('Enterprise Search Accessibility', () => {
// NOTE: These accessibility tests currently only run against Enterprise Search in Kibana
// without a sidecar Enterprise Search service/host configured, and as such only test
// the basic setup guides and not the full application(s)
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana');
await kibanaServer.savedObjects.cleanStandardList();
});
after(async () => {
await kibanaServer.savedObjects.cleanStandardList();
});
describe('Overview', () => {

View file

@ -10,17 +10,16 @@ import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'home']);
const a11y = getService('a11y');
const kibanaServer = getService('kibanaServer');
describe('Kibana overview Accessibility', () => {
const esArchiver = getService('esArchiver');
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana');
await kibanaServer.savedObjects.cleanStandardList();
await PageObjects.common.navigateToApp('kibanaOverview');
});
after(async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana');
await kibanaServer.savedObjects.cleanStandardList();
});
it('Kibana overview', async () => {

View file

@ -8,21 +8,21 @@
import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const a11y = getService('a11y');
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'security']);
const kibanaServer = getService('kibanaServer');
describe('Security Accessibility', () => {
describe('Login Page', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana');
await kibanaServer.savedObjects.cleanStandardList();
await PageObjects.security.forceLogout();
});
after(async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana');
await kibanaServer.savedObjects.cleanStandardList();
});
afterEach(async () => {

View file

@ -13,17 +13,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'spaceSelector', 'home', 'header', 'security']);
const a11y = getService('a11y');
const browser = getService('browser');
const esArchiver = getService('esArchiver');
const spacesService = getService('spaces');
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const toasts = getService('toasts');
const kibanaServer = getService('kibanaServer');
// Failing: See https://github.com/elastic/kibana/issues/135341
describe.skip('Kibana Spaces Accessibility', () => {
describe('Kibana Spaces Accessibility', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana');
await kibanaServer.savedObjects.cleanStandardList();
await PageObjects.common.navigateToApp('home');
});
after(async () => {
await spacesService.delete('space_a');
await kibanaServer.savedObjects.cleanStandardList();
});
it('a11y test for manage spaces menu from top nav on Kibana home', async () => {
await testSubjects.click('space-avatar-default');

View file

@ -12,14 +12,14 @@ import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['security', 'settings']);
const a11y = getService('a11y');
const esArchiver = getService('esArchiver');
const testSubjects = getService('testSubjects');
const find = getService('find');
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');
describe('Kibana users Accessibility', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana');
await kibanaServer.savedObjects.cleanStandardList();
await PageObjects.security.clickElasticsearchUsers();
});