BTD
build-test-deploy Development Environment

Installing

As the IUP robot framework is part of the BTD suite, it will automatically be installed with the latter. Alternatively it can be installed stand alone. In both cases the software is distributed as a package, meaning that after downloading and unzipping you will find a main directory 'btd' with a number of subdirectories. This main directory should be copied to a place where it can be picked up by the Lua path.

Introduction

The IUP robot functionality refers to the automated firing of GUI events. This might be used to extend a unit testing framework, where a test program fires specific GUI events and records the reaction of the program under test. Another use might be a demo mode for a program, where a sequencer fires events at defined events inputs data and demonstrates the workings of the program.

Modules

The entire functionality is covered by four classes :
TestIup.lua
The GUI events router. It provides a function testIup.iupLoop and following use cases.
no parameter (testIup.iupLoop())
The GUI program will start and will stop the first time idle loop processing is called for
parameter and no idle loop in GUI program (testIup.iupLoop(idleLoop(???))
The GUI program will start and will, every time idle loop processing is called for, call the idleLoop function. The GUI program will stop when that function returns iup.CLOSE
parameter and idle loop in GUI program (testIup.iupLoop(idleLoop(???))
The GUI program will start and will, every time idle loop processing is called for, call the GUI program idle loop function, followed by the test idleLoop function. The GUI program will stop when that last function returns iup.CLOSE
_IupRobot.c
The native interface to the window manager. For the moment only MS Windows is supported.
move mouse
  • moveAbs : move to absolute pixel coordinates
  • moveRel : move relative number of pixels
mouse buttons
  • xxxDown : mouse button down
  • xxxUp : mouse button up
  • Remark : replace xxx with left, middle or right).
keyboard
  • xxxDown : key down
  • xxxUp : key up
The keys are organised in different groups :
  • normal : ASCII printable
  • modifier : shift, alt, ctrl
  • functional : tab, enter, function,...
IupRobot.lua
Lua interface to the raw native functions, adds timing.
general
  • new : initialise screensize and timing parameters
  • demo flag : turn visual feedback on
mouse
  • xxxDown : mouse button down with wait time
  • xxxUp : mouse button up with wait time
  • xxxClick : mouse button click with wait times
  • xxxClickDbl : mouse button double click with wait times
  • goto : move mouse in designated time frame
  • gotoCenter : move mouse to center of element in designated time frame
keyboard
  • xxxDown : key down with wait time
  • xxxUp : key up with wait time
  • xxxClick : key click with wait times
  • keyString : enter string
  • timer : wait the specified time
GuiSequencer.lua
Sequencer which handles idle loop processing while executing a list of functions incorporating wait times. The sequencer proceeds to the next function in the list when the executing function returns a specific value. It has following commands :
  • append : will append functions to the sequencer
  • execute : run the specified sequence
REMARKS
Remaining problems :
  • Only MS windows and only IUP testing
  • For now, only basic elements are processed. These have a direct relantionship between the IUP reported X and Y coordinates of the element under test and the function. This is not the case for example in a tree control (what is the position of a node or a leaf ?). This gives following status (per control) :
    IupButton
    Positioning, clicking,...
    IupCanvas
    Move the mouse, clicking,...
    IupFrame
    Nothing to test ?
    IupLabel
    Nothing to test ?
    IupList
    Needs calculating screen positions of (sub) elements
    IupProgrssBar
    Nothing to test ?
    IupSpin
    Needs calculating screen positions of (sub) elements
    IupTabs
    Needs calculating screen positions of elements ???
    IupText
    Positioning, entering text (only direct keyboard entry, no copying, pasting, deleting with mouse control), clicking,...
    IupToggle
    Needs calculating screen positions of elements ???
    IupVal
    Needs calculating screen positions of elements ???
  • There is not only an operating system dependency, but also (or more so) a 'windowing environment' one.
  • Last but not least, this is (for now) only foreseen for IUP. At least part of the functionality is framework agnostic and there are several other frameworks.
  • This gives an 'interesting' :o) mix of posibilities, any ideas anyone ?