From fc50077de2209a415856bd2e2f8e5aa77166edfc Mon Sep 17 00:00:00 2001 From: sulemanof Date: Thu, 2 Apr 2020 12:50:58 +0300 Subject: [PATCH 1/5] Unskip --- test/functional/apps/discover/_field_visualize.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/discover/_field_visualize.ts b/test/functional/apps/discover/_field_visualize.ts index 24f4ba592324c..afae121903f6d 100644 --- a/test/functional/apps/discover/_field_visualize.ts +++ b/test/functional/apps/discover/_field_visualize.ts @@ -33,7 +33,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { }; // FLAKY: https://github.com/elastic/kibana/issues/61714 - describe.skip('discover field visualize button', () => { + describe('discover field visualize button', () => { before(async function() { log.debug('load kibana index with default index pattern'); await esArchiver.load('discover'); From 0194ce9c598f943d04cec34b1711cea760c2d88c Mon Sep 17 00:00:00 2001 From: sulemanof Date: Thu, 2 Apr 2020 12:57:15 +0300 Subject: [PATCH 2/5] Set only suite --- test/functional/apps/discover/_field_visualize.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/apps/discover/_field_visualize.ts b/test/functional/apps/discover/_field_visualize.ts index afae121903f6d..842aa74d0998a 100644 --- a/test/functional/apps/discover/_field_visualize.ts +++ b/test/functional/apps/discover/_field_visualize.ts @@ -33,7 +33,8 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { }; // FLAKY: https://github.com/elastic/kibana/issues/61714 - describe('discover field visualize button', () => { + // eslint-disable-next-line ban/ban + describe.only('discover field visualize button', () => { before(async function() { log.debug('load kibana index with default index pattern'); await esArchiver.load('discover'); From 618b0f5800e119a0430c99bb672c91fc039ddab3 Mon Sep 17 00:00:00 2001 From: sulemanof Date: Thu, 2 Apr 2020 16:57:36 +0300 Subject: [PATCH 3/5] Add field search --- test/functional/apps/discover/_field_visualize.ts | 3 +++ test/functional/page_objects/discover_page.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/test/functional/apps/discover/_field_visualize.ts b/test/functional/apps/discover/_field_visualize.ts index 842aa74d0998a..01dd9f692c2b0 100644 --- a/test/functional/apps/discover/_field_visualize.ts +++ b/test/functional/apps/discover/_field_visualize.ts @@ -51,6 +51,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { }); it('should visualize a field in area chart', async () => { + await PageObjects.discover.findFieldByName('phpmemory'); await PageObjects.discover.clickFieldListItem('phpmemory'); log.debug('visualize a phpmemory field'); await PageObjects.discover.clickFieldListItemVisualize('phpmemory'); @@ -84,6 +85,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { it('should preserve app filters in visualize', async () => { await filterBar.addFilter('bytes', 'is between', '3500', '4000'); + await PageObjects.discover.findFieldByName('geo.src'); await PageObjects.discover.clickFieldListItem('geo.src'); log.debug('visualize a geo.src field with filter applied'); await PageObjects.discover.clickFieldListItemVisualize('geo.src'); @@ -120,6 +122,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { it('should preserve query in visualize', async () => { await queryBar.setQuery('machine.os : ios'); await queryBar.submitQuery(); + await PageObjects.discover.findFieldByName('geo.dest'); await PageObjects.discover.clickFieldListItem('geo.dest'); log.debug('visualize a geo.dest field with query applied'); await PageObjects.discover.clickFieldListItemVisualize('geo.dest'); diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 10652ce3ec4b2..b270889939f33 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -40,6 +40,11 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider return await el.getVisibleText(); } + public async findFieldByName(name: string) { + const fieldSearch = await testSubjects.find('fieldFilterSearchInput'); + await fieldSearch.type(name); + } + public async saveSearch(searchName: string) { log.debug('saveSearch'); await this.clickSaveSearchButton(); From cca907611623e14aead320c27db8d0b4437d05ae Mon Sep 17 00:00:00 2001 From: sulemanof Date: Thu, 2 Apr 2020 17:19:17 +0300 Subject: [PATCH 4/5] Use alternative flaky fix --- test/functional/apps/discover/_field_visualize.ts | 3 --- test/functional/page_objects/discover_page.ts | 14 ++++++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/test/functional/apps/discover/_field_visualize.ts b/test/functional/apps/discover/_field_visualize.ts index 01dd9f692c2b0..67a44d076ad35 100644 --- a/test/functional/apps/discover/_field_visualize.ts +++ b/test/functional/apps/discover/_field_visualize.ts @@ -52,7 +52,6 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { it('should visualize a field in area chart', async () => { await PageObjects.discover.findFieldByName('phpmemory'); - await PageObjects.discover.clickFieldListItem('phpmemory'); log.debug('visualize a phpmemory field'); await PageObjects.discover.clickFieldListItemVisualize('phpmemory'); await PageObjects.header.waitUntilLoadingHasFinished(); @@ -86,7 +85,6 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { it('should preserve app filters in visualize', async () => { await filterBar.addFilter('bytes', 'is between', '3500', '4000'); await PageObjects.discover.findFieldByName('geo.src'); - await PageObjects.discover.clickFieldListItem('geo.src'); log.debug('visualize a geo.src field with filter applied'); await PageObjects.discover.clickFieldListItemVisualize('geo.src'); await PageObjects.header.waitUntilLoadingHasFinished(); @@ -123,7 +121,6 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { await queryBar.setQuery('machine.os : ios'); await queryBar.submitQuery(); await PageObjects.discover.findFieldByName('geo.dest'); - await PageObjects.discover.clickFieldListItem('geo.dest'); log.debug('visualize a geo.dest field with query applied'); await PageObjects.discover.clickFieldListItemVisualize('geo.dest'); await PageObjects.header.waitUntilLoadingHasFinished(); diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index b270889939f33..c66562d22270a 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -244,10 +244,16 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider await testSubjects.click(`fieldToggle-${field}`); } - public async clickFieldListItemVisualize(field: string) { - return await retry.try(async () => { - await testSubjects.click(`fieldVisualize-${field}`); - }); + public async clickFieldListItemVisualize(fieldName: string) { + const field = await testSubjects.find(`field-${fieldName}`); + const isActive = await field.elementHasClass('dscSidebarItem--active'); + + if (!isActive) { + // expand the field to show the "Visualize" button + await field.click(); + } + + await testSubjects.click(`fieldVisualize-${fieldName}`); } public async expectFieldListItemVisualize(field: string) { From 265facee3872889ab6830994b4ab6d5fe37ecdba Mon Sep 17 00:00:00 2001 From: sulemanof Date: Fri, 3 Apr 2020 13:35:20 +0300 Subject: [PATCH 5/5] Remove extra actions --- test/functional/apps/discover/_field_visualize.ts | 4 +--- test/functional/page_objects/discover_page.ts | 2 +- x-pack/test/functional/apps/maps/discover.js | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/test/functional/apps/discover/_field_visualize.ts b/test/functional/apps/discover/_field_visualize.ts index 67a44d076ad35..f8f290b259b7e 100644 --- a/test/functional/apps/discover/_field_visualize.ts +++ b/test/functional/apps/discover/_field_visualize.ts @@ -32,9 +32,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { defaultIndex: 'logstash-*', }; - // FLAKY: https://github.com/elastic/kibana/issues/61714 - // eslint-disable-next-line ban/ban - describe.only('discover field visualize button', () => { + describe('discover field visualize button', () => { before(async function() { log.debug('load kibana index with default index pattern'); await esArchiver.load('discover'); diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index c66562d22270a..2377c32a80b5b 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -245,7 +245,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider } public async clickFieldListItemVisualize(fieldName: string) { - const field = await testSubjects.find(`field-${fieldName}`); + const field = await testSubjects.find(`field-${fieldName}-showDetails`); const isActive = await field.elementHasClass('dscSidebarItem--active'); if (!isActive) { diff --git a/x-pack/test/functional/apps/maps/discover.js b/x-pack/test/functional/apps/maps/discover.js index ce33596476755..43a7a93ad62e4 100644 --- a/x-pack/test/functional/apps/maps/discover.js +++ b/x-pack/test/functional/apps/maps/discover.js @@ -17,7 +17,6 @@ export default function({ getService, getPageObjects }) { it('should link geo_shape fields to Maps application', async () => { await PageObjects.discover.selectIndexPattern('geo_shapes*'); - await PageObjects.discover.clickFieldListItem('geometry'); await PageObjects.discover.clickFieldListItemVisualize('geometry'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.maps.waitForLayersToLoad(); @@ -37,7 +36,6 @@ export default function({ getService, getPageObjects }) { await queryBar.submitQuery(); await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.discover.clickFieldListItem('geo.coordinates'); await PageObjects.discover.clickFieldListItemVisualize('geo.coordinates'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.maps.waitForLayersToLoad();