Skip to content

Commit

Permalink
[FTR] unskip tsvb time series tests for Chrome (#163510)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
dmlemeshko authored Aug 10, 2023
1 parent d5d34c6 commit 072ad96
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
6 changes: 3 additions & 3 deletions test/functional/apps/visualize/group5/_tsvb_time_series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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');

Expand Down
29 changes: 18 additions & 11 deletions test/functional/page_objects/visual_builder_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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);
}

Expand All @@ -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) {
Expand Down

0 comments on commit 072ad96

Please sign in to comment.