1 ## Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 ## This library is free software; you can redistribute it and/or
4 ## modify it under the terms of the GNU Lesser General Public
5 ## License as published by the Free Software Foundation; either
6 ## version 2.1 of the License, or (at your option) any later version.
8 ## This library is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ## Lesser General Public License for more details.
13 ## You should have received a copy of the GNU Lesser General Public
14 ## License along with this library; if not, write to the Free Software
15 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 def set_parameter_value(name, value):
22 openContextMenu(waitForObject(":Parameters.%s = _QModelIndex" % name), 10, 10, 0)
23 activateItem(waitForObjectItem(":_QMenu", "Edit..."))
24 mouseClick(waitForObject(":Parameter_ExpressionEditor"), 10, 10, 0, Qt.LeftButton)
25 type(waitForObject(":Parameter_ExpressionEditor"), "<Ctrl+A>")
26 type(waitForObject(":Parameter_ExpressionEditor"), value)
27 type(waitForObject(":Parameter_ExpressionEditor"), "<Return>")
28 clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
32 # [Scenario] 'Platine' model created by PythonAPI
33 # [Topic] PythonAPI functionality
34 # [Tested functionality]
35 # [Summary description]
39 source(findFile("scripts", "common.py"))
41 # [section] Application start
42 # [step] Launch SALOME
43 startApplication("salome_run.sh")
47 # [step] Activate Shaper module and create new file
50 # [step] In Python console type: import examples.Platine
51 type(waitForObject(":Python Console_PyConsole_EnhEditor"), "import examples.Platine")
52 type(waitForObject(":Python Console_PyConsole_EnhEditor"), "<Return>")
54 # [step] Check that the model is correct [vp VP_PLATINE]
55 clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
58 # [step] Check that the object browser contains all objects from the model [vp VP_TREE]
59 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (3)")
60 clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (3)", -10, 10, 0, Qt.LeftButton)
61 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Constructions (3)")
62 clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Constructions (3)", -10, 10, 0, Qt.LeftButton)
63 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Bodies (1)")
64 clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Bodies (1)", -10, 10, 0, Qt.LeftButton)
65 # Tree is under modification, so it can not be checked by a picture
66 # Moreover a mask for a text should be provided to check it on different platforms
69 # [step] Change parameter values: L = 64, E = 5, P = 80
70 set_parameter_value("L", 64)
71 set_parameter_value("E", 5)
72 set_parameter_value("P", 80)
73 clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
74 mouseMove(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 320, 240)
75 test.vp("VP_PLATINE_E")
77 # [step] Change parameter values: L = 90, E = 20, P = 80
78 set_parameter_value("L", 90)
79 set_parameter_value("E", 20)
80 set_parameter_value("P", 80)
81 clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
82 mouseMove(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 320, 240)
83 test.vp("VP_PLATINE_L")
85 # [step] Change parameter values: L = 64, E = 20, P = 120
86 set_parameter_value("L", 64)
87 set_parameter_value("E", 20)
88 set_parameter_value("P", 120)
89 clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
90 mouseMove(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 320, 240)
91 test.vp("VP_PLATINE_P")
93 # [step] Close application