mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
change createIndexPattern to do what it takes to make the indexPatternName* (#64646)
This commit is contained in:
parent
3442c25b9f
commit
0efd02b49d
5 changed files with 29 additions and 14 deletions
|
@ -48,7 +48,7 @@ export default function({ getService, getPageObjects }) {
|
|||
|
||||
log.debug('create long_window_logstash index pattern');
|
||||
// NOTE: long_window_logstash load does NOT create index pattern
|
||||
await PageObjects.settings.createIndexPattern('long-window-logstash-');
|
||||
await PageObjects.settings.createIndexPattern('long-window-logstash-*');
|
||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||
await browser.refresh();
|
||||
|
||||
|
|
|
@ -59,9 +59,9 @@ export default function({ getService, getPageObjects }) {
|
|||
|
||||
it('should create shakespeare index pattern', async function() {
|
||||
log.debug('Create shakespeare index pattern');
|
||||
await PageObjects.settings.createIndexPattern('shakes', null);
|
||||
await PageObjects.settings.createIndexPattern('shakespeare', null);
|
||||
const patternName = await PageObjects.settings.getIndexPageHeading();
|
||||
expect(patternName).to.be('shakes*');
|
||||
expect(patternName).to.be('shakespeare');
|
||||
});
|
||||
|
||||
// https://www.elastic.co/guide/en/kibana/current/tutorial-visualizing.html
|
||||
|
@ -74,7 +74,7 @@ export default function({ getService, getPageObjects }) {
|
|||
log.debug('create shakespeare vertical bar chart');
|
||||
await PageObjects.visualize.navigateToNewVisualization();
|
||||
await PageObjects.visualize.clickVerticalBarChart();
|
||||
await PageObjects.visualize.clickNewSearch('shakes*');
|
||||
await PageObjects.visualize.clickNewSearch('shakespeare');
|
||||
await PageObjects.visChart.waitForVisualization();
|
||||
|
||||
const expectedChartValues = [111396];
|
||||
|
|
|
@ -44,10 +44,7 @@ export default function({ getService, getPageObjects }) {
|
|||
it('should handle special charaters in template input', async () => {
|
||||
await PageObjects.settings.clickAddNewIndexPatternButton();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await PageObjects.settings.setIndexPatternField({
|
||||
indexPatternName: '❤️',
|
||||
expectWildcard: false,
|
||||
});
|
||||
await PageObjects.settings.setIndexPatternField('❤️');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
await retry.try(async () => {
|
||||
|
|
|
@ -334,7 +334,7 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
|
|||
}
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await retry.try(async () => {
|
||||
await this.setIndexPatternField({ indexPatternName });
|
||||
await this.setIndexPatternField(indexPatternName);
|
||||
});
|
||||
await PageObjects.common.sleep(2000);
|
||||
await (await this.getCreateIndexPatternGoToStep2Button()).click();
|
||||
|
@ -375,14 +375,32 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
|
|||
return indexPatternId;
|
||||
}
|
||||
|
||||
async setIndexPatternField({ indexPatternName = 'logstash-', expectWildcard = true } = {}) {
|
||||
async setIndexPatternField(indexPatternName = 'logstash-*') {
|
||||
log.debug(`setIndexPatternField(${indexPatternName})`);
|
||||
const field = await this.getIndexPatternField();
|
||||
await field.clearValue();
|
||||
await field.type(indexPatternName, { charByChar: true });
|
||||
if (
|
||||
indexPatternName.charAt(0) === '*' &&
|
||||
indexPatternName.charAt(indexPatternName.length - 1) === '*'
|
||||
) {
|
||||
// this is a special case when the index pattern name starts with '*'
|
||||
// like '*:makelogs-*' where the UI will not append *
|
||||
await field.type(indexPatternName, { charByChar: true });
|
||||
} else if (indexPatternName.charAt(indexPatternName.length - 1) === '*') {
|
||||
// the common case where the UI will append '*' automatically so we won't type it
|
||||
const tempName = indexPatternName.slice(0, -1);
|
||||
await field.type(tempName, { charByChar: true });
|
||||
} else {
|
||||
// case where we don't want the * appended so we'll remove it if it was added
|
||||
await field.type(indexPatternName, { charByChar: true });
|
||||
const tempName = await field.getAttribute('value');
|
||||
if (tempName.length > indexPatternName.length) {
|
||||
await field.type(browser.keys.DELETE, { charByChar: true });
|
||||
}
|
||||
}
|
||||
const currentName = await field.getAttribute('value');
|
||||
log.debug(`setIndexPatternField set to ${currentName}`);
|
||||
expect(currentName).to.eql(`${indexPatternName}${expectWildcard ? '*' : ''}`);
|
||||
expect(currentName).to.eql(indexPatternName);
|
||||
}
|
||||
|
||||
async getCreateIndexPatternGoToStep2Button() {
|
||||
|
|
|
@ -76,7 +76,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
|
|||
}
|
||||
|
||||
it('should show correct node labels', async function() {
|
||||
await PageObjects.graph.selectIndexPattern('secrepo*');
|
||||
await PageObjects.graph.selectIndexPattern('secrepo');
|
||||
await buildGraph();
|
||||
const { nodes } = await PageObjects.graph.getGraphObjects();
|
||||
const circlesText = nodes.map(({ label }) => label);
|
||||
|
@ -120,7 +120,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
it('should create new Graph workspace', async function() {
|
||||
await PageObjects.graph.newGraph();
|
||||
await PageObjects.graph.selectIndexPattern('secrepo*');
|
||||
await PageObjects.graph.selectIndexPattern('secrepo');
|
||||
const { nodes, edges } = await PageObjects.graph.getGraphObjects();
|
||||
expect(nodes).to.be.empty();
|
||||
expect(edges).to.be.empty();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue