+# Copyright (C) 2014-2019 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_003
- #[Topic] 'RevolutionCut by angles' functionality
- #[Tested functionality]
- #[Summary description]
- #[Expected results]
- #[General comments]
-
+ # [project] SHAPER
+ # [Scenario] Revolution_003
+ # [Topic] 'RevolutionCut 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_003.hdf'
+
+ # [step] Open 'for_revolution_003.hdf'
open(DATA_PATH + "/for_revolution_003.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)")
clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 71, 10, 0, Qt.LeftButton)
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()
-
- #[step] Execute RevolutionFuse operation
+ test.vp("INIT")
+
+ # TODO(spo): remove: workaround for the bug given RevolutionCut sketch created when select axis_object then apply is disabled
+ waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1")
+ clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1", 10, 10, 0, Qt.LeftButton)
+ openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Sketch\\_1", 10, 10, 0)
+ activateItem(waitForObjectItem(":_QMenu", "Edit..."))
+ clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
+
+ # [step] Execute RevolutionCut operation
mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
mouseClick(waitForObjectItem(":_QMenu", "RevolutionCut"))
-
- #[step] Select sketch face
+
+ # [step] Select sketch face
mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 287, 236, 0, Qt.LeftButton)
- # [step] Create 2 circles
- circle_create_in_view((650, 364), (671, 392))
- circle_create_in_view((641, 114), (664, 141))
-
- #[step] Approve sketching
+ # [step] Click "Set plane view" in property panel [vp PLANE]
+ clickButton(waitForObject(":Sketcher plane.Set plane view_QPushButton"))
+ test.vp("PLANE")
+
+ # [step] Create 2 circles on the plane [vp CIRCLES]
+ activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
+ activateItem(waitForObjectItem(":Sketch_QMenu", "Circle"))
+ mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 650, 350, 0, Qt.LeftButton)
+ mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 690, 350, 0, Qt.LeftButton)
+ clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
+
+ activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
+ activateItem(waitForObjectItem(":Sketch_QMenu", "Circle"))
+ mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 650, 110, 0, Qt.LeftButton)
+ mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 700, 110, 0, Qt.LeftButton)
+ clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
+
+ test.vp("CIRCLES")
+
+ # [step] Approve sketching
clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton"))
-
+
# [step] Select axis for revolution
- mouseClick(waitForObject(":Revolution_QLineEdit_3"), 103, 11, 0, Qt.LeftButton)
+ mouseClick(waitForObject(":Revolution_QLineEdit_3"), 10, 10, 0, Qt.LeftButton)
mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 750, 237, 0, Qt.LeftButton)
-
- #[step] Define angle 'To'
- mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit_5"), 61, 9, 0, Qt.LeftButton)
+
+ # [step] Define angle 'To'
+ mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit_5"), 10, 10, 0, Qt.LeftButton)
type(waitForObject(":Revolution.to_angle_ModuleBase_ParamSpinBox_3"), "<Ctrl+A>")
type(waitForObject(":Revolution.to_angle_ModuleBase_ParamSpinBox_3"), 90)
- #[step] Define angle 'From'
- mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit_6"), 104, 13, 0, Qt.LeftButton)
+ # [step] Define angle 'From'
+ mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit_6"), 10, 10, 0, Qt.LeftButton)
type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox_3"), "<Ctrl+A>")
type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox_3"), 90)
+ type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox_3"), "<Return>")
-
- #[step] Ok
+ # [step] Apply the feature
clickButton(waitForObject(":RevolutionCut.property_panel_ok_QToolButton"))
-
- #[step] Rotate the model
- type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
- mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 558, 413, -33, -137, 67108866, Qt.RightButton)
-
- #[check] Check that operation has been executed successfully
- test.vp("VP1")
+
+ # [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
+
+ # [check] Check that operation has been executed successfully
+ test.vp("REVOLUTION_CUT")
# [step] Close application without saving
close_application()