Optimized hybrid index pattern test (#138760)

* Updated test to use uiSettings.

* Optimized tests and removed some code.

* Fixed merge resolution.
This commit is contained in:
John Dorlus 2022-08-12 19:47:50 -04:00 committed by GitHub
parent 7b11420ee9
commit 74ad34014e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 14 deletions

View file

@ -453,12 +453,6 @@ export class SettingsPageObject extends FtrService {
await this.retry.try(async () => {
await this.header.waitUntilLoadingHasFinished();
await this.clickKibanaIndexPatterns();
const exists = await this.hasIndexPattern(indexPatternName);
if (exists) {
await this.clickIndexPatternByName(indexPatternName);
return;
}
await this.header.waitUntilLoadingHasFinished();
const flyOut = await this.testSubjects.exists('createAnyway');
@ -500,8 +494,10 @@ export class SettingsPageObject extends FtrService {
if (!isStandardIndexPattern) {
const badges = await this.find.allByCssSelector('.euiBadge__text');
const text = await badges[0].getVisibleText();
expect(text).to.equal('Rollup');
const rollupBadge = badges.filter(async (badge) => {
return (await badge.getVisibleText()) === 'Rollup';
});
expect(rollupBadge.length).to.equal(1);
}
return await this.getIndexPatternIdFromUrl();

View file

@ -38,9 +38,6 @@ export default function ({ getService, getPageObjects }) {
'global_index_pattern_management_all',
'test_rollup_reader',
]);
await kibanaServer.importExport.load(
'x-pack/test/functional/fixtures/kbn_archiver/rollup/rollup_hybrid'
);
await kibanaServer.uiSettings.replace({
defaultIndex: 'rollup',
});
@ -120,9 +117,7 @@ export default function ({ getService, getPageObjects }) {
`${regularIndexPrefix}*`,
`${rollupSourceIndexPrefix}*`,
]);
await kibanaServer.importExport.unload(
'x-pack/test/functional/fixtures/kbn_archiver/rollup/rollup_hybrid'
);
await kibanaServer.savedObjects.cleanStandardList();
});
});
}