Closing modal dialogs in tests

| | Comments (0) | TrackBacks (0)

Problem: While testing the application we need to show and then close modal dialogs.

Current Solution: Currently we use the GUITestCase.executeOnEllapsed method to call a callback method responsible for closing the "active" dialog after a short delay.

The problem with that solution is that it's very error prone and adds a undesired delay in the tests.

New Solution: The new solution consists in replacing the modal dialog by a mock class that overrides the exec_ method, removing the process events loops by the following code:

self.show()
self.accept()

Categories

Leave a comment