1

I'm trying to write test on for JavaFx, which will work on headless CI. When I run my tests in normal way, all tests work properly, but if I run them on CI they don't. It seems that FxRobot doesn't click some element in proper way, because I get error like:

Expected: Buttton is disabled
     but: was <Button[id=restart, styleClass=button_restart]'RESTART'>

As I said, all of those tests pass locally. I run test with command:

mvn test -Dtestfx.robot=glass -Dtestfx.headless=true -Dglass.platform=Monocle -Dmonocle.platform=Headless -Dprism.order=sw -Dprism.text=t2k -Dprism.verbose=true 

I m using Java 11, TestFx 4

blue rabbit
  • 139
  • 1
  • 13
  • Have you read the screenbot write up here? I wonder if it applies? https://ustesis.wordpress.com/2014/04/23/headless-ui-testing-with-testfx-and-javafx-8/. It's an old writeup, sorry if the information is dated. – tresf Feb 09 '20 at 06:48

1 Answers1

0

If you run CI on a linux headless server, you need to run it with the xvfb tool, which simulates a graphical interface.

For specific instructions on how to set it up, search the docs of your CI provider for "xvfb", or provide your specific CI tool (Travis-CI, Circle-CI, etc).

AdminOfThis
  • 191
  • 3