Commit 919f78f7 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Converting Python test to XML

parent 4b7b71b3
...@@ -11,7 +11,6 @@ SET (TESTS_WITH_BASELINES ...@@ -11,7 +11,6 @@ SET (TESTS_WITH_BASELINES
# ${CMAKE_CURRENT_SOURCE_DIR}/CTHAMRMaterialInterfaceFilter.py # ${CMAKE_CURRENT_SOURCE_DIR}/CTHAMRMaterialInterfaceFilter.py
${CMAKE_CURRENT_SOURCE_DIR}/FileSeries.py ${CMAKE_CURRENT_SOURCE_DIR}/FileSeries.py
${CMAKE_CURRENT_SOURCE_DIR}/NonlinearSubdivisionDisplay.py ${CMAKE_CURRENT_SOURCE_DIR}/NonlinearSubdivisionDisplay.py
${CMAKE_CURRENT_SOURCE_DIR}/SLACTools.py
) )
IF(PARAVIEW_BUILD_PLUGIN_StreamingView) IF(PARAVIEW_BUILD_PLUGIN_StreamingView)
...@@ -35,9 +34,7 @@ SET (DisconnectAndSaveAnimation_DISABLE_CRS TRUE) ...@@ -35,9 +34,7 @@ SET (DisconnectAndSaveAnimation_DISABLE_CRS TRUE)
set (FileSeries_BREAK TRUE) set (FileSeries_BREAK TRUE)
set (DisconnectAndSaveAnimation_BREAK TRUE) set (DisconnectAndSaveAnimation_BREAK TRUE)
set (NonlinearSubdivisionDisplay_DISABLE_CRS TRUE) set (NonlinearSubdivisionDisplay_DISABLE_CRS TRUE)
SET (SLACTools_DISABLE_CS TRUE)
SET (SLACTools_DISABLE_CRS TRUE)
SET (SLACTools_BREAK TRUE)
set (MantaServerSideTest_DISABLE_C TRUE) set (MantaServerSideTest_DISABLE_C TRUE)
set (MantaServerSideTest_DISABLE_CRS TRUE) set (MantaServerSideTest_DISABLE_CRS TRUE)
SET (MantaTest_BREAK TRUE) SET (MantaTest_BREAK TRUE)
...@@ -60,9 +57,6 @@ set (StreamingServerSideTest_DISABLE_C TRUE) ...@@ -60,9 +57,6 @@ set (StreamingServerSideTest_DISABLE_C TRUE)
set (StreamingServerSideTest_DISABLE_CRS TRUE) set (StreamingServerSideTest_DISABLE_CRS TRUE)
SET (StreamingServerSideTest_BREAK TRUE) SET (StreamingServerSideTest_BREAK TRUE)
# Set image threshold overrides for the tests.
SET(SLACTools_THRESHOLD 20)
add_client_tests("pypv" add_client_tests("pypv"
TEST_SCRIPTS ${TESTS_WITHOUT_BASELINES} TEST_SCRIPTS ${TESTS_WITHOUT_BASELINES}
PARALLEL) PARALLEL)
......
#/usr/bin/env python
import QtTesting
import QtTestingImage
#############################################################################
# Load the SLACTools plugin.
object1 = 'pqClientMainWindow/menubar'
QtTesting.playCommand(object1, 'activate', 'menuTools')
object2 = 'pqClientMainWindow/menubar/menuTools'
QtTesting.playCommand(object2, 'activate', 'actionManage_Plugins')
object3 = 'pqClientMainWindow/PluginManagerDialog/localGroup/localPlugins'
QtTesting.playCommand(object3, 'setCurrent', 'SLACTools')
object4 = 'pqClientMainWindow/PluginManagerDialog/localGroup/loadSelected_Local'
QtTesting.playCommand(object4, 'activate', '')
object5 = 'pqClientMainWindow/PluginManagerDialog/buttonBox/1QPushButton0'
QtTesting.playCommand(object5, 'activate', '')
#############################################################################
# Load the pic-example SLAC files.
object6 = 'pqSLACActionHolder/actionDataLoadManager'
QtTesting.playCommand(object6, 'activate', '')
object7 = 'pqClientMainWindow/pqSLACDataLoadManager/meshFile/FileButton'
QtTesting.playCommand(object7, 'activate', '')
object8 = 'pqClientMainWindow/pqSLACDataLoadManager/meshFile/pqFileDialog'
QtTesting.playCommand(object8, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/mesh.ncdf')
object9 = 'pqClientMainWindow/pqSLACDataLoadManager/modeFile/FileButton'
QtTesting.playCommand(object9, 'activate', '')
object8 = 'pqClientMainWindow/pqSLACDataLoadManager/modeFile/pqFileDialog'
QtTesting.playCommand(object8, 'filesSelected', '$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/fields_..mod')
object10 = 'pqClientMainWindow/pqSLACDataLoadManager/particlesFile/FileButton'
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);
#############################################################################
# Rotate the camera, show front wireframe + solid back, show electric (e)
# field scaled to all time steps, turn off particles.
# Make window 300x300
object1 = 'pqClientMainWindow/menubar'
QtTesting.playCommand(object1, 'activate', 'menuTools')
object2 = 'pqClientMainWindow/menubar/menuTools'
QtTesting.playCommand(object2, 'activate', 'actionTesting_Window_Size')
object3 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport'
QtTesting.playCommand(object3, 'mousePress', '(0.863333,0.543333,1,1,0)')
QtTesting.playCommand(object3, 'mouseMove', '(0.743333,0.633333,1,0,0)')
QtTesting.playCommand(object3, 'mouseRelease', '(0.743333,0.633333,1,0,0)')
# Restore window
QtTesting.playCommand(object1, 'activate', 'menuTools')
QtTesting.playCommand(object2, 'activate', 'actionTesting_Window_Size')
object4 = 'pqSLACActionHolder/actionWireframeAndBackMesh'
QtTesting.playCommand(object4, 'activate', '')
object5 = 'pqSLACActionHolder/actionShowEField'
QtTesting.playCommand(object5, 'activate', '')
object6 = 'pqSLACActionHolder/actionTemporalResetRange'
QtTesting.playCommand(object6, 'activate', '')
object7 = 'pqSLACActionHolder/actionShowParticles'
QtTesting.playCommand(object7, 'set_boolean', 'false')
#Image compare
snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport'
QtTestingImage.compareImage(snapshotWidget, 'SLACToolsWireEFieldTempResetHideP.png', 300, 300);
#############################################################################
# Restore black background, restore solid, restore particles, restore camera
object1 = 'pqSLACActionHolder/actionToggleBackgroundBW'
QtTesting.playCommand(object1, 'activate', '')
object2 = 'pqSLACActionHolder/actionSolidMesh'
QtTesting.playCommand(object2, 'activate', '')
object3 = 'pqSLACActionHolder/actionShowParticles'
QtTesting.playCommand(object3, 'set_boolean', 'true')
object5 = 'pqSLACActionHolder/actionShowStandardViewpoint'
QtTesting.playCommand(object5, 'activate', '')
#Image compare
snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport'
QtTestingImage.compareImage(snapshotWidget, 'SLACToolsBlackBackReset.png', 300, 300);
#############################################################################
# Plot over Z axis, change time.
object6 = 'pqSLACActionHolder/actionPlotOverZ'
QtTesting.playCommand(object6, 'activate', '')
object7 = 'pqClientMainWindow/VCRToolbar/actionVCRNextFrame'
QtTesting.playCommand(object7, 'activate', '')
object8 = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/MultiViewFrameMenu/CloseAction'
QtTesting.playCommand(object8, 'activate', '')
#Image compare
snapshotWidget = 'pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport'
QtTestingImage.compareImage(snapshotWidget, 'SLACToolsPlotOverZ.png', 300, 300);
...@@ -9,6 +9,7 @@ SET (TESTS_WITH_INLINE_COMPARES ...@@ -9,6 +9,7 @@ SET (TESTS_WITH_INLINE_COMPARES
${CMAKE_CURRENT_SOURCE_DIR}/LoadStateMultiView.xml ${CMAKE_CURRENT_SOURCE_DIR}/LoadStateMultiView.xml
${CMAKE_CURRENT_SOURCE_DIR}/RenderNan.xml ${CMAKE_CURRENT_SOURCE_DIR}/RenderNan.xml
${CMAKE_CURRENT_SOURCE_DIR}/SaveLargeScreenshot.xml ${CMAKE_CURRENT_SOURCE_DIR}/SaveLargeScreenshot.xml
${CMAKE_CURRENT_SOURCE_DIR}/SLACTools.xml
) )
SET (TESTS_WITH_BASELINES) SET (TESTS_WITH_BASELINES)
...@@ -205,6 +206,11 @@ SET (XYHistogram_THRESHOLD 60) ...@@ -205,6 +206,11 @@ SET (XYHistogram_THRESHOLD 60)
SET (NewColorEditor1_THRESHOLD 60) SET (NewColorEditor1_THRESHOLD 60)
SET (NewColorEditor3_THRESHOLD 60) SET (NewColorEditor3_THRESHOLD 60)
SET (SLACTools_DISABLE_CS TRUE)
SET (SLACTools_DISABLE_CRS TRUE)
SET (SLACTools_BREAK TRUE)
SET(SLACTools_THRESHOLD 20)
# Histogram filter produces different results when running in parallel, so # Histogram filter produces different results when running in parallel, so
# disable it. # disable it.
IF (PARAVIEW_USE_MPI) IF (PARAVIEW_USE_MPI)
......
<?xml version="1.0" ?>
<pqevents>
<!--
Load the SLACTools plugin.
-->
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuTools" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionManage_Plugins" />
<pqevent object="pqClientMainWindow/PluginManagerDialog/localGroup/localPlugins" command="setCurrent" arguments="SLACTools" />
<pqevent object="pqClientMainWindow/PluginManagerDialog/localGroup/loadSelected_Local" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/PluginManagerDialog/buttonBox/1QPushButton0" command="activate" arguments="" />
<!--
Load the pic-example SLAC files.
-->
<pqevent object="pqSLACActionHolder/actionDataLoadManager" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pqSLACDataLoadManager/meshFile/FileButton" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pqSLACDataLoadManager/meshFile/pqFileDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/mesh.ncdf" />
<pqevent object="pqClientMainWindow/pqSLACDataLoadManager/modeFile/FileButton" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pqSLACDataLoadManager/modeFile/pqFileDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/fields_..mod" />
<pqevent object="pqClientMainWindow/pqSLACDataLoadManager/particlesFile/FileButton" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pqSLACDataLoadManager/particlesFile/pqFileDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/Data/SLAC/pic-example/particles_..ncdf" />
<pqevent object="pqClientMainWindow/pqSLACDataLoadManager/buttonBox/1QPushButton0" command="activate" arguments="" />
<!--
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.
-->
<pqevent object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" command="mousePress" arguments="(0.5,0.5,1,1,0)" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" command="mouseRelease" arguments="(0.5,0.5,1,0,0)" />
<pqcompareview object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" baseline="$PARAVIEW_DATA_ROOT/Baseline/SLACToolsInitialLoad.png" width="300" height="300" />
<!--
Show the magnetic (b) field and change the representation to solid+wireframe.
-->
<pqevent object="pqSLACActionHolder/actionShowBField" command="activate" arguments="" />
<pqevent object="pqSLACActionHolder/actionWireframeSolidMesh" command="activate" arguments="" />
<pqcompareview object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" baseline="$PARAVIEW_DATA_ROOT/Baseline/SLACToolsBFieldWireSolid.png" width="300" height="300" />
<!--
Rotate the camera, show front wireframe + solid back, show electric (e)
field scaled to all time steps, turn off particles.
-->
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuTools" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" command="mousePress" arguments="(0.863333,0.543333,1,1,0)" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" command="mouseMove" arguments="(0.743333,0.633333,1,0,0)" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" command="mouseRelease" arguments="(0.743333,0.633333,1,0,0)" />
<!--
Restore window
-->
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuTools" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqSLACActionHolder/actionWireframeAndBackMesh" command="activate" arguments="" />
<pqevent object="pqSLACActionHolder/actionShowEField" command="activate" arguments="" />
<pqevent object="pqSLACActionHolder/actionTemporalResetRange" command="activate" arguments="" />
<pqevent object="pqSLACActionHolder/actionShowParticles" command="set_boolean" arguments="false" />
<pqcompareview object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" baseline="$PARAVIEW_DATA_ROOT/Baseline/SLACToolsWireEFieldTempResetHideP.png" width="300" height="300" />
<!--
Restore black background, restore solid, restore particles, restore camera
-->
<pqevent object="pqSLACActionHolder/actionToggleBackgroundBW" command="activate" arguments="" />
<pqevent object="pqSLACActionHolder/actionSolidMesh" command="activate" arguments="" />
<pqevent object="pqSLACActionHolder/actionShowParticles" command="set_boolean" arguments="true" />
<pqevent object="pqSLACActionHolder/actionShowStandardViewpoint" command="activate" arguments="" />
<pqcompareview object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" baseline="$PARAVIEW_DATA_ROOT/Baseline/SLACToolsBlackBackReset.png" width="300" height="300" />
<!--
Plot over Z axis, change time.
-->
<pqevent object="pqSLACActionHolder/actionPlotOverZ" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/VCRToolbar/actionVCRNextFrame" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/MultiViewFrameMenu/CloseAction" command="activate" arguments="" />
<pqcompareview object="pqClientMainWindow/centralwidget/MultiViewManager/SplitterFrame/MultiViewSplitter/0/Viewport" baseline="$PARAVIEW_DATA_ROOT/Baseline/SLACToolsPlotOverZ.png" width="300" height="300" />
</pqevents>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment