Skip to content

Commit 64874a0

Browse files
javier-godoymlopezFC
authored andcommitted
test: fix flaky XTermIT test
1 parent df215bf commit 64874a0

File tree

1 file changed

+4
-2
lines changed
  • src/test/java/com/flowingcode/vaadin/addons/xterm/integration

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static org.hamcrest.Matchers.is;
2323
import static org.hamcrest.Matchers.not;
2424
import static org.junit.Assert.assertThat;
25+
import com.vaadin.testbench.HasTestBenchCommandExecutor;
2526
import com.vaadin.testbench.TestBenchElement;
2627
import org.hamcrest.Description;
2728
import org.hamcrest.Matcher;
@@ -64,8 +65,9 @@ public void componentWorks() {
6465
@Test
6566
public void writeText() throws InterruptedException {
6667
TestBenchElement term = $("fc-xterm").first();
67-
WebElement input =
68-
(WebElement) getCommandExecutor().executeScript("return document.activeElement");
68+
69+
WebElement input = (WebElement) waitUntil(driver -> ((HasTestBenchCommandExecutor) driver)
70+
.getCommandExecutor().executeScript("return arguments[0].terminal.textarea", term));
6971

7072
int y = cursorPosition(term).y;
7173

0 commit comments

Comments
 (0)