mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
This commit is contained in:
parent
57f5c673e4
commit
dca4772e84
4 changed files with 10 additions and 11 deletions
|
@ -44,7 +44,6 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
it('should create shakespeare index pattern', async function () {
|
||||
log.debug('Create shakespeare index pattern');
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.createIndexPattern('shakes', null);
|
||||
const indexPageHeading = await PageObjects.settings.getIndexPageHeading();
|
||||
const patternName = await indexPageHeading.getVisibleText();
|
||||
|
|
|
@ -47,7 +47,6 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
|
||||
it('should be able to create index pattern without time field', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.createIndexPattern('alias1', null);
|
||||
const indexPageHeading = await PageObjects.settings.getIndexPageHeading();
|
||||
const patternName = await indexPageHeading.getVisibleText();
|
||||
|
@ -64,7 +63,6 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
|
||||
it('should be able to create index pattern with timefield', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.createIndexPattern('alias2', 'date');
|
||||
const indexPageHeading = await PageObjects.settings.getIndexPageHeading();
|
||||
const patternName = await indexPageHeading.getVisibleText();
|
||||
|
|
|
@ -277,6 +277,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
|
|||
await this.clickKibanaIndices();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await this.clickOptionalAddNewButton();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await retry.try(async () => {
|
||||
await this.setIndexPatternField(indexPatternName);
|
||||
});
|
||||
|
@ -302,15 +303,9 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
|
|||
return await this.getIndexPatternIdFromUrl();
|
||||
}
|
||||
|
||||
//adding a method to check if the create index pattern button is visible(while adding more than 1 index pattern)
|
||||
|
||||
// adding a method to check if the create index pattern button is visible when more than 1 index pattern is present
|
||||
async clickOptionalAddNewButton() {
|
||||
const buttonParent = await testSubjects.find('createIndexPatternParent');
|
||||
const buttonVisible = (await buttonParent.getProperty('innerHTML')).includes(
|
||||
'createIndexPatternButton'
|
||||
);
|
||||
log.debug('found the button ' + buttonVisible);
|
||||
if (buttonVisible) {
|
||||
if (await testSubjects.isDisplayed('createIndexPatternButton')) {
|
||||
await testSubjects.click('createIndexPatternButton');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,6 +152,13 @@ export function TestSubjectsProvider({ getService }) {
|
|||
});
|
||||
}
|
||||
|
||||
async isDisplayed(selector) {
|
||||
return await retry.try(async () => {
|
||||
const element = await this.find(selector);
|
||||
return await element.isDisplayed();
|
||||
});
|
||||
}
|
||||
|
||||
async isSelected(selector) {
|
||||
return await retry.try(async () => {
|
||||
const element = await this.find(selector);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue