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