Salome HOME
Sort SQUISH cases to suites
[modules/shaper.git] / test.squish / suite_STANDALONE / tst_818 / test.py
1 import re
2
3 def main():
4     source(findFile("scripts", "common.py"))
5     
6     startApplication("linux_run.sh")
7     set_defaults()
8     
9     #[step] Create parameter 'a = 100'
10     parameter_create("a", "100")
11     
12     #[step] Create sketch with line (0,0) - (a, 0)
13     sketch_create(help_points("XY_plane"), lambda: line_create((0, 0), ("a", 0)))
14
15     #[step] Activate context menu for parameter 'a' and click 'Delete'
16     waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1)")
17     clickItem(":Object browser_XGUI_DataTree", "Parameters (1)", -10, 10, 0, Qt.LeftButton)
18     waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).a = 100")
19     clickItem(":Object browser_XGUI_DataTree", "Parameters (1).a = 100", 10, 10, 0, Qt.LeftButton)
20     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).a = 100", 10, 10, 0)
21     
22     activateItem(waitForObjectItem(":_QMenu", "Delete"))
23     
24     #[check] Message box with "Selected features are used in the following features: SketchLine_1. These features will be deleted.\nAlso these features will be deleted: Sketch_1.\nWould you like to continue?" should appear
25     waitFor("object.exists(':Delete features.Label_QLabel')", 20000)
26
27     an_expected = """Selected parameters are used in the following features: SketchLine_1.
28 These features will be deleted.
29 (Also these features will be deleted: Sketch_1)
30 Or parameters could be replaced by their values.
31 Would you like to continue?"""    
32     test.compare(str(findObject(":Delete features.Label_QLabel").text), an_expected)
33
34     #[step] Click 'Yes' and close application
35     clickButton(waitForObject(":Delete features.Yes_QPushButton"))