-
Notifications
You must be signed in to change notification settings - Fork 0
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
Nodes are invisible in headless tests for Ludo #72
Labels
Comments
LeStegii
changed the title
Nodes are invisible in headless tests
Nodes are invisible in headless tests for Ludo
Mar 24, 2024
When using a real headless enviroment everything seems to work fine. |
Please use this code for testing: public class BadControllerTest extends ControllerTest {
@Test
void bad() {
try {
FxAssert.verifyThat("some button that does not exist", Node::isVisible, collectInfos());
} catch (Exception ex) {
printInfos();
}
}
public void printInfos() {
System.err.println(collectInfos().apply(new StringBuilder()));
}
public Function<StringBuilder, StringBuilder> collectInfos() {
final Path dir = Paths.get("build", "failed-test-screenshots");
try {
Files.createDirectories(dir);
} catch (IOException e) {
throw new RuntimeException(e);
}
return DebugUtils.compose(
DebugUtils.insertHeader("Context:"),
DebugUtils.showKeysPressedAtTestFailure(this),
DebugUtils.showMouseButtonsPressedAtTestFailure(this),
DebugUtils.showFiredEvents(),
DebugUtils.saveWindow(
stage,
() -> dir.resolve(getClass().getSimpleName() + " " + LocalTime.now() + ".png"),
null));
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Describe the bug
When testing the Ludo game in headless mode, the tests fail because the bot cannot click on nodes (not visible).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The tests shouldn't fail becaues the nodes are visible.
Desktop (please complete the following information):
Additional context
The nodes exist and can be used (e.g. using tabs and enter), but they cannot be found when clicked as they are apparently not visible on screen (see #67)
The text was updated successfully, but these errors were encountered: