Search code examples
pythonqtuser-interfacepyqtgui-testing

How to test faster GUI applications?


I'd like to know to test faster my GUI applications.

For the backend I got a good set of unit-tests, so I think that's quite ok and I can iterate quite fast.

But to test the frontend logic I find myself running over and over repeating the same sequence of events to test certain part of the logic... and that feels like I'm doing something clearly wrong here because my iteration cycle is not as faster as I'd like it to.

So, could you suggest me a good way to test GUI applications? in particular I'm pretty much interested to know how to speed-up my PyQt apps testing cycle.


Solution

  • If you're just trying to validate that certain GUI actions do the correct thing, you can use QTest to simulate button clicks and other GUI interaction.

    Ideally, most of your business logic is in non-GUI modules to make it easier to test. That way, GUI testing is limited mostly to testing if the results display correctly and that key presses trigger events.