Skip to content

Commit

Permalink
Add a slight delay before selecting a visualization type (elastic#169851
Browse files Browse the repository at this point in the history
)

## Summary

Attempt at fixing elastic#89958

As per my [latest
comment](elastic#89958 (comment))
on the issue, I believe that the test logic sometimes fails to select
the appropriate visualisation type, in this case `Text` (aka markdown).

The failure manifests [a couple of steps
later](https://github.com/elastic/kibana/blob/main/x-pack/test/saved_object_tagging/functional/tests/visualize_integration.ts#L155),
as this operation does not meet the expected "before state".

The strategy of this fix consists in introducing an extra step,
searching for the visualisation type, which should give the UI enough
time to attach an event handler to the control.

(cherry picked from commit 3d19006)
  • Loading branch information
gsoldevila committed Oct 26, 2023
1 parent 6194ad3 commit 2e2b4ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions test/functional/page_objects/visualize_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ export class VisualizePageObject extends FtrService {
}

public async clickVisType(type: string) {
// checking for the existence of the control gives the UI more time to bind a click handler
// see https://github.com/elastic/kibana/issues/89958
if (!(await this.hasVisType(type))) {
throw new Error(`The '${type}' visualization type does not exist (visType-${type})`);
}
await this.testSubjects.click(`visType-${type}`);
await this.header.waitUntilLoadingHasFinished();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/89958
describe.skip('creating', () => {
describe('creating', () => {
before(async () => {
await PageObjects.visualize.gotoVisualizationLandingPage();
// delete all visualizations to create new ones explicitly
Expand Down

0 comments on commit 2e2b4ff

Please sign in to comment.