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

Allow creating different index patterns with different time fields #11926

Merged
merged 2 commits into from
May 19, 2017
Merged
Changes from all 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
14 changes: 12 additions & 2 deletions test/functional/page_objects/settings_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
}

async clickKibanaIndices() {
log.debug('clickKibanaIndices link');
await this.clickLinkText('Index Patterns');
}

Expand Down Expand Up @@ -71,6 +72,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
(await this.getTimeFieldNameField()).click();
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async () => {
log.debug(`selectTimeFieldOption(${selection})`);
(await this.getTimeFieldOption(selection)).click();
const selected = (await this.getTimeFieldOption(selection)).isSelected();
if (!selected) throw new Error('option not selected: ' + selected);
Expand Down Expand Up @@ -265,11 +267,12 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
await PageObjects.header.waitUntilLoadingHasFinished();
}

async createIndexPattern() {
async createIndexPattern(indexPatternName = 'logstash-*', timefield = '@timestamp') {
await retry.try(async () => {
await this.navigateTo();
await this.clickKibanaIndices();
await this.selectTimeFieldOption('@timestamp');
await this.setIndexPatternField(indexPatternName);
await this.selectTimeFieldOption(timefield);
await this.getCreateButton().click();
});
await PageObjects.header.waitUntilLoadingHasFinished();
Expand All @@ -284,6 +287,13 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
});
}

async setIndexPatternField(pattern) {
log.debug(`setIndexPatternField(${pattern})`);
return testSubjects.find('createIndexPatternNameInput')
.clearValue().type(pattern);
}


async removeIndexPattern() {
let alertText;
await retry.try(async () => {
Expand Down