RefMa77
RefMa77

Reputation: 293

Intention of GUI-Unit Testing in QML

I do some research about Qt-Quick-Tests, especially the GUI-Unit Test. I´d like to know what is the Intention? Is it for triggering the functions that are written in QML, or do I want to see the behavior of the UI, or is it something complete different, I have not mentioned yet?

Upvotes: 4

Views: 2142

Answers (1)

Mitch
Mitch

Reputation: 24386

I´d like to know what is the Intention?

I would guess that main reason Qt Test was written was to test Qt itself via regression testing. Qt has a continuous integration (CI) system that runs automated tests against batches of changes submitted by contributors through code review. You can see all of these tests in the tests directory of each Git repository. For example, here are qtbase.git's automated tests.

From those tests, you will see that there are several applications for users, some of which are:

  • Basic logic tests. For example, when I call foo(), I expect the bar() signal to be emitted. This is not specific to GUI applications, and all applications can benefit from these. A lot of tests will fall under this category.
  • Render tests. Checking that the user interface is rendered correctly by comparing images "grabbed" from the screen.
  • User interaction tests. If I click this button, does it perform some action? If I type into this text field, does it then contain that text?

These are terms that I just made up, although they are accurate enough. If you're researching this subject, you will find resources online about the various types of automated testing. This is not specific to Qt.

Is it for triggering the functions that are written in QML

Yes.

or do I want to see the behavior of the UI

It can also test that.

Note that some applications are too large or complex to test via Qt's libraries. There are products like Squish that automate GUI testing for these types of applications.

Upvotes: 5

Related Questions