mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
allow creating index patterns with diff names and time fields (#11934)
* allow creating index patterns with diff names and time fields * replace clickKibanaIndicies with clickKibanaIndices
This commit is contained in:
parent
c9b0d454c9
commit
0a3b8d16ba
10 changed files with 33 additions and 23 deletions
|
@ -44,9 +44,9 @@ async function run() {
|
|||
const failureCount = await functionalTestRunner.run();
|
||||
process.exitCode = failureCount ? 1 : 0;
|
||||
} catch (err) {
|
||||
await teardown(err);
|
||||
// await teardown(err);
|
||||
} finally {
|
||||
await teardown();
|
||||
// await teardown();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.settings.clickKibanaIndicies();
|
||||
return PageObjects.settings.clickKibanaIndices();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.settings.clickKibanaIndicies();
|
||||
return PageObjects.settings.clickKibanaIndices();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.settings.clickKibanaIndicies();
|
||||
return PageObjects.settings.clickKibanaIndices();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should filter indexed fields', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.getFieldTypes();
|
||||
|
||||
await PageObjects.settings.setFieldTypeFilter('string');
|
||||
|
|
|
@ -33,7 +33,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
before(function () {
|
||||
return PageObjects.settings.navigateTo()
|
||||
.then(function () {
|
||||
return PageObjects.settings.clickKibanaIndicies();
|
||||
return PageObjects.settings.clickKibanaIndices();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.settings.clickKibanaIndicies();
|
||||
return PageObjects.settings.clickKibanaIndices();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.settings.clickKibanaIndicies();
|
||||
return PageObjects.settings.clickKibanaIndices();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.settings.createIndexPattern();
|
||||
|
@ -26,7 +26,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
after(async function afterAll() {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.removeIndexPattern();
|
||||
});
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ export default function ({ getService, getPageObjects }) {
|
|||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
await kibanaServer.uiSettings.replace({ 'dateFormat:tz':'UTC' });
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.createIndexPattern();
|
||||
await kibanaServer.uiSettings.update({ 'dateFormat:tz':'UTC' });
|
||||
});
|
||||
|
||||
after(async function afterAll() {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.removeIndexPattern();
|
||||
});
|
||||
|
||||
|
@ -44,7 +44,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should create scripted field', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount());
|
||||
await PageObjects.settings.clickScriptedFieldsTab();
|
||||
await log.debug('add scripted field');
|
||||
|
@ -113,7 +113,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should create scripted field', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount());
|
||||
await PageObjects.settings.clickScriptedFieldsTab();
|
||||
await log.debug('add scripted field');
|
||||
|
@ -180,7 +180,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should create scripted field', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount());
|
||||
await PageObjects.settings.clickScriptedFieldsTab();
|
||||
await log.debug('add scripted field');
|
||||
|
@ -244,7 +244,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should create scripted field', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount());
|
||||
await PageObjects.settings.clickScriptedFieldsTab();
|
||||
await log.debug('add scripted field');
|
||||
|
@ -308,7 +308,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should create scripted field', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount());
|
||||
await PageObjects.settings.clickScriptedFieldsTab();
|
||||
await log.debug('add scripted field');
|
||||
|
|
|
@ -14,7 +14,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
await kibanaServer.uiSettings.replace({ 'dateFormat:tz':'UTC' });
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.createIndexPattern();
|
||||
await kibanaServer.uiSettings.update({ 'dateFormat:tz':'UTC' });
|
||||
});
|
||||
|
@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should filter scripted fields', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickKibanaIndices();
|
||||
await PageObjects.settings.clickScriptedFieldsTab();
|
||||
const scriptedFieldLangsBefore = await PageObjects.settings.getScriptedFieldLangs();
|
||||
await log.debug('add scripted field');
|
||||
|
|
|
@ -26,7 +26,8 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
|
|||
await this.clickLinkText('Advanced Settings');
|
||||
}
|
||||
|
||||
async clickKibanaIndicies() {
|
||||
async clickKibanaIndices() {
|
||||
log.debug('clickKibanaIndices link');
|
||||
await this.clickLinkText('Index Patterns');
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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.clickKibanaIndicies();
|
||||
await this.selectTimeFieldOption('@timestamp');
|
||||
await this.clickKibanaIndices();
|
||||
await this.setIndexPatternField(indexPatternName);
|
||||
await this.selectTimeFieldOption(timefield);
|
||||
await this.getCreateButton().click();
|
||||
});
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
@ -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 () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue