From 640f3c2d627ad4a9693fbfbd5361682ab1069b2a Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Mon, 12 Jul 2021 17:35:56 +0200 Subject: [PATCH 1/5] unskipped test and added additional checks when using time picker --- test/functional/page_objects/time_picker.ts | 8 ++++++++ x-pack/test/functional/apps/discover/reporting.ts | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/functional/page_objects/time_picker.ts b/test/functional/page_objects/time_picker.ts index e8f6afc365f5d..4a76dc1cc9b35 100644 --- a/test/functional/page_objects/time_picker.ts +++ b/test/functional/page_objects/time_picker.ts @@ -7,6 +7,7 @@ */ import moment from 'moment'; +import expect from '@kbn/expect'; import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; @@ -125,6 +126,9 @@ export class TimePickerPageObject extends FtrService { await this.inputValue('superDatePickerAbsoluteDateInput', toTime); await this.browser.pressKeys(this.browser.keys.ESCAPE); // close popover because sometimes browser can't find start input + const endDateButton = await this.testSubjects.find('superDatePickerendDatePopoverButton'); + expect(await endDateButton.getVisibleText()).to.be(toTime); + // set from time await this.testSubjects.click('superDatePickerstartDatePopoverButton'); await this.waitPanelIsGone(panel); @@ -132,6 +136,10 @@ export class TimePickerPageObject extends FtrService { await this.testSubjects.click('superDatePickerAbsoluteTab'); await this.testSubjects.click('superDatePickerAbsoluteDateInput'); await this.inputValue('superDatePickerAbsoluteDateInput', fromTime); + await this.browser.pressKeys(this.browser.keys.ESCAPE); // close popover because sometimes browser can't find start input + + const startDateButton = await this.testSubjects.find('superDatePickerstartDatePopoverButton'); + expect(await startDateButton.getVisibleText()).to.be(fromTime); const superDatePickerApplyButtonExists = await this.testSubjects.exists( 'superDatePickerApplyTimeButton' diff --git a/x-pack/test/functional/apps/discover/reporting.ts b/x-pack/test/functional/apps/discover/reporting.ts index 0b018b4428e1d..3eb66204df564 100644 --- a/x-pack/test/functional/apps/discover/reporting.ts +++ b/x-pack/test/functional/apps/discover/reporting.ts @@ -73,8 +73,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/104372 - describe.skip('Generate CSV: new search', () => { + describe('Generate CSV: new search', () => { beforeEach(async () => { await kibanaServer.importExport.load(ecommerceSOPath); await PageObjects.common.navigateToApp('discover'); From 8631812c2aec9d47e948ffc9f707cbf1feb480ba Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Tue, 13 Jul 2021 10:11:49 +0200 Subject: [PATCH 2/5] rather wait for the timepicker to close --- test/functional/page_objects/time_picker.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/functional/page_objects/time_picker.ts b/test/functional/page_objects/time_picker.ts index 4a76dc1cc9b35..00133d720d884 100644 --- a/test/functional/page_objects/time_picker.ts +++ b/test/functional/page_objects/time_picker.ts @@ -7,7 +7,6 @@ */ import moment from 'moment'; -import expect from '@kbn/expect'; import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; @@ -126,9 +125,6 @@ export class TimePickerPageObject extends FtrService { await this.inputValue('superDatePickerAbsoluteDateInput', toTime); await this.browser.pressKeys(this.browser.keys.ESCAPE); // close popover because sometimes browser can't find start input - const endDateButton = await this.testSubjects.find('superDatePickerendDatePopoverButton'); - expect(await endDateButton.getVisibleText()).to.be(toTime); - // set from time await this.testSubjects.click('superDatePickerstartDatePopoverButton'); await this.waitPanelIsGone(panel); @@ -136,10 +132,11 @@ export class TimePickerPageObject extends FtrService { await this.testSubjects.click('superDatePickerAbsoluteTab'); await this.testSubjects.click('superDatePickerAbsoluteDateInput'); await this.inputValue('superDatePickerAbsoluteDateInput', fromTime); - await this.browser.pressKeys(this.browser.keys.ESCAPE); // close popover because sometimes browser can't find start input + await this.browser.pressKeys(this.browser.keys.ESCAPE); - const startDateButton = await this.testSubjects.find('superDatePickerstartDatePopoverButton'); - expect(await startDateButton.getVisibleText()).to.be(fromTime); + await this.retry.waitFor('Timepicker popover to close', async () => { + return !(await this.testSubjects.exists('superDatePickerAbsoluteDateInput')); + }); const superDatePickerApplyButtonExists = await this.testSubjects.exists( 'superDatePickerApplyTimeButton' From 98a125bdfe33a6ba9804eb5ddb54ab50e472fbc1 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Tue, 13 Jul 2021 10:12:37 +0200 Subject: [PATCH 3/5] set up test for flaky test runner --- x-pack/test/functional/apps/discover/reporting.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/discover/reporting.ts b/x-pack/test/functional/apps/discover/reporting.ts index 3eb66204df564..19e25ff9dd12f 100644 --- a/x-pack/test/functional/apps/discover/reporting.ts +++ b/x-pack/test/functional/apps/discover/reporting.ts @@ -73,7 +73,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('Generate CSV: new search', () => { + // TODO: Remove .only + describe.only('Generate CSV: new search', () => { beforeEach(async () => { await kibanaServer.importExport.load(ecommerceSOPath); await PageObjects.common.navigateToApp('discover'); From e74a7c7410add3ffdecf572ae749d962769bbaeb Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Tue, 13 Jul 2021 13:30:08 +0200 Subject: [PATCH 4/5] Additional .only --- x-pack/test/functional/apps/discover/reporting.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/discover/reporting.ts b/x-pack/test/functional/apps/discover/reporting.ts index 19e25ff9dd12f..ae7b63833d0ea 100644 --- a/x-pack/test/functional/apps/discover/reporting.ts +++ b/x-pack/test/functional/apps/discover/reporting.ts @@ -132,7 +132,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('Generate CSV: archived search', () => { + // TODO: Remove .only + describe.only('Generate CSV: archived search', () => { const setupPage = async () => { const fromTime = 'Apr 27, 2019 @ 23:56:51.374'; const toTime = 'Aug 23, 2019 @ 16:18:51.821'; From c5cd4041a4503d62ab04663033dad0771ca86074 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Wed, 14 Jul 2021 15:47:57 +0200 Subject: [PATCH 5/5] Remove .only --- x-pack/test/functional/apps/discover/reporting.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/test/functional/apps/discover/reporting.ts b/x-pack/test/functional/apps/discover/reporting.ts index ae7b63833d0ea..3eb66204df564 100644 --- a/x-pack/test/functional/apps/discover/reporting.ts +++ b/x-pack/test/functional/apps/discover/reporting.ts @@ -73,8 +73,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - // TODO: Remove .only - describe.only('Generate CSV: new search', () => { + describe('Generate CSV: new search', () => { beforeEach(async () => { await kibanaServer.importExport.load(ecommerceSOPath); await PageObjects.common.navigateToApp('discover'); @@ -132,8 +131,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - // TODO: Remove .only - describe.only('Generate CSV: archived search', () => { + describe('Generate CSV: archived search', () => { const setupPage = async () => { const fromTime = 'Apr 27, 2019 @ 23:56:51.374'; const toTime = 'Aug 23, 2019 @ 16:18:51.821';