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

Test Automation: Some tests do not work on Windows when using AWT Robot Adapter #588

Closed
afester opened this issue Sep 22, 2017 · 8 comments

Comments

@afester
Copy link
Collaborator

afester commented Sep 22, 2017

By default, TestFX uses the "awt" robot adapter. At least on Windows, this results in the SHIFT key not properly handled when selecting text. RichTextFX test cases such as those in the ShiftDown test suite are then failing.
When setting the property testfx.robot to glass, text selection with the pressed shift key works and those test cases succeed.

The solution for the gradle build is to add integrationTest.systemProperty "testfx.robot", "glass" to the build file. (Will submitt a pull request after checking the same on Linux).

See also https://github.com/TomasMikula/RichTextFX/wiki/Test-Automation

@JordanMartinez
Copy link
Contributor

Good to know. I'll wait for your PR

@afester
Copy link
Collaborator Author

afester commented Sep 23, 2017

I verified that the tests are running fine on X11 / Linux with the glass robot - would you be fine with setting the testfx.robot property to glass independant of the OS? Someone should test on Mac, though ;-)

BTW: Those integration tests are really cool. Can we establish a policy so that we accept pull requests only if a corresponding test is provided? :-)

@JordanMartinez
Copy link
Contributor

Someone should test on Mac, though

I think the headless Travis build uses the glass robot anyways, so I don't know if we need to test it on a mac. Mind submitting a PR?

Can we establish a policy so that we accept pull requests only if a corresponding test is provided?

It would be ideal, but we should clean up the tests that we have right now. When I first wrote them, I wasn't going for accuracy as much as I was just trying to prove that the code works. So, some tests should have a few additional checks that aren't currently there right now.

@JordanMartinez
Copy link
Contributor

Closed by #589

@JordanMartinez
Copy link
Contributor

@afester Can you list which tests failed on Windows when the awt robot adapter was used? I'd like to have this build on both adapters on Windows in the CI build if possible. I'm not sure if the tests are flaky or not.

@afester
Copy link
Collaborator Author

afester commented Oct 2, 2017

I quickly run the tests from within Eclipse, using the awt robot. The failures are usually compare assertions (selection does not match the expected text) while the errors are usually something like java.lang.IllegalArgumentException: Invalid key code. I also added my "counter" workaround for waitForMultiLineRegistration so that pressing_up_moves_caret_to_previous_line does not block the test execution (and that test than fails with a timeout):

image

@afester
Copy link
Collaborator Author

afester commented Oct 2, 2017

BTW: I think this is more a TestFX issue. I have written this simple pure JavaFX test case: https://github.com/afester/FranzXaver/blob/testfx/Examples/src/main/java/afester/javafx/examples/testfx/SelectionTestFXExample.java and it also failes with the awt robot. I see the cursor moving in the input text field, but the text does not get selected. With the glass robot, this worked immediately.

@JordanMartinez JordanMartinez reopened this Oct 2, 2017
@JordanMartinez JordanMartinez changed the title Test Automation: TestFX requires system property testfx.robot=glass Test Automation: Some tests do not work on Windows when using AWT Robot Adapter Oct 3, 2017
@JordanMartinez
Copy link
Contributor

The tests in question are currently skipped when using the AWT robot adapter (see #596), so that one can still build the project without needing to specify this directly. Still, it'll be better to learn more about the issue in the mentioned TestFX issue.

@Jugen Jugen closed this as completed May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants