[Index Management] Fix flaky tests (#166221)

This commit is contained in:
Ignacio Rivas 2023-09-20 14:40:10 +02:00 committed by GitHub
parent 8dd4323d6c
commit 0ba75eec8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 19 deletions

View file

@ -9,26 +9,22 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const testSubjects = getService('testSubjects');
const pageObjects = getPageObjects(['common', 'indexManagement', 'header']);
const pageObjects = getPageObjects(['svlCommonPage', 'common', 'indexManagement', 'header']);
const browser = getService('browser');
const security = getService('security');
const retry = getService('retry');
// FLAKY: https://github.com/elastic/kibana/issues/165746
describe.skip('Index Templates', function () {
describe('Index Templates', function () {
before(async () => {
await security.testUser.setRoles(['index_management_user']);
// Navigate to the index management page
await pageObjects.svlCommonPage.login();
await pageObjects.common.navigateToApp('indexManagement');
// Navigate to the index templates tab
await pageObjects.indexManagement.changeTabs('templatesTab');
await pageObjects.header.waitUntilLoadingHasFinished();
});
it('renders the index templates tab', async () => {
await retry.waitFor('index templates list to be visible', async () => {
return await testSubjects.exists('templateList');
});
const url = await browser.getCurrentUrl();
expect(url).to.contain(`/templates`);
});

View file

@ -9,27 +9,22 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const testSubjects = getService('testSubjects');
const pageObjects = getPageObjects(['common', 'indexManagement', 'header']);
const pageObjects = getPageObjects(['svlCommonPage', 'common', 'indexManagement', 'header']);
const browser = getService('browser');
const security = getService('security');
const retry = getService('retry');
// Flaky on serverless
// FLAKY: https://github.com/elastic/kibana/issues/165768
describe.skip('Indices', function () {
describe('Indices', function () {
before(async () => {
await security.testUser.setRoles(['index_management_user']);
// Navigate to the index management page
await pageObjects.svlCommonPage.login();
await pageObjects.common.navigateToApp('indexManagement');
// Navigate to the indices tab
await pageObjects.indexManagement.changeTabs('indicesTab');
await pageObjects.header.waitUntilLoadingHasFinished();
});
it('renders the indices tab', async () => {
await retry.waitFor('indices list to be visible', async () => {
return await testSubjects.exists('indicesList');
});
const url = await browser.getCurrentUrl();
expect(url).to.contain(`/indices`);
});