Difference between revisions of "2011 Summer Project Week Automated GUI Testing"

From NAMIC Wiki
Jump to: navigation, search
 
(10 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
* Brigham and Women's Hospital: Sonia Pujol
 
* Brigham and Women's Hospital: Sonia Pujol
 
* Isomics Inc: Steve Pieper
 
* Isomics Inc: Steve Pieper
* Kitware: Dave Partyka, Jean-Christophe Fillon-Robin
+
* Kitware: Jean-Christophe Fillon-Robin
 
* GE: Xiaodong Tao
 
* GE: Xiaodong Tao
  
Line 18: Line 18:
  
 
<h3>Approach, Plan</h3>
 
<h3>Approach, Plan</h3>
*[http://sikuli.org/sikuli | Sikuli]<br>
+
We'll generate automated tests using the Slicer3minute tutorial.
*QtTesting libraries<br></div>
+
*[http://sikuli.org Sikuli]<br>
 +
*QtTesting libraries<br>
 +
*Directly calling GUI via PythonQt<br>
 +
</div>
 
<div style="width: 40%; float: left;">
 
<div style="width: 40%; float: left;">
  
 
<h3>Progress</h3>
 
<h3>Progress</h3>
  
 
+
* We have developed a sikuli script that runs automatically the different steps of the Slicer3minute tutorial using Slicer4: [http://www.na-mic.org/Wiki/index.php/File:2011-06-24_0310.swf  automated test example]
 
+
* We reviewed the needs for the integrated test recording framework in VTK/Qt/Python (about 50% done, but is no the slicer4 to-do list)
 +
* Tested native PythonQt event passing (see example code below)
  
 
</div>
 
</div>
Line 31: Line 35:
  
 
<div style="width: 97%; float: left;">
 
<div style="width: 97%; float: left;">
 +
<pre>
 +
#
 +
# example PythonQt snippet that creates a button and clicks on it
 +
#
 +
 +
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>
  
  
  
 
</div>
 
</div>

Latest revision as of 14:20, 24 June 2011

Home < 2011 Summer Project Week Automated GUI Testing

Key Investigators

  • Brigham and Women's Hospital: Sonia Pujol
  • Isomics Inc: Steve Pieper
  • Kitware: 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.

  • Sikuli
  • QtTesting libraries
  • Directly calling GUI via PythonQt

Progress

  • We have developed a sikuli script that runs automatically the different steps of the Slicer3minute tutorial using Slicer4: automated test example
  • We reviewed the needs for the integrated test recording framework in VTK/Qt/Python (about 50% done, but is no the slicer4 to-do list)
  • Tested native PythonQt event passing (see example code below)
#
# example PythonQt snippet that creates a button and clicks on it
#

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)