From ab5dc59e4796d5d245f92602fa4b3bd7d12382cb Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Thu, 18 Apr 2024 22:36:15 -0500 Subject: [PATCH] simplify code, add retry --- test/functional/page_objects/settings_page.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/functional/page_objects/settings_page.ts b/test/functional/page_objects/settings_page.ts index d68ad3747509a..822abbc0ba008 100644 --- a/test/functional/page_objects/settings_page.ts +++ b/test/functional/page_objects/settings_page.ts @@ -787,7 +787,12 @@ export class SettingsPageObject extends FtrService { ) { await this.clickAddField(); await this.setFieldName(name); - await this.setFieldTypeComposite(); + + await this.retry.try(async () => { + await this.setFieldType('Composite'); + const comboBox = await this.testSubjects.find('typeField'); + expect(await this.comboBox.isOptionSelected(comboBox, 'Composite')).to.be(true); + }); await this.setCompositeScript(script); if (subfieldCount > 0) { await this.testSubjects.find(`typeField_${subfieldCount - 1}`); @@ -878,12 +883,6 @@ export class SettingsPageObject extends FtrService { await this.comboBox.set('typeField', type); } - async setFieldTypeComposite() { - this.log.debug('set type = Composite'); - const comboBox = await this.testSubjects.find('typeField'); - this.comboBox.setElement(comboBox, 'Composite'); - } - async setFieldScript(script: string) { this.log.debug('set script = ' + script); await this.toggleRow('valueRow');