retry reading suggestion list (#116405)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
3424f94fb4
commit
2b15dc9b10
|
@ -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('');
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue