Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump SDK version and add await to failing test #19

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading