Should GUI tests work with a standard look?

I am working on an application that has a special look. To test the GUI, I use FEST-Swing. Currently, GUI tests work with a standard java interface. Because of this, some tests fail, but should I consider this to be a bug in the GUI or a test using my user appearance?

Next edit:

Thanks to Andrew Thompson for the quick reply. But the problem that I think still remains, due to how the layout works. Here is a layout of what is happening:

enter image description here

Standard LAF uses a larger font than the one I use, and this causes one of the buttons to go out of layout. And I can not use pack () since this container requires a size requirement. If you did not call frame.pack () in this example, I think you will have the same problem.

+4
source share
2 answers

some buttons are too large and do not appear in the window. I believe this is a bug in the GUI.

Yes. It seems that the current GUI is very fragile. See an example of a nested layout for a graphical interface that works in any PLAF.

Jaqap.png

+5
source

You must test using your own look! This is not a bug in the GUI per se.

Standard LAF uses a larger font than the one I use, and this forces one of the buttons to exit the layout. And I can not use pack () since this container requires a size requirement. if you did not call frame.pack () in this example, I think you will have the same question.

You have a size requirement for the container. This means that with the standard LAF, no LayoutManager could calculate any layout of the components in the container so that they all comply with the LAF standard, because, as you point out, they are simply too large. This means that you cannot have a standard LAF and size requirements.

While you use only your own LAF and test it with this custom LAF on all supported OS systems and no tests fail, everything is in order. So just change your tests and switch to your custom LAF before doing the tests.

If you ever want to run your application in standard LAF, you will need to cancel the size requirement until everything is correctly displayed using the appropriate LayoutManager. For example, with MigLayout, you can easily set all these size requirements and still use pack () in the JFrame at the end.

edit: I agree with Andrew that you should critically consider the need for size requirements. In many cases, these requirements are not required, and their drop significantly reduces the "failures" in the layout. For example, you can simply specify the minimum size for the container.

+1
source

Source: https://habr.com/ru/post/1480668/


All Articles