From 072ad967fc04e2b79bf75fd9e6618f3bf0e46b9f Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Thu, 10 Aug 2023 09:17:12 +0200 Subject: [PATCH] [FTR] unskip tsvb time series tests for Chrome (#163510) ## Summary Related to #162995 This PR unskip TSVB tests for Chrome browser since it is proved to be stable https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2836 100x passed https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2835 100x passed On Firefox the flakiness is related to Terms 2nd aggregation field sometimes is not selected. I tested it manually in Firefox 116 and was able to set fields, though I have a feeling that values are not always selected on click in the drop-down. But I didn't see any errors in console. I also returned back retry for dropdown selection I removed in #161202 though flaky-test-runner proves there is no need. Let's have just to keep logic as before my PR. --- .../visualize/group5/_tsvb_time_series.ts | 6 ++-- .../page_objects/visual_builder_page.ts | 29 ++++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/test/functional/apps/visualize/group5/_tsvb_time_series.ts b/test/functional/apps/visualize/group5/_tsvb_time_series.ts index 28aa95ad24263..eec30c52018a7 100644 --- a/test/functional/apps/visualize/group5/_tsvb_time_series.ts +++ b/test/functional/apps/visualize/group5/_tsvb_time_series.ts @@ -23,8 +23,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const browser = getService('browser'); const kibanaServer = getService('kibanaServer'); - // Failing: See https://github.com/elastic/kibana/issues/162995 - describe.skip('visual builder', function describeIndexTests() { + describe('visual builder', function describeIndexTests() { before(async () => { await security.testUser.setRoles([ 'kibana_admin', @@ -167,7 +166,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); }); - describe('Clicking on the chart', () => { + describe('Clicking on the chart', function () { + this.tags('skipFirefox'); const act = async (visName: string, clickCoordinates: { x: number; y: number }) => { await testSubjects.click('visualizeSaveButton'); diff --git a/test/functional/page_objects/visual_builder_page.ts b/test/functional/page_objects/visual_builder_page.ts index 67a8dd42b9ec1..4c5939f728f01 100644 --- a/test/functional/page_objects/visual_builder_page.ts +++ b/test/functional/page_objects/visual_builder_page.ts @@ -7,7 +7,6 @@ */ import type { DebugState } from '@elastic/charts'; -import expect from '@kbn/expect'; import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; @@ -845,10 +844,14 @@ export class VisualBuilderPageObject extends FtrService { ) { await this.setMetricsGroupBy('terms'); await this.common.sleep(1000); - const byField = await this.testSubjects.find('groupByField'); - await this.comboBox.setElement(byField, field); - const isSelected = await this.comboBox.isOptionSelected(byField, field); - expect(isSelected).to.be(true); + await this.retry.try(async () => { + const byField = await this.testSubjects.find('groupByField'); + await this.comboBox.setElement(byField, field); + const isSelected = await this.comboBox.isOptionSelected(byField, field); + if (!isSelected) { + throw new Error(`setMetricsGroupByTerms: failed to set '${field}' field`); + } + }); await this.setMetricsGroupByFiltering(filtering.include, filtering.exclude); } @@ -860,13 +863,17 @@ export class VisualBuilderPageObject extends FtrService { // In case of StaleElementReferenceError 'browser' service will try to find element again await fieldSelectAddButtonLast.click(); await this.common.sleep(2000); - const selectedByField = await this.find.byXPath( - `(//*[@data-test-subj='fieldSelectItem'])[last()]` - ); - await this.comboBox.setElement(selectedByField, field); - const isSelected = await this.comboBox.isOptionSelected(selectedByField, field); - expect(isSelected).to.be(true); + await this.retry.try(async () => { + const selectedByField = await this.find.byXPath( + `(//*[@data-test-subj='fieldSelectItem'])[last()]` + ); + await this.comboBox.setElement(selectedByField, field); + const isSelected = await this.comboBox.isOptionSelected(selectedByField, field); + if (!isSelected) { + throw new Error(`setAnotherGroupByTermsField: failed to set '${field}' field`); + } + }); } public async setMetricsGroupByFiltering(include?: string, exclude?: string) {