Salome HOME
Merge branch 'python_parametric_api' of https://git.salome-platform.org/git/modules...
[modules/shaper.git] / test.squish / suite_ERROR_NOTIFICATION / tst_679 / test.py
1 #[tested functionality] 1. Add parameter 2. Use wrong parameter name 3. Error notification in header 3. Error notification in widget
2
3 def main():
4     source(findFile("scripts", "common.py"))
5     
6     startApplication("salome_run.sh")
7     
8     activate_newgeom()
9     
10     clickButton(waitForObject(":SALOME*.Parameter_QToolButton"))
11     type(waitForObject(":Parameter_QLineEdit"), "a")
12     type(waitForObject(":Parameter_ExpressionEditor"), "3")
13     clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton"))
14     
15     clickButton(waitForObject(":SALOME*.ConstructionPoint_QToolButton"))
16     type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
17     type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "a")
18     waitFor("object.exists(':Point.x_ModuleBase_ParamSpinBox')", 20000)
19     test.compare(str(findObject(":Point.x_ModuleBase_ParamSpinBox").toolTip), "X coordinate")
20
21     type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
22     type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "b")
23
24     waitFor("object.exists(':Point_QFrame')", 20000)
25     
26     test.compare(str(findObject(":Point_QFrame").toolTip), "ModelAPI_StateInvalidArgument")
27     
28     waitFor("object.exists(':Point.x_ModuleBase_ParamSpinBox')", 20000)
29     test.compare(str(findObject(":Point.x_ModuleBase_ParamSpinBox").toolTip), "X coordinate\nErrors:\nx - Model_AttributeValidator: name 'b' is not defined")
30
31     close_application()