Salome HOME
updated copyright message
[modules/shaper.git] / test.squish / suite_FEATURE_PARAMETERS / shared / steps / steps.py
index e65974ab17c94eb551b1bbd140f2128f69947e1c..e814aa94559b9c57c1fc36d7c62f3521e6b9f3e9 100644 (file)
@@ -1,4 +1,21 @@
-# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2023  CEA, EDF
+#
+# 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
+#
 
 # A quick introduction to implementing scripts for BDD tests:
 #
 # specified. In that case, make sure to set the (optional) 'regexp' argument
 # to True.
 
-import __builtin__
+import builtins
 
 @Given("Launch application in salome mode")
 def step(context):
     startApplication("salome_run.sh")
-    clickButton(waitForObject(":SALOME*.SHAPER_QToolButton"))
+    clickButton(waitForObject(":SALOME*.Shaper_QToolButton"))
     clickButton(waitForObject(":Activate module.New_QPushButton"))
 
 @When("Create parameter a=30")
@@ -77,7 +94,8 @@ def step(context):
 
 @Then("Check that Point does not allow using expressions")
 def step(context):
-    clickButton(waitForObject(":SALOME*.SketchPoint_QToolButton"))
+    activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
+    activateItem(waitForObjectItem(":Sketch_QMenu", "Point"))
     mouseClick(waitForObject(":Point.qt_spinbox_lineedit_QLineEdit"), 41, 6, 0, Qt.LeftButton)
     type(waitForObject(":Point.X _ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Point.X _ModuleBase_ParamSpinBox"), "a")
@@ -117,7 +135,8 @@ def step(context):
 
 @Then("Check that Circle does not allow using expressions")
 def step(context):
-    clickButton(waitForObject(":SALOME*.Circle_QToolButton"))
+    activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
+    activateItem(waitForObjectItem(":Sketch_QMenu", "Circle"))
     mouseClick(waitForObject(":Center.qt_spinbox_lineedit_QLineEdit"), 90, 4, 0, Qt.LeftButton)
     type(waitForObject(":Center.X _ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Center.X _ModuleBase_ParamSpinBox"), "a")
@@ -137,7 +156,8 @@ def step(context):
 
 @Then("Check that Arc does not allow using expressions")
 def step(context):
-    clickButton(waitForObject(":SALOME*.Arc_QToolButton"))
+    activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
+    activateItem(waitForObjectItem(":Sketch_QMenu", "Arc"))
     mouseClick(waitForObject(":Center.qt_spinbox_lineedit_QLineEdit_3"), 156, 6, 0, Qt.LeftButton)
     type(waitForObject(":Center.X _ModuleBase_ParamSpinBox_2"), "A")
     type(waitForObject(":Center.X _ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
@@ -174,12 +194,14 @@ def step(context):
 
 @Then("Check that Fillet does not allow using expressions")
 def step(context):
-    clickButton(waitForObject(":SALOME*.Line_QToolButton"))
+    activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
+    activateItem(waitForObjectItem(":Sketch_QMenu", "Line"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 131, 282, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 209, 98, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 283, 275, 0, Qt.LeftButton)
-    clickButton(waitForObject(":Line.property_panel_cancel_QToolButton"))
-    clickButton(waitForObject(":SALOME*.Fillet_QToolButton"))
+    #TODO_1 clickButton(waitForObject(":Line.property_panel_cancel_QToolButton"))
+    activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
+    activateItem(waitForObjectItem(":Sketch_QMenu", "Fillet"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 211, 99, 0, Qt.LeftButton)
     type(waitForObject(":Fillet.ConstraintValue_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Fillet.ConstraintValue_ModuleBase_ParamSpinBox"), "<Keypad_1>")