Skip to content

Commit

Permalink
[7.x] simplify new index pattern button click method (#62451) (#62641)
Browse files Browse the repository at this point in the history
* simplify new index pattern button click method

* replace method name to match previous commit

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
Lee Drengenberg and elasticmachine authored Apr 7, 2020
1 parent a03b40e commit 8de57b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function({ getService, getPageObjects }) {

describe('special character handling', () => {
it('should handle special charaters in template input', async () => {
await PageObjects.settings.clickOptionalAddNewButton();
await PageObjects.settings.clickAddNewIndexPatternButton();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.setIndexPatternField({
indexPatternName: '❤️',
Expand Down
9 changes: 3 additions & 6 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
await PageObjects.header.waitUntilLoadingHasFinished();
await this.clickKibanaIndexPatterns();
await PageObjects.header.waitUntilLoadingHasFinished();
await this.clickOptionalAddNewButton();
await this.clickAddNewIndexPatternButton();
if (!isStandardIndexPattern) {
await this.clickCreateNewRollupButton();
}
Expand Down Expand Up @@ -356,11 +356,8 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
return await this.getIndexPatternIdFromUrl();
}

// adding a method to check if the create index pattern button is visible when more than 1 index pattern is present
async clickOptionalAddNewButton() {
if (await testSubjects.isDisplayed('createIndexPatternButton')) {
await testSubjects.click('createIndexPatternButton');
}
async clickAddNewIndexPatternButton() {
await testSubjects.click('createIndexPatternButton');
}

async clickCreateNewRollupButton() {
Expand Down

0 comments on commit 8de57b6

Please sign in to comment.