Skip to content

Commit

Permalink
retry reading suggestion list (elastic#116405)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
flash1293 and kibanamachine authored Oct 28, 2021
1 parent 3424f94 commit 2b15dc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions test/functional/apps/visualize/_timelion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
expect(value).to.eql('.es()');
});

// FLAKY: https://github.com/elastic/kibana/issues/116033
describe.skip('dynamic suggestions for argument values', () => {
describe('dynamic suggestions for argument values', () => {
describe('.es()', () => {
it('should show index pattern suggestions for index argument', async () => {
await monacoEditor.setCodeEditorValue('');
Expand Down
12 changes: 10 additions & 2 deletions test/functional/page_objects/timelion_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@
*/

import { FtrService } from '../ftr_provider_context';
import type { WebElementWrapper } from '../services/lib/web_element_wrapper';

export class TimelionPageObject extends FtrService {
private readonly testSubjects = this.ctx.getService('testSubjects');
private readonly retry = this.ctx.getService('retry');

public async getSuggestionItemsText() {
const timelionCodeEditor = await this.testSubjects.find('timelionCodeEditor');
const lists = await timelionCodeEditor.findAllByClassName('monaco-list-row');
let lists: WebElementWrapper[] = [];
await this.retry.try(async () => {
const timelionCodeEditor = await this.testSubjects.find('timelionCodeEditor');
lists = await timelionCodeEditor.findAllByClassName('monaco-list-row');
if (lists.length === 0) {
throw new Error('suggestion list not populated');
}
});
return await Promise.all(lists.map(async (element) => await element.getVisibleText()));
}

Expand Down

0 comments on commit 2b15dc9

Please sign in to comment.