Salome HOME
40b767f6ea1381e46bb969fc050b4dc13bba2a85
[modules/shaper.git] / test.squish / suite_ISSUES_SALOME / tst_903 / test.py
1 def main():
2     source(findFile("scripts", "common.py"))
3     
4     startApplication("salome_run.sh")
5    
6     activate_newgeom()
7
8     #[step] Click menu Part->Parameter    
9     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part"))
10     activateItem(waitForObjectItem(":Part_QMenu", "Parameter"))
11     mouseClick(waitForObject(":Parameter_QLineEdit"), 79, 8, 0, Qt.LeftButton)
12     #[step] Check that feature ToolTip is: Model_FeatureValidator: Attribute "expression" is not initialized.
13     waitFor("object.exists(':Parameter_QFrame')", 20000)
14     test.compare(str(findObject(":Parameter_QFrame").toolTip), "Model_FeatureValidator: Attribute \"expression\" is not initialized.")
15     #[step] Check that name tooltip is: Errors:\nvariable - Parameters_VariableValidator: Incorrect variable name.
16     waitFor("object.exists(':Parameter_QLineEdit')", 20000)
17     test.compare(str(findObject(":Parameter_QLineEdit").toolTip), "Errors:\nvariable - Parameters_VariableValidator: Incorrect variable name.")
18     #[step] Check that expression tooltip is: Errors:\nexpression - Parameters_ExpressionValidator: Expression is empty.
19     waitFor("object.exists(':Parameter_ExpressionEditor')", 20000)
20     test.compare(str(findObject(":Parameter_ExpressionEditor").toolTip), "Errors:\nexpression - Parameters_ExpressionValidator: Expression is empty.")
21
22     #[step] Enter variable name 'a'    
23     type(waitForObject(":Parameter_QLineEdit"), "a")
24     mouseClick(waitForObject(":Parameter_ExpressionEditor"), 97, 31, 0, Qt.LeftButton)
25     
26     #[step] Enter variable expression '100+b'
27     type(waitForObject(":Parameter_ExpressionEditor"), "100+b")
28     
29     #[step] Check that expression tooltip is: Errors:\nexpression - Parameters_ExpressionValidator: name 'b' is not defined
30     waitFor("object.exists(':Parameter_ExpressionEditor')", 20000)
31     test.compare(str(findObject(":Parameter_ExpressionEditor").toolTip), "Errors:\nexpression - Parameters_ExpressionValidator: name 'b' is not defined")
32     #[step] Check that result message is: Error: unexpected EOF while parsing (<string>, line 0)
33     waitFor("object.exists(':Parameter.Result_QLabel')", 20000)
34     test.compare(str(findObject(":Parameter.Result_QLabel").text), "Error: name 'b' is not defined")
35
36     #[step] Check that feature ToolTip is: expression - Parameters_ExpressionValidator: name 'b' is not defined
37     waitFor("object.exists(':Parameter_QFrame')", 20000)
38     test.compare(str(findObject(":Parameter_QFrame").toolTip), "expression - Parameters_ExpressionValidator: name 'b' is not defined")
39
40     #[step] Check that apply button is disabled
41     waitFor("object.exists(':Parameter.property_panel_ok_QToolButton')", 20000)
42     test.compare(findObject(":Parameter.property_panel_ok_QToolButton").enabled, False)
43
44     close_application()