Skip to content

Commit

Permalink
bump SDK version and add await to failing test (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr authored Nov 28, 2024
1 parent 2187ede commit e00a5b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
os: [ macos-latest, ubuntu-latest, windows-latest ]
include:
- os: macos-latest
FILE: openjfx-24+879_headless_mac-aarch64_bin-sdk
FILE: openjfx-24+884_headless_mac-aarch64_bin-sdk
- os: ubuntu-latest
FILE: openjfx-24+876_headless_linux-x86_64_bin-sdk
FILE: openjfx-24+881_headless_linux-x86_64_bin-sdk
- os: windows-latest
FILE: openjfx-24+880_headless_windows-x86_64_bin-sdk
FILE: openjfx-24+885_headless_windows-x86_64_bin-sdk

runs-on: ${{ matrix.os }}
timeout-minutes: 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import javafx.beans.InvalidationListener;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.MouseButton;
import javafx.stage.Stage;

import org.junit.Rule;
Expand Down Expand Up @@ -50,12 +49,12 @@ public void init() throws Exception {
@Override
public void start(Stage stage) {
CountDownLatch setSceneLatch = new CountDownLatch(1);
setButtonTextLatch = new CountDownLatch(1);
InvalidationListener invalidationListener = observable -> setSceneLatch.countDown();
stage.sceneProperty().addListener(observable -> {
setSceneLatch.countDown();
stage.sceneProperty().removeListener(invalidationListener);
});
setButtonTextLatch = new CountDownLatch(1);
Button button = new Button("click me!");
button.setOnAction(actionEvent -> {
button.setText("clicked!");
Expand Down Expand Up @@ -85,13 +84,12 @@ public void should_contain_button() {
}

@Test(timeout = 3000)
public void should_click_on_button() {
public void should_click_on_button() throws InterruptedException {
// when:
moveTo(".button");
press(MouseButton.PRIMARY);
release(MouseButton.PRIMARY);
clickOn(".button");

// then:
setButtonTextLatch.await(3, TimeUnit.SECONDS);
verifyThat(".button", hasText("clicked!"), informedErrorMessage(this));
}

Expand Down

0 comments on commit e00a5b4

Please sign in to comment.