Skip to content

Commit

Permalink
ENH: added timer during test to click resampling "yes" button automat…
Browse files Browse the repository at this point in the history
…ically
  • Loading branch information
che85 committed Oct 16, 2017
1 parent 3ca032d commit 044c8fa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Testing/QuantitativeReportingTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,28 @@ def test_import_labelmap(self):
labels.append(label)

labelImportWidget = qrWidget.labelMapImportWidget

timer = qt.QTimer()
timer.setInterval(2000)
timer.timeout.connect(self._checkFocusAndClickButton)
timer.start()

for label in labels:
labelImportWidget.labelMapSelector.setCurrentNode(label)
labelImportWidget.importButton.click()

timer.stop()

segmentation = qrWidget.segmentEditorWidget.segmentationNode.GetSegmentation()
self.assertEquals(segmentation.GetNumberOfSegments(), len(labels))

self.delayDisplay('Test passed!')

def _checkFocusAndClickButton(self):
focus = slicer.app.focusWidget()
if type(focus) is qt.QPushButton:
focus.click()

def test_import_segmentation(self):
self.delayDisplay('Starting %s' % inspect.stack()[0][3])

Expand Down

0 comments on commit 044c8fa

Please sign in to comment.