Skip to content

Commit 6713443

Browse files
[Functional][TSVB] Wait for markdown textarea to be cleaned (#85128) (#85371)
* [TSVB] Wait for markdown textarea to be cleaned * No need for retry Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent a275443 commit 6713443

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

test/functional/page_objects/visual_builder_page.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
131131
}
132132

133133
public async enterMarkdown(markdown: string) {
134-
const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea');
135134
await this.clearMarkdown();
135+
const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea');
136136
await input.type(markdown);
137137
await PageObjects.common.sleep(3000);
138138
}
@@ -147,14 +147,20 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
147147
const value = $('.ace_line').text();
148148
if (value.length > 0) {
149149
log.debug('Clearing text area input');
150-
const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea');
151-
await input.clearValueWithKeyboard();
150+
this.waitForMarkdownTextAreaCleaned();
152151
}
153152

154153
return value.length === 0;
155154
});
156155
}
157156

157+
public async waitForMarkdownTextAreaCleaned() {
158+
const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea');
159+
await input.clearValueWithKeyboard();
160+
const text = await this.getMarkdownText();
161+
return text.length === 0;
162+
}
163+
158164
public async getMarkdownText(): Promise<string> {
159165
const el = await find.byCssSelector('.tvbEditorVisualization');
160166
const text = await el.getVisibleText();

0 commit comments

Comments
 (0)