Automated testing

Just starting out with Python and wx etc, and wondered about automated
testing of graphical apps.

Is there any way of building this into an app, i.e. with additional
modules that test the controls and state?

Or am I better off investing in a standard automated test tool?

Hugh

For Windows, I have found AutoIt to be useful.
http://www.hiddensoft.com/autoit/

For non-visual aspects of testing I do something like:

class Test01(unittest.TestCase):

    def test02(self):
        """two buttons do different things"""
        x = TestApp02(visible=see)
        try:
            x.msg = 'no message'
            y = x.top.mypanel
            a = y.button1
            
            be = wx.wxCommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED)
            be.SetEventObject(a)
            be.SetId(a.GetId())
            a.GetEventHandler().ProcessEvent(be)
            self.assertEquals(x.msg, 'Message button clicked')

            b = y.button2
            be.SetEventObject(b)
            be.SetId(b.GetId())
            b.GetEventHandler().ProcessEvent(be)
            self.failIf(x.top.IsEnabled())
        finally:
            x.top.Close()

Cheers,

···

--- Hugh Gibson <hgibson@cix.compulink.co.uk> wrote:

Just starting out with Python and wx etc, and wondered about
automated testing of graphical apps.

Is there any way of building this into an app, i.e. with
additional modules that test the controls and state?

=====
Donnal Walter
Arkansas Children's Hospital

Hugh Gibson wrote:

Just starting out with Python and wx etc, and wondered about automated testing of graphical apps.

Is there any way of building this into an app, i.e. with additional modules that test the controls and state?

Or am I better off investing in a standard automated test tool?

I expect that a standard gui test tool would be what you need. It should be able to send events at a low enough level that the app will think they are coming from the user or the system. wxWindows doesn't provide any way to get that low because it can't be done very well in a cross platform way.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!