Difference between revisions of "2011 Summer Project Week Automated GUI Testing"
From NAMIC Wiki
| Line 38: | Line 38: | ||
</div> | </div> | ||
| + | <pre> | ||
| + | def c(): | ||
| + | print ("clicked!") | ||
| + | |||
| + | def b(): | ||
| + | global bb | ||
| + | bb = qt.QPushButton('Test') | ||
| + | bb.show() | ||
| + | bb.connect("clicked()", c) | ||
| + | |||
| + | p = qt.QPoint(10,10) | ||
| + | event = qt.QMouseEvent(2, p, 1, 1, 0) | ||
| + | slicer.app.sendEvent(bb, event) | ||
| + | |||
| + | event = qt.QMouseEvent(3, p, 1, 1, 0) | ||
| + | slicer.app.sendEvent(bb, event) | ||
| + | </pre> | ||
Revision as of 21:15, 23 June 2011
Home < 2011 Summer Project Week Automated GUI TestingKey Investigators
- Brigham and Women's Hospital: Sonia Pujol
- Isomics Inc: Steve Pieper
- Kitware: Dave Partyka, Jean-Christophe Fillon-Robin
- GE: Xiaodong Tao
Objective
The objective is to explore different solutions for automated GUI testing.
Approach, Plan
We'll generate automated tests using the Slicer3minute tutorial (up to slide 21)
- Sikuli
- QtTesting libraries
- Directly calling GUI via PythonQt
Progress
def c():
print ("clicked!")
def b():
global bb
bb = qt.QPushButton('Test')
bb.show()
bb.connect("clicked()", c)
p = qt.QPoint(10,10)
event = qt.QMouseEvent(2, p, 1, 1, 0)
slicer.app.sendEvent(bb, event)
event = qt.QMouseEvent(3, p, 1, 1, 0)
slicer.app.sendEvent(bb, event)