Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed assertion in hybrid index pattern test to iterate through indices #70130

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
);
}

async getAllIndexPatternNames() {
const indexPatterns = await this.getIndexPatternList();
return await mapAsync(indexPatterns, async (index) => {
cuff-links marked this conversation as resolved.
Show resolved Hide resolved
return await index.getVisibleText();
});
}

async isIndexPatternListEmpty() {
await testSubjects.existOrFail('indexPatternTable', { timeout: 5000 });
const indexPatternList = await this.getIndexPatternList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.createIndexPattern(rollupIndexPatternName, '@timestamp', false);

await PageObjects.settings.clickKibanaIndexPatterns();
const indexPattern = (await PageObjects.settings.getIndexPatternList()).pop();
const indexPatternText = await indexPattern.getVisibleText();
expect(indexPatternText).to.contain(rollupIndexPatternName);
expect(indexPatternText).to.contain('Rollup');
const indexPatternNames = await PageObjects.settings.getAllIndexPatternNames();
const filteredIndex = indexPatternNames.filter(
cuff-links marked this conversation as resolved.
Show resolved Hide resolved
(i) => i.includes(rollupIndexPatternName) && i.includes('Rollup')
cuff-links marked this conversation as resolved.
Show resolved Hide resolved
);
expect(filteredIndex.length).to.be(1);
});

after(async () => {
Expand Down