Skip to content

Commit 6d6e84e

Browse files
javier-godoypaodb
authored andcommitted
test: fix flaky SelectionFeatureIT test
Close #107
1 parent 1e58d9a commit 6d6e84e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/test/java/com/flowingcode/vaadin/addons/xterm/integration/XTermElement.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* XTerm Console Addon
44
* %%
5-
* Copyright (C) 2020 - 2023 Flowing Code
5+
* Copyright (C) 2020 - 2026 Flowing Code
66
* %%
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -86,6 +86,11 @@ public void setPrompt(String value) {
8686
@Override
8787
public void sendKeys(CharSequence... keysToSend) {
8888
input.sendKeys(keysToSend);
89+
// Wait for terminal to process writes by using a write callback
90+
getCommandExecutor().getDriver().executeAsyncScript("""
91+
var callback = arguments[arguments.length - 1];
92+
arguments[0].terminal.write('', callback);
93+
""", this);
8994
}
9095

9196
@Override

0 commit comments

Comments
 (0)