+# Copyright (C) 2014-2023 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
def main():
- #[project] NewGEOM
- #[Scenario] Revolution_001
- #[Topic] 'Revolution by angles' functionality
- #[Tested functionality]
- #[Summary description]
- #[Expected results]
- #[General comments]
-
+ # [project] SHAPER
+ # [Scenario] Revolution_001
+ # [Topic] 'Revolution by angles' functionality
+ # [Tested functionality]
+ # [Summary description]
+ # [Expected results]
+ # [General comments]
+
source(findFile("scripts", "common.py"))
-
- #[section] Application start
- #[step] Launch SALOME
+
+ # [section] Application start
+ # [step] Launch SALOME
startApplication("salome_run.sh")
set_defaults()
-
- #[step] Open 'for_revolution_001.hdf'
+
+ # [step] Open 'for_revolution_001.hdf'
open(DATA_PATH + "/for_revolution_001.hdf")
-
- #[step] Activate NewGeom
- clickButton(waitForObject(":SALOME*.NewGeom_QToolButton"))
+
+ # [step] Activate SHAPER
+ clickButton(waitForObject(":SALOME*.Shaper_QToolButton"))
# [step] Activate Part_1
waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 70, 9, 0)
activateItem(waitForObjectItem(":_QMenu", "Activate"))
-
- #[step] Fit all
+ # [step] Fit all [vp INIT]
fit_all()
-
+ test.vp("INIT")
- # [step] Execute revolution by angles
+ # [step] Execute revolution by angles
mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
mouseClick(waitForObjectItem(":_QMenu", "Revolution"))
-
- #[step] Click '-OZ' button
+
+ # [step] Click '+OY' button
clickButton(waitForObject(":SALOME*.+OY_QToolButton"))
-
- #[step] Fit all
+
+ # [step] Fit all [vp +OY]
fit_all()
+ test.vp("+OY")
- # [step] Select skecth for revolution
- mouseClick(waitForObject(":Revolution.Select a sketch face_QListWidget"), 77, 38, 0, Qt.LeftButton)
- mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 440, 221, 0, Qt.LeftButton)
+ # [step] Select sketch for revolution
+ mouseClick(waitForObject(":Revolution.Select a sketch face_QListWidget"), 10, 10, 0, Qt.LeftButton)
+ mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 431, 180, 0, Qt.LeftButton)
# [step] Select vector
- mouseClick(waitForObject(":Revolution_QLineEdit"), 116, 11, 0, Qt.LeftButton)
- mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"),306, 399, 0, Qt.LeftButton)
-
- #[step] Input angle 'To'
+
+ mouseClick(waitForObject(":Revolution_QLineEdit"), 186, 8, 0, Qt.LeftButton)
+ mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 307, 328, 0, Qt.LeftButton)
+
+ # [step] Fit all [vp AFTER_SELECTION]
+ fit_all()
+ test.vp("AFTER_SELECTION")
+
+ # [step] Click 'Reset view' toolbar button
+ clickButton(waitForObject(":SALOME*.Reset_QToolButton_2"))
+ mouseClick(waitForObject(":SALOME*_OCCViewer_ViewPort3d"), 10, 450, 0, Qt.LeftButton) # close tool bar extension bar
+
+ test.vp("AFTER_SELECTION_RESET")
+
+ # [step] Input angle 'To'
type(waitForObject(":Revolution.to_angle_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
type(waitForObject(":Revolution.to_angle_ModuleBase_ParamSpinBox"), 90)
-
- #[step] Input angle 'From'
+
+ # [step] Input angle 'From'
type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox"), 120)
-
- #[step] Rotate the model
- mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 546, 182, -154, 50, 67108866, Qt.RightButton)
-
- #[step] Fit all
+ type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox"), "<Return>")
+
+ # [check] Check that preview is updated [cp AFTER_ANGLE_90_120]
fit_all()
-
- #[check] Check that preview is updated
- test.vp("VP1")
- mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit"), 58, 8, 0, Qt.LeftButton)
+ test.vp("AFTER_ANGLE_90_120")
- # [step] Input new angle 'To'
- mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit"), 58, 8, 0, Qt.LeftButton)
+ # [step] Clear the angle 'To'
+ mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit"), 10, 10, 0, Qt.LeftButton)
type(waitForObject(":Revolution.to_angle_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
type(waitForObject(":Revolution.to_angle_ModuleBase_ParamSpinBox"), "<Delete>")
- #[step] Input new angle 'From'
- mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit_2"), 52, 12, 0, Qt.LeftButton)
+ # [step] Input new angle 'From': 360
+ mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit_2"), 10, 10, 0, Qt.LeftButton)
type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox"), 360)
+ type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox"), "<Return>")
- #[step] Ok
+ # [step] Apply the feature
clickButton(waitForObject(":Revolution.property_panel_ok_QToolButton"))
-
- #[step] Fit all
+
+ # [check] Check that operation has been executed successfully [cp AFTER_ANGLE_360]
fit_all()
-
- #[check] Check that operation has been executed successfully
- test.vp("VP2")
-
+ test.vp("AFTER_ANGLE_360")
+
# [step] Close application without saving
close_application()