def test_compare_image(name): #save image the old fashioned way to make sure we loop print "comparing " + name QtTesting.playCommand(object1008, 'pause', '2000') object1009 = 'pqClientMainWindow/menubar/menu_File' QtTesting.playCommand(object1009, 'activate', 'actionFileSaveScreenshot') object1010 = 'pqClientMainWindow/SaveSnapshotDialog/width' QtTesting.playCommand(object1010, 'set_string', '300') object1011 = 'pqClientMainWindow/SaveSnapshotDialog/height' QtTesting.playCommand(object1011, 'set_string', '300') object1013 = 'pqClientMainWindow/SaveSnapshotDialog/ok' QtTesting.playCommand(object1013, 'activate', '') object1014 = 'pqClientMainWindow/FileSaveScreenshotDialog' QtTesting.playCommand(object1014, 'remove', '$PARAVIEW_TEST_ROOT/' + name) QtTesting.playCommand(object1014, 'filesSelected', '$PARAVIEW_TEST_ROOT/' + name) QtTesting.playCommand(object1008, 'pause', '2000') QtTestingImage.compareImage('$PARAVIEW_TEST_ROOT/' + name, name)
def test_compare_image(name): #save image the old fashioned way to make sure we loop print "comparing "+name QtTesting.playCommand(object1008, 'pause', '2000') object1009 = 'pqClientMainWindow/menubar/menu_File' QtTesting.playCommand(object1009, 'activate', 'actionFileSaveScreenshot') object1010 = 'pqClientMainWindow/SaveSnapshotDialog/width' QtTesting.playCommand(object1010, 'set_string', '300') object1011 = 'pqClientMainWindow/SaveSnapshotDialog/height' QtTesting.playCommand(object1011, 'set_string', '300') object1013 = 'pqClientMainWindow/SaveSnapshotDialog/ok' QtTesting.playCommand(object1013, 'activate', '') object1014 = 'pqClientMainWindow/FileSaveScreenshotDialog' QtTesting.playCommand(object1014, 'remove', '$PARAVIEW_TEST_ROOT/'+name) QtTesting.playCommand(object1014, 'filesSelected', '$PARAVIEW_TEST_ROOT/'+name) QtTesting.playCommand(object1008, 'pause', '2000') QtTestingImage.compareImage('$PARAVIEW_TEST_ROOT/'+name, name);
#/usr/bin/env python import QtTesting import QtTestingImage QtTesting.playCommand(object1, 'activate', '') QtTesting.playCommand(object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/SPCTH/Dave_Karelitz_Small/spcth_a') QtTesting.playCommand(object3, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object3, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') QtTesting.playCommand(object5, 'set_string', 'Surface') QtTesting.playCommand(object6, 'activate', '') QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^)') QtTesting.playCommand(object8, 'activate', 'menuFilters') QtTesting.playCommand(object9, 'activate', 'AMRDualClip') QtTesting.playCommand(object10, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object10, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^) (partial)') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'CTHAMRDualClip.png', 300, 300)
QtTesting.playCommand( object8, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/particles_..ncdf') object11 = 'pqClientMainWindow/pqSLACDataLoadManager/buttonBox/1QPushButton0' QtTesting.playCommand(object11, 'activate', '') #Image compare snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' # For some reason, the snapshot is being grabbed before the image is updated # when the dialog closes. To get around this issue, simulate a mouse click # in the view. I'm not really happy with this hack because it won't catch if # accepting the dialog really doesn't render the final view. QtTesting.playCommand(snapshotWidget, 'mousePress', '(0.5,0.5,1,1,0)') QtTesting.playCommand(snapshotWidget, 'mouseRelease', '(0.5,0.5,1,0,0)') QtTestingImage.compareImage(snapshotWidget, 'SLACToolsInitialLoad.png', 300, 300) ############################################################################# # Show the magnetic (b) field and change the representation to solid+wireframe. object1 = 'pqSLACActionHolder/actionShowBField' QtTesting.playCommand(object1, 'activate', '') object2 = 'pqSLACActionHolder/actionWireframeSolidMesh' QtTesting.playCommand(object2, 'activate', '') #Image compare snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'SLACToolsBFieldWireSolid.png', 300, 300)
object18 = 'MainWindow/VCRToolbar/1QToolButton3' QtTesting.playCommand(object16, 'set_int', '1') QtTesting.playCommand(object16, 'set_int', '0') QtTesting.playCommand(object16, 'set_int', '1') QtTesting.playCommand(object16, 'set_int', '0') QtTesting.playCommand(object16, 'set_int', '1') object19 = 'MainWindow/animationPanelDock/1pqAnimationPanel0/scrollArea/qt_scrollarea_viewport/AnimationPanel/keyFramePropertiesGroup/editorFrame/SignalAdaptorKeyFrameValue/lineEdit' QtTesting.playCommand(object19, 'set_string', '10') QtTesting.playCommand(object19, 'set_string', '10') object20 = 'MainWindow/VCRToolbar/1QToolButton1' QtTesting.playCommand(object11, 'activate', 'Animation Inspector') QtTesting.playCommand(object11, 'activate', 'Object Inspector') QtTesting.playCommand(object11, 'activate', 'Pipeline Browser') QtTesting.playCommand(object9, 'activate', 'actionFileSaveAnimation') object21 = 'Dialog/spinBoxWidth' QtTesting.playCommand(object21, 'set_int', '800') object22 = 'Dialog/spinBoxHeight' QtTesting.playCommand(object22, 'set_int', '800') object22 = 'Dialog/okButton' QtTesting.playCommand(object22, 'activate', '') objectSaveAnimationDialog = 'FileSaveAnimationDialog' QtTesting.playCommand(objectSaveAnimationDialog, 'filesSelected', '$PARAVIEW_TEST_ROOT/movie_test.png') time.sleep(3); objectPlayButton = 'MainWindow/VCRToolbar/1QToolButton2' while QtTesting.getProperty(objectPlayButton, "text") != 'Play' : time.sleep(1); QtTestingImage.compareImage('$PARAVIEW_TEST_ROOT/movie_test.0005.png', 'SaveAnimationMultiView.png');
#/usr/bin/env python import QtTesting import QtTestingImage QtTesting.playCommand(object1, 'activate', '') QtTesting.playCommand(object2, 'filesSelected', '$VISOCYTE_DATA_ROOT/Testing/Data/SPCTH/Dave_Karelitz_Small/spcth_a') QtTesting.playCommand(object3, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object3, 'mouseMove', '1,0,0,0,0,0') QtTesting.playCommand(object3, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') QtTesting.playCommand(object10, 'activate', 'menuFilters') QtTesting.playCommand(object11, 'activate', 'MaterialInterfaceFilter') object23 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/SelectMassArray/1QHeaderView0' QtTesting.playCommand(object23, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object23, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'CTHAMRMaterialInterfaceFilter.png', 300, 300)
QtTesting.playCommand(object10, 'activate', '') object8 = 'pqClientMainWindow/pqSLACDataLoadManager/particlesFile/pqFileDialog' QtTesting.playCommand(object8, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/particles_..ncdf') object11 = 'pqClientMainWindow/pqSLACDataLoadManager/buttonBox/1QPushButton0' QtTesting.playCommand(object11, 'activate', '') #Image compare snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' # For some reason, the snapshot is being grabbed before the image is updated # when the dialog closes. To get around this issue, simulate a mouse click # in the view. I'm not really happy with this hack because it won't catch if # accepting the dialog really doesn't render the final view. QtTesting.playCommand(snapshotWidget, 'mousePress', '(0.5,0.5,1,1,0)') QtTesting.playCommand(snapshotWidget, 'mouseRelease', '(0.5,0.5,1,0,0)') QtTestingImage.compareImage(snapshotWidget, 'SLACToolsInitialLoad.png', 300, 300); ############################################################################# # Show the magnetic (b) field and change the representation to solid+wireframe. object1 = 'pqSLACActionHolder/actionShowBField' QtTesting.playCommand(object1, 'activate', '') object2 = 'pqSLACActionHolder/actionWireframeSolidMesh' QtTesting.playCommand(object2, 'activate', '') #Image compare snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'SLACToolsBFieldWireSolid.png', 300, 300);
# Remove old files. QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0000.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0001.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0002.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0003.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0004.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0005.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0006.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0007.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0008.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0009.png') QtTesting.playCommand(object16, 'filesSelected', '$PARAVIEW_TEST_ROOT/disconnectSave.png') import time print "Wait for 20 secs" time.sleep(20) QtTestingImage.compareImage('$PARAVIEW_TEST_ROOT/disconnectSave.0005.png', 'DisconnectAndSaveAnimation.png')
QtTesting.playCommand(object5, 'activate', '') object6 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/ModeFileName/FileButton' QtTesting.playCommand(object6, 'activate', '') object7 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/ModeFileName/pqFileDialog' QtTesting.playCommand( object7, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/fields_..mod') object8 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept' QtTesting.playCommand(object8, 'activate', '') QtTesting.playCommand(object8, 'activate', '') object9 = 'pqClientMainWindow/variableToolbar/displayColor/Variables' QtTesting.playCommand(object9, 'set_string', 'efield') # Image compare for default colors. snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'RenderNanDefaultColor.png', 300, 300) ############################################################################# # Choose a preset color map and make sure the corresponding NaN color is loaded. object1 = 'pqClientMainWindow/variableToolbar/actionEditColorMap' QtTesting.playCommand(object1, 'activate', '') object2 = 'pqClientMainWindow/pqColorScaleDialog/ColorTabs/qt_tabwidget_stackedwidget/ScalePage/PresetButton' QtTesting.playCommand(object2, 'activate', '') object3 = 'pqClientMainWindow/pqColorScaleDialog/pqColorPresetDialog/Gradients' QtTesting.playCommand(object3, 'setCurrent', '1.0') object4 = 'pqClientMainWindow/pqColorScaleDialog/pqColorPresetDialog/OkButton' QtTesting.playCommand(object4, 'activate', '') object5 = 'pqClientMainWindow/pqColorScaleDialog/CloseButton' QtTesting.playCommand(object5, 'activate', '')
QtTesting.playCommand(object1, 'activate', 'menuSources') object2 = 'pqClientMainWindow/menubar/menuSources' QtTesting.playCommand(object2, 'activate', 'RTAnalyticSource') object3 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept' QtTesting.playCommand(object3, 'activate', '') QtTesting.playCommand(object1, 'activate', 'menuFilters') object4 = 'pqClientMainWindow/menubar/menuFilters/Alphabetical' QtTesting.playCommand(object4, 'activate', 'IsoVolume') object5 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/ThresholdBetween_0/LineEdit' object6 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/ThresholdBetween_1/LineEdit' QtTesting.playCommand(object6, 'set_string', '150') QtTesting.playCommand(object5, 'set_string', '140') QtTesting.playCommand(object3, 'activate', '') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'TestIsoVolume1.png', 300, 300); #----------------- NEXT TEST ----------- # Test isovolume of cell data for vtkImageData. object7 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Delete' QtTesting.playCommand(object7, 'activate', '') QtTesting.playCommand(object1, 'activate', 'menuFilters') QtTesting.playCommand(object4, 'activate', 'PointDataToCellData') QtTesting.playCommand(object3, 'activate', '') QtTesting.playCommand(object1, 'activate', 'menuFilters') QtTesting.playCommand(object4, 'activate', 'IsoVolume') QtTesting.playCommand(object5, 'set_string', '150') QtTesting.playCommand(object6, 'set_string', '170') QtTesting.playCommand(object3, 'activate', '') object9 = 'pqClientMainWindow/variableToolbar/actionScalarBarVisibility'
QtTesting.playCommand(object1, 'activate', 'menuSources') object2 = 'pqClientMainWindow/menubar/menuSources' QtTesting.playCommand(object2, 'activate', 'RTAnalyticSource') object3 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept' QtTesting.playCommand(object3, 'activate', '') QtTesting.playCommand(object1, 'activate', 'menuFilters') object4 = 'pqClientMainWindow/menubar/menuFilters/Alphabetical' QtTesting.playCommand(object4, 'activate', 'IsoVolume') object5 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/ThresholdBetween_0/LineEdit' object6 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/ThresholdBetween_1/LineEdit' QtTesting.playCommand(object6, 'set_string', '150') QtTesting.playCommand(object5, 'set_string', '140') QtTesting.playCommand(object3, 'activate', '') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'TestIsoVolume1.png', 300, 300) #----------------- NEXT TEST ----------- # Test isovolume of cell data for vtkImageData. object7 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Delete' QtTesting.playCommand(object7, 'activate', '') QtTesting.playCommand(object1, 'activate', 'menuFilters') QtTesting.playCommand(object4, 'activate', 'PointDataToCellData') QtTesting.playCommand(object3, 'activate', '') QtTesting.playCommand(object1, 'activate', 'menuFilters') QtTesting.playCommand(object4, 'activate', 'IsoVolume') QtTesting.playCommand(object5, 'set_string', '150') QtTesting.playCommand(object6, 'set_string', '170') QtTesting.playCommand(object3, 'activate', '') object9 = 'pqClientMainWindow/variableToolbar/displayColor/Variables'
QtTesting.playCommand(object4, "currentChangedbyItemName", "SLAC Mesh Files") object5 = "pqClientMainWindow/pqSelectReaderDialog/okButton" QtTesting.playCommand(object5, "activate", "") object6 = "pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/ModeFileName/FileButton" QtTesting.playCommand(object6, "activate", "") object7 = "pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/ModeFileName/pqFileDialog" QtTesting.playCommand(object7, "filesSelected", "$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/fields_..mod") object8 = "pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept" QtTesting.playCommand(object8, "activate", "") QtTesting.playCommand(object8, "activate", "") object9 = "pqClientMainWindow/variableToolbar/displayColor/Variables" QtTesting.playCommand(object9, "set_string", "efield") # Image compare for default colors. snapshotWidget = "pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" QtTestingImage.compareImage(snapshotWidget, "RenderNanDefaultColor.png", 300, 300) ############################################################################# # Choose a preset color map and make sure the corresponding NaN color is loaded. object1 = "pqClientMainWindow/variableToolbar/actionEditColorMap" QtTesting.playCommand(object1, "activate", "") object2 = "pqClientMainWindow/pqColorScaleDialog/ColorTabs/qt_tabwidget_stackedwidget/ScalePage/PresetButton" QtTesting.playCommand(object2, "activate", "") object3 = "pqClientMainWindow/pqColorScaleDialog/pqColorPresetDialog/Gradients" QtTesting.playCommand(object3, "setCurrent", "1.0") object4 = "pqClientMainWindow/pqColorScaleDialog/pqColorPresetDialog/OkButton" QtTesting.playCommand(object4, "activate", "") object5 = "pqClientMainWindow/pqColorScaleDialog/CloseButton" QtTesting.playCommand(object5, "activate", "")
object9 = 'pqClientMainWindow/menubar/menuFile' QtTesting.playCommand(object9, 'activate', 'actionFileSaveScreenshot') object12 = 'pqClientMainWindow/SaveSnapshotDialog/selectedViewOnly' QtTesting.playCommand(object12, 'set_boolean', 'false') object10 = 'pqClientMainWindow/SaveSnapshotDialog/width' QtTesting.playCommand(object10, 'set_string', '1') QtTesting.playCommand(object10, 'set_string', '10') QtTesting.playCommand(object10, 'key', '16777219') QtTesting.playCommand(object10, 'key', '16777219') QtTesting.playCommand(object10, 'set_string', '9') QtTesting.playCommand(object10, 'set_string', '90') QtTesting.playCommand(object10, 'set_string', '900') object11 = 'pqClientMainWindow/SaveSnapshotDialog/height' QtTesting.playCommand(object11, 'key', '16777217') QtTesting.playCommand(object11, 'set_string', '90') QtTesting.playCommand(object11, 'set_string', '90') QtTesting.playCommand(object11, 'set_string', '900') object13 = 'pqClientMainWindow/SaveSnapshotDialog/ok' QtTesting.playCommand(object13, 'activate', '') object14 = 'pqClientMainWindow/FileSaveScreenshotDialog' #remove old file, if any QtTesting.playCommand(object14, 'remove', '$PARAVIEW_TEST_ROOT/savelargescreenshot.test.png') QtTesting.playCommand(object14, 'filesSelected', '$PARAVIEW_TEST_ROOT/savelargescreenshot.test.png') import time print "Wait for 2 secs" time.sleep(2); QtTestingImage.compareImage('$PARAVIEW_TEST_ROOT/savelargescreenshot.test.png', 'SaveLargeScreenshot.png');
QtTesting.playCommand(objecta2, "activate", "") object3 = "pqClientMainWindow/PluginManagerDialog/buttonBox/1QPushButton0" QtTesting.playCommand(object3, "activate", "") # close the 3D view and make a manta view object4 = "pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Close" QtTesting.playCommand(object4, "activate", "") object5 = "pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/EmptyView/scrollArea/qt_scrollarea_viewport/widgetFoo/ConvertActionsFrame/MantaView" QtTesting.playCommand(object5, "activate", "") # show something hack3 = "pqClientMainWindow/menubar" QtTesting.playCommand(hack3, "activate", "menuSources") hack4 = "pqClientMainWindow/menubar/menuSources" QtTesting.playCommand(hack4, "activate", "SphereSource") object6 = "pqClientMainWindow/objectInspectorDock/objectInspector/Accept" QtTesting.playCommand(object6, "activate", "") # test sphere 'glyphs' while we are at it objectfoo = "pqClientMainWindow/representationToolbar/displayRepresentation/comboBox" QtTesting.playCommand(objectfoo, "set_string", "Points") object7 = "pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport" QtTesting.playCommand(object7, "mousePress", "(0.719373,0.369784,1,1,0)") QtTesting.playCommand(object7, "mouseMove", "(0.605413,0.271942,1,0,0)") QtTesting.playCommand(object7, "mouseRelease", "(0.605413,0.271942,1,0,0)") # Image comparison snapshotWidget = "pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport" QtTestingImage.compareImage(snapshotWidget, "MantaSSImage.png", 300, 300)
object9 = 'pqClientMainWindow/menubar/menu_File' QtTesting.playCommand(object9, 'activate', 'actionFileSaveScreenshot') object12 = 'pqClientMainWindow/SaveSnapshotDialog/selectedViewOnly' QtTesting.playCommand(object12, 'set_boolean', 'false') object10 = 'pqClientMainWindow/SaveSnapshotDialog/width' QtTesting.playCommand(object10, 'set_string', '1') QtTesting.playCommand(object10, 'set_string', '10') QtTesting.playCommand(object10, 'key', '16777219') QtTesting.playCommand(object10, 'key', '16777219') QtTesting.playCommand(object10, 'set_string', '9') QtTesting.playCommand(object10, 'set_string', '90') QtTesting.playCommand(object10, 'set_string', '900') object11 = 'pqClientMainWindow/SaveSnapshotDialog/height' QtTesting.playCommand(object11, 'key', '16777217') QtTesting.playCommand(object11, 'set_string', '90') QtTesting.playCommand(object11, 'set_string', '90') QtTesting.playCommand(object11, 'set_string', '900') object13 = 'pqClientMainWindow/SaveSnapshotDialog/ok' QtTesting.playCommand(object13, 'activate', '') object14 = 'pqClientMainWindow/FileSaveScreenshotDialog' #remove old file, if any QtTesting.playCommand(object14, 'remove', '$PARAVIEW_TEST_ROOT/savelargescreenshot.test.png') QtTesting.playCommand(object14, 'filesSelected', '$PARAVIEW_TEST_ROOT/savelargescreenshot.test.png') import time print "Wait for 2 secs" time.sleep(2); QtTestingImage.compareImage('$PARAVIEW_TEST_ROOT/savelargescreenshot.test.png', 'SaveLargeScreenshot.png');
#/usr/bin/env python import QtTesting import QtTestingImage QtTesting.playCommand(object1, 'activate', '') QtTesting.playCommand( object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/Testing/Data/SPCTH/Dave_Karelitz_Small/spcth_a') QtTesting.playCommand(object3, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object3, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') QtTesting.playCommand(object5, 'set_string', 'Surface') QtTesting.playCommand(object6, 'activate', '') QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^)') QtTesting.playCommand(object8, 'activate', 'menuFilters') QtTesting.playCommand(object9, 'activate', 'AMRDualClip') QtTesting.playCommand(object10, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object10, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^) (partial)') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'CTHAMRDualClip.png', 300, 300)
object17 = 'pqClientMainWindow/VCRToolbar/1QToolButton0' QtTesting.playCommand(object17, 'activate', '') object18 = 'pqClientMainWindow/VCRToolbar/1QToolButton3' #object19 = 'pqClientMainWindow/animationPanelDock/1pqAnimationPanel0/scrollArea/qt_scrollarea_viewport/AnimationPanel/keyFramePropertiesGroup/editorFrame/SignalAdaptorKeyFrameValue/lineEdit' #QtTesting.playCommand(object19, 'set_string', '10') #QtTesting.playCommand(object19, 'set_string', '10') object20 = 'pqClientMainWindow/VCRToolbar/1QToolButton1' QtTesting.playCommand(object11, 'activate', 'Animation View') QtTesting.playCommand(object11, 'activate', 'Object Inspector') QtTesting.playCommand(object11, 'activate', 'Pipeline Browser') QtTesting.playCommand(object9, 'activate', 'actionFileSaveAnimation') object21 = 'Dialog/spinBoxWidth' QtTesting.playCommand(object21, 'set_int', '800') object22 = 'Dialog/spinBoxHeight' QtTesting.playCommand(object22, 'set_int', '800') object22 = 'Dialog/okButton' QtTesting.playCommand(object22, 'activate', '') objectSaveAnimationDialog = 'FileSaveAnimationDialog' QtTesting.playCommand(objectSaveAnimationDialog, 'filesSelected', '$PARAVIEW_TEST_ROOT/movie_test.png') time.sleep(3) objectPlayButton = 'pqClientMainWindow/VCRToolbar/1QToolButton2' while QtTesting.getProperty(objectPlayButton, "text") != 'Play': time.sleep(1) QtTestingImage.compareImage('$PARAVIEW_TEST_ROOT/movie_test.0005.png', 'SaveAnimationMultiView.png')
# Change to surface with edges rendering mode object15 = 'pqClientMainWindow/representationToolbar/displayRepresentation/comboBox' QtTesting.playCommand(object15, 'set_string', 'Surface With Edges') object16 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_tabbar' QtTesting.playCommand(object16, 'set_tab', '1') # Change subdivision and capture images. # object17 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/1QScrollArea0/qt_scrollarea_vcontainer/1QScrollBar0' # QtTesting.playCommand(object17, 'mousePress', '1,1,0,9,64') # QtTesting.playCommand(object17, 'mouseMove', '1,0,0,7,175') # QtTesting.playCommand(object17, 'mouseRelease', '1,0,0,7,175') subdivisionWidget = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/1QScrollArea0/qt_scrollarea_viewport/1pqDisplayProxyEditorWidget0/pqDisplayProxyEditor/StyleGroup/NonlinearSubdivisionLevel' snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTesting.playCommand(subdivisionWidget, 'set_int', '0') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision0Display.png', 300, 300) QtTesting.playCommand(subdivisionWidget, 'set_int', '1') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision1Display.png', 300, 300) QtTesting.playCommand(subdivisionWidget, 'set_int', '2') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision2Display.png', 300, 300) QtTesting.playCommand(subdivisionWidget, 'set_int', '3') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision3Display.png', 300, 300) QtTesting.playCommand(subdivisionWidget, 'set_int', '4') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision4Display.png',
object5 = "pqClientMainWindow/MultiViewManager/MaximizeFrame/0/MultiViewFrameMenu/RestoreButton" QtTesting.playCommand(object5, "activate", "") object6 = "pqClientMainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/MultiViewSplitter:0/0/MultiViewFrameMenu/CloseButton" QtTesting.playCommand(object6, "activate", "") object7 = "pqClientMainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/0/MultiViewFrameMenu/CloseButton" QtTesting.playCommand(object7, "activate", "") object8 = "pqClientMainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/1/MultiViewFrameMenu/CloseButton" QtTesting.playCommand(object8, "activate", "") object9 = ( "pqClientMainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/1/MultiViewFrameMenu/SplitHorizontalButton" ) QtTesting.playCommand(object9, "activate", "") object10 = "pqClientMainWindow/pipelineBrowserDock/pipelineBrowser/PipelineView" QtTesting.playCommand(object10, "currentChanged", "/0/2|0") # QtTesting.playCommand(object10, 'currentChanged', '/0/2|1') object11 = "pqClientMainWindow/objectInspectorDock/1pqProxyTabWidget0/1QTabBar0" QtTesting.playCommand(object11, "set_tab", "1") QtTesting.playCommand(object1, "activate", "actionFileSaveServerState") object13 = "pqClientMainWindow/FileSaveServerStateDialog" QtTesting.playCommand(object13, "filesSelected", "$PARAVIEW_TEST_ROOT/TestMultiView.pvsm") object14 = "pqClientMainWindow/mainToolBar/1QToolButton3" QtTesting.playCommand(object14, "activate", "") object14a = "pqClientMainWindow/1QMessageBox0/qt_msgbox_buttonbox/1QPushButton0" QtTesting.playCommand(object14a, "activate", "") QtTesting.playCommand(object1, "activate", "actionFileLoadServerState") # QtTesting.playCommand(object2, 'activate', '') QtTesting.playCommand(object3, "filesSelected", "$PARAVIEW_TEST_ROOT/TestMultiView.pvsm") snapshotWidget = "pqClientMainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" QtTestingImage.compareImage(snapshotWidget, "LoadStateMultiView.png", 200, 200)
#/usr/bin/env python import QtTesting import QtTestingImage object1 = 'pqClientMainWindow/MainControlsToolbar/actionOpenData' QtTesting.playCommand(object1, 'activate', '') object2 = 'pqClientMainWindow/FileOpenDialog' QtTesting.playCommand(object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/SPCTH/Dave_Karelitz_Small/spcth_a') object3 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/CellArrayStatus/1QHeaderView0' QtTesting.playCommand(object3, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object3, 'mouseRelease', '1,0,0,0,0,0') object4 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept' QtTesting.playCommand(object4, 'activate', '') object5 = 'pqClientMainWindow/representationToolbar/displayRepresentation/comboBox' QtTesting.playCommand(object5, 'set_string', 'Surface') object6 = 'pqClientMainWindow/cameraToolbar/actionNegativeY' QtTesting.playCommand(object6, 'activate', '') object7 = 'pqClientMainWindow/variableToolbar/displayColor/Variables' QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^)') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'CTHAMRBaseline.png', 300, 300)
import QtTestingImage object1 = 'pqClientMainWindow/MainControlsToolbar/actionOpenData' QtTesting.playCommand(object1, 'activate', '') object2 = 'pqClientMainWindow/FileOpenDialog' QtTesting.playCommand(object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/Testing/Data/SPCTH/Dave_Karelitz_Small/spcth_a') object3 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/CellArrayStatus/1QHeaderView0' QtTesting.playCommand(object3, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object3, 'mouseRelease', '1,0,0,0,0,0') object4 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept' QtTesting.playCommand(object4, 'activate', '') object5 = 'pqClientMainWindow/representationToolbar/displayRepresentation/comboBox' QtTesting.playCommand(object5, 'set_string', 'Surface') object6 = 'pqClientMainWindow/cameraToolbar/actionNegativeY' QtTesting.playCommand(object6, 'activate', '') object7 = 'pqClientMainWindow/variableToolbar/displayColor/Variables' QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^)') object8 = 'pqClientMainWindow/menubar' QtTesting.playCommand(object8, 'activate', 'menuFilters') object9 = 'pqClientMainWindow/menubar/menuFilters/Alphabetical' QtTesting.playCommand(object9, 'activate', 'AMRDualContour') object10 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/SelectMaterialArrays/1QHeaderView0' QtTesting.playCommand(object10, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object10, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^) (partial)') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'CTHAMRContour.png', 300, 300)
QtTesting.playCommand(object12, 'activate', '') QtTesting.playCommand(object12, 'activate', 'actionFileSaveAnimation') object13 = 'Dialog/checkBoxDisconnect' QtTesting.playCommand(object13, 'set_boolean', 'true') object14 = 'Dialog/spinBoxWidth' QtTesting.playCommand(object14, 'set_int', '300') object14 = 'Dialog/spinBoxHeight' QtTesting.playCommand(object14, 'set_int', '300') object15 = 'Dialog/okButton' QtTesting.playCommand(object15, 'activate', '') object16 = 'FileSaveAnimationDialog' # Remove old files. QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0000.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0001.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0002.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0003.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0004.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0005.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0006.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0007.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0008.png') QtTesting.playCommand(object16, 'remove', '$PARAVIEW_TEST_ROOT/disconnectSave.0009.png') QtTesting.playCommand(object16, 'filesSelected', '$PARAVIEW_TEST_ROOT/disconnectSave.png') import time print "Wait for 20 secs" time.sleep(20); QtTestingImage.compareImage('$PARAVIEW_TEST_ROOT/disconnectSave.0005.png', 'DisconnectAndSaveAnimation.png');
#/usr/bin/env python import QtTesting import QtTestingImage object1 = 'pqClientMainWindow/menubar/menuFile' QtTesting.playCommand(object1, 'activate', 'actionFileLoadServerState') object2 = 'pqClientMainWindow/ServerStartupBrowser/connect' QtTesting.playCommand(object2, 'activate', '') object3 = 'pqClientMainWindow/FileLoadServerStateDialog' QtTesting.playCommand(object3, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/LoadStateHistogram.pvsm') object4 = 'pqClientMainWindow/pipelineBrowserDock/pipelineBrowser/PipelineView' QtTesting.playCommand(object4, 'currentChanged', '/0/0/0|0') object5 = 'pqClientMainWindow/objectInspectorDock/1pqProxyTabWidget0/1QTabBar0' QtTesting.playCommand(object5, 'set_tab', '1') QtTesting.playCommand(object5, 'set_tab', '0') object6 = 'pqClientMainWindow/objectInspectorDock/1pqProxyTabWidget0/1QStackedWidget0/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/BinCount' QtTesting.playCommand(object6, 'set_string', '1') QtTesting.playCommand(object6, 'set_string', '16') object7 = 'pqClientMainWindow/objectInspectorDock/1pqProxyTabWidget0/1QStackedWidget0/objectInspector/Accept' QtTesting.playCommand(object7, 'activate', '') object8 = 'pqClientMainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/1/PlotWidget' QtTestingImage.compareImage(object8, 'HistogramChart.png', 400, 200)
# Change to surface with edges rendering mode object15 = 'pqClientMainWindow/representationToolbar/displayRepresentation/comboBox' QtTesting.playCommand(object15, 'set_string', 'Surface With Edges') object16 = 'pqClientMainWindow/1QTabBar1' QtTesting.playCommand(object16, 'set_tab_with_text', 'Display') # Change subdivision and capture images. # object17 = 'pqClientMainWindow/displayDock/displayWidgetFrame/displayScrollArea/qt_scrollarea_vcontainer/1QScrollBar0' # QtTesting.playCommand(object17, 'mousePress', '1,1,0,9,64') # QtTesting.playCommand(object17, 'mouseMove', '1,0,0,7,175') # QtTesting.playCommand(object17, 'mouseRelease', '1,0,0,7,175') subdivisionWidget = 'pqClientMainWindow/displayDock/displayWidgetFrame/displayScrollArea/qt_scrollarea_viewport/displayWidget/pqDisplayProxyEditor/StyleGroup/NonlinearSubdivisionLevel' snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport' QtTesting.playCommand(subdivisionWidget, 'set_int', '0') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision0Display.png', 300, 300); QtTesting.playCommand(subdivisionWidget, 'set_int', '1') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision1Display.png', 300, 300); QtTesting.playCommand(subdivisionWidget, 'set_int', '2') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision2Display.png', 300, 300); QtTesting.playCommand(subdivisionWidget, 'set_int', '3') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision3Display.png', 300, 300); QtTesting.playCommand(subdivisionWidget, 'set_int', '4') QtTestingImage.compareImage(snapshotWidget, 'NonlinearSubdivision4Display.png', 300, 300); # Restore rendering mode for any subsequent tests. QtTesting.playCommand(object1, 'activate', 'menu_Edit')
object1 = 'pqClientMainWindow/MainControlsToolbar/actionOpenData' QtTesting.playCommand(object1, 'activate', '') object2 = 'pqClientMainWindow/FileOpenDialog' QtTesting.playCommand( object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/Testing/Data/SPCTH/Dave_Karelitz_Small/spcth_a') object3 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/CellArrayStatus/1QHeaderView0' QtTesting.playCommand(object3, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object3, 'mouseRelease', '1,0,0,0,0,0') object4 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept' QtTesting.playCommand(object4, 'activate', '') object5 = 'pqClientMainWindow/representationToolbar/displayRepresentation/comboBox' QtTesting.playCommand(object5, 'set_string', 'Surface') object6 = 'pqClientMainWindow/cameraToolbar/actionNegativeY' QtTesting.playCommand(object6, 'activate', '') object7 = 'pqClientMainWindow/variableToolbar/displayColor/Variables' QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^)') object8 = 'pqClientMainWindow/menubar' QtTesting.playCommand(object8, 'activate', 'menuFilters') object9 = 'pqClientMainWindow/menubar/menuFilters/Alphabetical' QtTesting.playCommand(object9, 'activate', 'AMRDualContour') object10 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/SelectMaterialArrays/1QHeaderView0' QtTesting.playCommand(object10, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object10, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^) (partial)') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'CTHAMRContour.png', 300, 300)
QtTesting.playCommand(object41, 'set_double', '0.5') object42 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/1QScrollArea0/qt_scrollarea_viewport/1pqDisplayProxyEditorWidget0/pqDisplayProxyEditor/MantaDisplay/eta' #make refresh all three views object1 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTesting.playCommand(object1, 'mousePress', '(0.691244,0.23913,1,1,0)') QtTesting.playCommand(object1, 'mouseMove', '(0.691244,0.23913,1,0,0)') QtTesting.playCommand(object1, 'mouseRelease', '(0.691244,0.23913,1,0,0)') QtTesting.playCommand(object1, 'mousePress', '(0.37788,0.181818,1,1,0)') QtTesting.playCommand(object1, 'mouseMove', '(0.37788,0.181818,1,0,0)') QtTesting.playCommand(object1, 'mouseRelease', '(0.37788,0.181818,1,0,0)') object2 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/1/Viewport' QtTesting.playCommand(object2, 'mousePress', '(0.391705,0.199605,1,1,0)') QtTesting.playCommand(object2, 'mouseMove', '(0.391705,0.199605,1,0,0)') QtTesting.playCommand(object2, 'mouseRelease', '(0.391705,0.199605,1,0,0)') object3 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/2/Viewport' QtTesting.playCommand(object3, 'mousePress', '(0.686636,0.215415,1,1,0)') QtTesting.playCommand(object3, 'mouseMove', '(0.686636,0.215415,1,0,0)') QtTesting.playCommand(object3, 'mouseRelease', '(0.686636,0.215415,1,0,0)') QtTesting.playCommand(object2, 'mousePress', '(0.502304,0.22332,1,1,0)') QtTesting.playCommand(object2, 'mouseMove', '(0.502304,0.22332,1,0,0)') QtTesting.playCommand(object2, 'mouseRelease', '(0.502304,0.22332,1,0,0)') QtTesting.playCommand(object1, 'mousePress', '(0.465438,0.270751,1,1,0)') QtTesting.playCommand(object1, 'mouseMove', '(0.465438,0.270751,1,0,0)') QtTesting.playCommand(object1, 'mouseRelease', '(0.465438,0.270751,1,0,0)') # Image comparison snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager' QtTestingImage.compareImage(snapshotWidget, 'MantaImage.png', 300, 300);
QtTesting.playCommand(objecta2, 'activate', '') object3 = 'pqClientMainWindow/PluginManagerDialog/buttonBox/1QPushButton0' QtTesting.playCommand(object3, 'activate', '') #close the 3D view and make a manta view object4 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/MultiViewFrameMenu/CloseAction' QtTesting.playCommand(object4, 'activate', '') object5 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/1QWidget0/1QScrollArea0/qt_scrollarea_viewport/EmptyView/ConvertActionsFrame/Manta' QtTesting.playCommand(object5, 'activate', '') #show something hack3 = 'pqClientMainWindow/menubar' QtTesting.playCommand(hack3, 'activate', 'menuSources') hack4 = 'pqClientMainWindow/menubar/menuSources' QtTesting.playCommand(hack4, 'activate', 'SphereSource') object6 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept' QtTesting.playCommand(object6, 'activate', '') #test sphere 'glyphs' while we are at it objectfoo = 'pqClientMainWindow/representationToolbar/displayRepresentation/comboBox' QtTesting.playCommand(objectfoo, 'set_string', 'Points') object7 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTesting.playCommand(object7, 'mousePress', '(0.719373,0.369784,1,1,0)') QtTesting.playCommand(object7, 'mouseMove', '(0.605413,0.271942,1,0,0)') QtTesting.playCommand(object7, 'mouseRelease', '(0.605413,0.271942,1,0,0)') # Image comparison snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'MantaSSImage.png', 300, 300)
#/usr/bin/env python import QtTesting import QtTestingImage object1 = 'MainWindow/menubar/menuFile' QtTesting.playCommand(object1, 'activate', 'actionFileLoadServerState') object2 = 'MainWindow/ServerStartupBrowser/connect' QtTesting.playCommand(object2, 'activate', '') object3 = 'MainWindow/FileLoadServerStateDialog' QtTesting.playCommand(object3, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/LoadStateHistogram.pvsm') object4 = 'MainWindow/pipelineBrowserDock/pipelineBrowser/PipelineView' QtTesting.playCommand(object4, 'currentChanged', '/0/0/0|0') object5 = 'MainWindow/objectInspectorDock/1pqProxyTabWidget0/1QTabBar0' QtTesting.playCommand(object5, 'set_tab', '1') QtTesting.playCommand(object5, 'set_tab', '0') object6 = 'MainWindow/objectInspectorDock/1pqProxyTabWidget0/1QStackedWidget0/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/BinCount' QtTesting.playCommand(object6, 'set_string', '1') QtTesting.playCommand(object6, 'set_string', '16') object7 = 'MainWindow/objectInspectorDock/1pqProxyTabWidget0/1QStackedWidget0/objectInspector/Accept' QtTesting.playCommand(object7, 'activate', '') object8 = 'MainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/1/PlotWidget' QtTestingImage.compareImage(object8, 'HistogramChart.png', 400, 200)
#/usr/bin/env python import QtTesting import QtTestingImage import time object1 = 'MainWindow/mainToolBar/1QToolButton0' QtTesting.playCommand(object1, 'activate', '') object3 = 'MainWindow/FileOpenDialog' QtTesting.playCommand(object3, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/dualSphereAnimation.pvd') object4 = 'MainWindow/objectInspectorDock/1pqProxyTabWidget0/1QStackedWidget0/objectInspector/Accept' QtTesting.playCommand(object4, 'activate', '') object5 = 'MainWindow/VCRToolbar/1QToolButton2' QtTesting.playCommand(object5, 'activate', '') while QtTesting.getProperty(object5, 'text') != 'Play': time.sleep(0.2) snapshotWidget = 'MainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'VCRAnimation.png', 300, 300)
QtTesting.playCommand(object12, "activate", "") QtTesting.playCommand(object12, "activate", "actionFileSaveAnimation") object13 = "pqAnimationSettingsDialog/checkBoxDisconnect" QtTesting.playCommand(object13, "set_boolean", "true") object14 = "pqAnimationSettingsDialog/width" QtTesting.playCommand(object14, "set_string", "300") object14 = "pqAnimationSettingsDialog/height" QtTesting.playCommand(object14, "set_string", "300") object15 = "pqAnimationSettingsDialog/okButton" QtTesting.playCommand(object15, "activate", "") object16 = "pqClientMainWindow/FileSaveAnimationDialog" # Remove old files. QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0000.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0001.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0002.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0003.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0004.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0005.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0006.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0007.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0008.png") QtTesting.playCommand(object16, "remove", "$PARAVIEW_TEST_ROOT/disconnectSave.0009.png") QtTesting.playCommand(object16, "filesSelected", "$PARAVIEW_TEST_ROOT/disconnectSave.png") import time print "Wait for 20 secs" time.sleep(20) QtTestingImage.compareImage("$PARAVIEW_TEST_ROOT/disconnectSave.0005.png", "DisconnectAndSaveAnimation.png")
#/usr/bin/env python import QtTesting import QtTestingImage import time object1 = 'MainWindow/mainToolBar/1QToolButton0' QtTesting.playCommand(object1, 'activate', '') object3 = 'MainWindow/FileOpenDialog' QtTesting.playCommand(object3, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/dualSphereAnimation.pvd') object4 = 'MainWindow/objectInspectorDock/1pqProxyTabWidget0/1QStackedWidget0/objectInspector/Accept' QtTesting.playCommand(object4, 'activate', '') object5 = 'MainWindow/VCRToolbar/1QToolButton2' QtTesting.playCommand(object5, 'activate', '') while QtTesting.getProperty(object5, 'text') != 'Play': time.sleep(0.2) snapshotWidget = 'MainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'VCRAnimation.png', 300, 300);
QtTesting.playCommand(object4, 'mouseMove', '(0.225505,0.603083,1,0,0)') QtTesting.playCommand(object4, 'mouseRelease', '(0.225505,0.603083,1,0,0)') object5 = 'pqClientMainWindow/axesToolbar/1QToolButton0' QtTesting.playCommand(object5, 'set_boolean', 'false') object6 = 'pqClientMainWindow/variableToolbar/displayColor/Variables' QtTesting.playCommand(object6, 'set_string', 'cellNormals') QtTesting.playCommand(object6, 'set_string', 'thickness') object7 = 'pqClientMainWindow/menubar/menuFilters/pqProxyGroupMenuManager0/WarpVector' QtTesting.playCommand(object7, 'activate', '') QtTesting.playCommand(object3, 'activate', '') #object8 = 'pqClientMainWindow/menubar/menuTools' #QtTesting.playCommand(object8, 'activate', 'actionToolsRecordTestScreenshot') #object9 = 'pqClientMainWindow/RecordTestScreenshotDialog' #QtTesting.playCommand(object9, 'filesSelected', '$PARAVIEW_DATA_ROOT/Baseline/FileSeries1.png') snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'FileSeries1.png', 300, 300) object10 = 'pqClientMainWindow/currentTimeToolbar/qt_toolbar_ext_button' QtTesting.playCommand(object10, 'activate', '') QtTesting.playCommand(object10, 'activate', '') QtTesting.playCommand(object10, 'activate', '') QtTesting.playCommand(object10, 'activate', '') #object11 = 'pqClientMainWindow/currentTimeToolbar/1QToolBarHandle0' #QtTesting.playCommand(object11, 'mousePress', '1,1,0,10,18') #QtTesting.playCommand(object11, 'mouseRelease', '1,0,0,10,18') #QtTesting.playCommand(object11, 'mousePress', '1,1,0,8,17') #QtTesting.playCommand(object11, 'mouseMove', '1,0,0,8,16') #QtTesting.playCommand(object11, 'mouseRelease', '1,0,0,8,16') object12 = 'pqClientMainWindow/currentTimeToolbar/CurrentTimeIndex' QtTesting.playCommand(object12, 'key', '16777219') QtTesting.playCommand(object12, 'key', '16777219') QtTesting.playCommand(object12, 'set_int', '3')
QtTesting.playCommand(object4, 'mouseMove', '(0.225505,0.603083,1,0,0)') QtTesting.playCommand(object4, 'mouseRelease', '(0.225505,0.603083,1,0,0)') object5 = 'pqClientMainWindow/axesToolbar/1QToolButton0' QtTesting.playCommand(object5, 'set_boolean', 'false') object6 = 'pqClientMainWindow/variableToolbar/displayColor/Variables' QtTesting.playCommand(object6, 'set_string', 'cellNormals') QtTesting.playCommand(object6, 'set_string', 'thickness') object7 = 'pqClientMainWindow/menubar/menuFilters/pqProxyGroupMenuManager0/WarpVector' QtTesting.playCommand(object7, 'activate', '') QtTesting.playCommand(object3, 'activate', '') #object8 = 'pqClientMainWindow/menubar/menuTools' #QtTesting.playCommand(object8, 'activate', 'actionToolsRecordTestScreenshot') #object9 = 'pqClientMainWindow/RecordTestScreenshotDialog' #QtTesting.playCommand(object9, 'filesSelected', '$PARAVIEW_DATA_ROOT/Baseline/FileSeries1.png') snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'FileSeries1.png', 300, 300); object10 = 'pqClientMainWindow/currentTimeToolbar/qt_toolbar_ext_button' QtTesting.playCommand(object10, 'activate', '') QtTesting.playCommand(object10, 'activate', '') QtTesting.playCommand(object10, 'activate', '') QtTesting.playCommand(object10, 'activate', '') #object11 = 'pqClientMainWindow/currentTimeToolbar/1QToolBarHandle0' #QtTesting.playCommand(object11, 'mousePress', '1,1,0,10,18') #QtTesting.playCommand(object11, 'mouseRelease', '1,0,0,10,18') #QtTesting.playCommand(object11, 'mousePress', '1,1,0,8,17') #QtTesting.playCommand(object11, 'mouseMove', '1,0,0,8,16') #QtTesting.playCommand(object11, 'mouseRelease', '1,0,0,8,16') object12 = 'pqClientMainWindow/currentTimeToolbar/CurrentTimeIndex' QtTesting.playCommand(object12, 'key', '16777219') QtTesting.playCommand(object12, 'key', '16777219') QtTesting.playCommand(object12, 'set_int', '3')
object5 = 'pqClientMainWindow/centralwidget/MultiViewManager/MaximizeFrame/0/MultiViewFrameMenu/RestoreButton' QtTesting.playCommand(object5, 'activate', '') object6 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/MultiViewSplitter:0/0/MultiViewFrameMenu/CloseButton' QtTesting.playCommand(object6, 'activate', '') object7 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/MultiViewFrameMenu/CloseButton' QtTesting.playCommand(object7, 'activate', '') object8 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/MultiViewFrameMenu/CloseButton' QtTesting.playCommand(object8, 'activate', '') object9 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/MultiViewFrameMenu/SplitHorizontalButton' QtTesting.playCommand(object9, 'activate', '') object10 = 'pqClientMainWindow/pipelineBrowserDock/pipelineBrowser' QtTesting.playCommand(object10, 'currentChanged', '/0/2|0') #QtTesting.playCommand(object10, 'currentChanged', '/0/2|1') object11 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_tabbar' QtTesting.playCommand(object11, 'set_tab', '1') QtTesting.playCommand(object1, 'activate', 'actionFileSaveServerState') object13 = 'pqClientMainWindow/FileSaveServerStateDialog' QtTesting.playCommand(object13, 'filesSelected', '$PARAVIEW_TEST_ROOT/TestMultiView.pvsm') object14 = 'pqClientMainWindow/MainControlsToolbar/actionServerDisconnect' QtTesting.playCommand(object14, 'activate', '') object14a = "pqClientMainWindow/1QMessageBox0/qt_msgbox_buttonbox/1QPushButton0" QtTesting.playCommand(object14a, 'activate', '') QtTesting.playCommand(object1, 'activate', 'actionFileLoadServerState') #QtTesting.playCommand(object2, 'activate', '') QtTesting.playCommand(object3, 'filesSelected', '$PARAVIEW_TEST_ROOT/TestMultiView.pvsm') snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'LoadStateMultiView.png', 200, 200)
#/usr/bin/env python import QtTesting import QtTestingImage object1 = 'pqClientMainWindow/MainControlsToolbar/actionOpenData' QtTesting.playCommand(object1, 'activate', '') object2 = 'pqClientMainWindow/FileOpenDialog' QtTesting.playCommand( object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/Testing/Data/SPCTH/Dave_Karelitz_Small/spcth_a') object3 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/CellArrayStatus/1QHeaderView0' QtTesting.playCommand(object3, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object3, 'mouseRelease', '1,0,0,0,0,0') object4 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/Accept' QtTesting.playCommand(object4, 'activate', '') object5 = 'pqClientMainWindow/representationToolbar/displayRepresentation/comboBox' QtTesting.playCommand(object5, 'set_string', 'Surface') object6 = 'pqClientMainWindow/cameraToolbar/actionNegativeY' QtTesting.playCommand(object6, 'activate', '') object7 = 'pqClientMainWindow/variableToolbar/displayColor/Variables' QtTesting.playCommand(object7, 'set_string', 'Pressure (dynes/cm^2^)') object8 = 'pqClientMainWindow/variableToolbar/actionScalarBarVisibility' QtTesting.playCommand(object8, 'set_boolean', 'false') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'CTHAMRBaseline.png', 300, 300)
QtTesting.playCommand(object4, 'activate', '') object5 = 'MainWindow/MultiViewManager/MaximizeFrame/0/MultiViewFrameMenu/RestoreButton' QtTesting.playCommand(object5, 'activate', '') object6 = 'MainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/MultiViewSplitter:0/0/MultiViewFrameMenu/CloseButton' QtTesting.playCommand(object6, 'activate', '') object7 = 'MainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/0/MultiViewFrameMenu/CloseButton' QtTesting.playCommand(object7, 'activate', '') object8 = 'MainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/1/MultiViewFrameMenu/CloseButton' QtTesting.playCommand(object8, 'activate', '') object9 = 'MainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/1/MultiViewFrameMenu/SplitHorizontalButton' QtTesting.playCommand(object9, 'activate', '') object10 = 'MainWindow/pipelineBrowserDock/pipelineBrowser/PipelineView' QtTesting.playCommand(object10, 'currentChanged', '/0/2|0') #QtTesting.playCommand(object10, 'currentChanged', '/0/2|1') object11 = 'MainWindow/objectInspectorDock/1pqProxyTabWidget0/1QTabBar0' QtTesting.playCommand(object11, 'set_tab', '1') QtTesting.playCommand(object1, 'activate', 'actionFileSaveServerState') object13 = 'MainWindow/FileSaveServerStateDialog' QtTesting.playCommand(object13, 'filesSelected', '$PARAVIEW_TEST_ROOT/TestMultiView.pvsm') object14 = 'MainWindow/mainToolBar/1QToolButton3' QtTesting.playCommand(object14, 'activate', '') object14a ="MainWindow/1QMessageBox0/qt_msgbox_buttonbox/1QPushButton0" QtTesting.playCommand(object14a, 'activate', '') QtTesting.playCommand(object1, 'activate', 'actionFileLoadServerState') #QtTesting.playCommand(object2, 'activate', '') QtTesting.playCommand(object3, 'filesSelected', '$PARAVIEW_TEST_ROOT/TestMultiView.pvsm') snapshotWidget = 'MainWindow/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'LoadStateMultiView.png', 200, 200);
#/usr/bin/env python import QtTesting import QtTestingImage QtTesting.playCommand(object1, 'activate', '') QtTesting.playCommand(object2, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/SPCTH/Dave_Karelitz_Small/spcth_a') QtTesting.playCommand(object3, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object3, 'mouseMove', '1,0,0,0,0,0') QtTesting.playCommand(object3, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') QtTesting.playCommand(object10, 'activate', 'menuFilters') QtTesting.playCommand(object11, 'activate', 'MaterialInterfaceFilter') object23 = 'pqClientMainWindow/proxyTabDock/proxyTabWidget/qt_tabwidget_stackedwidget/objectInspector/ScrollArea/qt_scrollarea_viewport/PanelArea/Editor/SelectMassArray/1QHeaderView0' QtTesting.playCommand(object23, 'mousePress', '1,1,0,0,0,0') QtTesting.playCommand(object23, 'mouseRelease', '1,0,0,0,0,0') QtTesting.playCommand(object4, 'activate', '') # DO_IMAGE_COMPARE snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/Viewport' QtTestingImage.compareImage(snapshotWidget, 'CTHAMRMaterialInterfaceFilter.png', 300, 300)
QtTesting.playCommand(object10, "mousePress", "1,1,0,0,0,3") QtTesting.playCommand(object10, "mouseRelease", "1,1,0,0,0,3") object17 = "pqClientMainWindow/VCRToolbar/1QToolButton0" QtTesting.playCommand(object17, "activate", "") object18 = "pqClientMainWindow/VCRToolbar/1QToolButton3" # object19 = 'pqClientMainWindow/animationPanelDock/1pqAnimationPanel0/scrollArea/qt_scrollarea_viewport/AnimationPanel/keyFramePropertiesGroup/editorFrame/SignalAdaptorKeyFrameValue/lineEdit' # QtTesting.playCommand(object19, 'set_string', '10') # QtTesting.playCommand(object19, 'set_string', '10') object20 = "pqClientMainWindow/VCRToolbar/1QToolButton1" QtTesting.playCommand(object11, "activate", "Animation View") QtTesting.playCommand(object11, "activate", "Object Inspector") QtTesting.playCommand(object11, "activate", "Pipeline Browser") QtTesting.playCommand(object9, "activate", "actionFileSaveAnimation") object21 = "Dialog/spinBoxWidth" QtTesting.playCommand(object21, "set_int", "800") object22 = "Dialog/spinBoxHeight" QtTesting.playCommand(object22, "set_int", "800") object22 = "Dialog/okButton" QtTesting.playCommand(object22, "activate", "") objectSaveAnimationDialog = "FileSaveAnimationDialog" QtTesting.playCommand(objectSaveAnimationDialog, "filesSelected", "$PARAVIEW_TEST_ROOT/movie_test.png") time.sleep(3) objectPlayButton = "pqClientMainWindow/VCRToolbar/1QToolButton2" while QtTesting.getProperty(objectPlayButton, "text") != "Play": time.sleep(1) QtTestingImage.compareImage("$PARAVIEW_TEST_ROOT/movie_test.0005.png", "SaveAnimationMultiView.png")