-# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2020 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
+#
# 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")
@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")
@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")
@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>")
@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>")