1 def set_parameter_value(name, value):
2 openContextMenu(waitForObject(":Parameters.%s = _QModelIndex" % name), 10, 10, 0)
3 activateItem(waitForObjectItem(":_QMenu", "Edit..."))
4 mouseClick(waitForObject(":Parameter_ExpressionEditor"), 10, 10, 0, Qt.LeftButton)
5 type(waitForObject(":Parameter_ExpressionEditor"), "<Ctrl+A>")
6 type(waitForObject(":Parameter_ExpressionEditor"), value)
7 type(waitForObject(":Parameter_ExpressionEditor"), "<Return>")
8 clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
12 # [Scenario] 'Platine' model created by PythonAPI
13 # [Topic] PythonAPI functionality
14 # [Tested functionality]
15 # [Summary description]
19 source(findFile("scripts", "common.py"))
21 # [section] Application start
22 # [step] Launch SALOME
23 startApplication("salome_run.sh")
27 # [step] Activate Shaper module and create new file
30 # [step] In Python console type: import examples.Platine
31 type(waitForObject(":Python Console_PyConsole_EnhEditor"), "import examples.Platine")
32 type(waitForObject(":Python Console_PyConsole_EnhEditor"), "<Return>")
34 # [step] Check that the model is correct [vp VP_PLATINE]
35 clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
38 # [step] Check that the object browser contains all objects from the model [vp VP_TREE]
39 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (3)")
40 clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (3)", -10, 10, 0, Qt.LeftButton)
41 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Constructions (3)")
42 clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Constructions (3)", -10, 10, 0, Qt.LeftButton)
43 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Bodies (1)")
44 clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Bodies (1)", -10, 10, 0, Qt.LeftButton)
47 # [step] Change parameter values: L = 64, E = 5, P = 80
48 set_parameter_value("L", 64)
49 set_parameter_value("E", 5)
50 set_parameter_value("P", 80)
51 clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
52 test.vp("VP_PLATINE_E")
54 # [step] Change parameter values: L = 90, E = 20, P = 80
55 set_parameter_value("L", 90)
56 set_parameter_value("E", 20)
57 set_parameter_value("P", 80)
58 clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
59 test.vp("VP_PLATINE_L")
61 # [step] Change parameter values: L = 64, E = 20, P = 120
62 set_parameter_value("L", 64)
63 set_parameter_value("E", 20)
64 set_parameter_value("P", 120)
65 clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
66 test.vp("VP_PLATINE_P")
68 # [step] Cloase application