Testing is not getting any better

There is an old thread about missing Testing documentation in Jmix (it was available in CUBA).

From there, @krivopustov :

We are constantly working on the documentation and updating it as soon as new sections are ready, usually each week.

Until there is something about testing in the docs, I will explain how to write integration tests for business logic and UI with examples.

The situation around testing does not seem to have improved much. And maybe gotten worse:

For all but UI it seems that there is one way to do it. The one explained in the thread above, also shown in @mario 's rent-your-stuff.

There’s still no documentation about this that I could find, but this is pretty much standard Java / Spring so not that bad.

UI testing is a whole other story. And you must test your UI!! A quick glance will show you:

It would appear there are atleast three different options for UI testing in Jmix. Which ones are maintained and their pros/cons are left to imagination due to the lack of documentation on two of them.

Maybe Masquerade is the right one because it’s used by the official test repository? But that’s an addon, jmix-ui-test-assist is builtin! but who uses that? except for mario’s demo I could not find more examples.

As you go digging you also find that:

  • Release notes talk about ui-test-assist. But there is no documentation there, except for API docs.
  • Masquerade on the Marketplace is not up-to-date. Unless you go to Github you would think it is abandoned

image

So … I would kindly as that some sort of Testing documentation is introduced in the next release. Even if its just some sample code and pointers. But atleast there would be a place telling you the recommended future proof approach to take on testing.

1 Like

Hi Marc,

You are right, the lack of testing documentation is a problem.
We are working on it (really), and it should be ready in a few weeks, irrespective to release dates.

Also, we added some tests to the project templates in version 1.5. If you create a new project with the “Full-Stack Application” template, you will find sample integration tests for the User entity and its screens (based on jmix-ui-test-assist library). The equivalent library for Flow UI will appear in release 2.0.

Regards,
Konstantin

3 Likes

This is very good to read!!

Please consider adding some information on when it is recommended to use @Import or @JmixModule (see here), @ContextConfiguration, … there are a lot of options and there’s very little information on their differences when applied to Jmix projects.

Wether there is / will be some @DataJpaTest equivalent, Mainly an annotation for tests that do not rely on UI and ones that do.

Wether @SpringBootTest is the way, or if other more lightweight options apply for unit tests.

That will save us lots of “let’s try this and see if it works” ! :slight_smile:

2 Likes

How is the testing documentation coming along? :slight_smile:

1 Like

The docs currently contain a lot more than a year ago, see Testing :: Jmix Documentation.

However, there is still a lot to do. Please add your comments or suggestions to this issue: Improve documentation about testing · Issue #660 · jmix-framework/jmix-docs

2 Likes