本文整理汇总了Python中QtTestingImage类的典型用法代码示例。如果您正苦于以下问题:Python QtTestingImage类的具体用法?Python QtTestingImage怎么用?Python QtTestingImage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QtTestingImage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_compare_image
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);
示例2:
#/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)
示例3: magnetic
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);
示例4:
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)
示例5:
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);
示例6:
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)
示例7:
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')
示例8:
#/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)
示例9:
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');
示例10:
#/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)
示例11:
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'
示例12:
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", "")
示例13:
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');
示例14:
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)
示例15:
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');