Salome HOME
Fix SQUISH tests
[modules/shaper.git] / test.squish / suite_ISSUES_SALOME / tst_sketch_007 / test.py
1
2 def main():
3     #[project] NewGEOM
4     #[Scenario] Sketch_007
5     #[Topic] Perpendicular lines
6     #[Tested functionality] 'Perpendicular' constraint
7     #[Summary description]
8     #[Expected results]
9     #[General comments]
10     
11     source(findFile("scripts", "common.py"))
12     
13     #[section] Application start
14     #[step] Launch SALOME
15     startApplication("salome_run.sh")
16
17     set_defaults()
18     
19     #[step] Open 'for_sketch_006.hdf'
20     open(DATA_PATH + "/for_sketch_007.hdf")
21     
22     #[step] Activate NewGeom
23     clickButton(waitForObject(":SALOME*.NewGeom_QToolButton"))
24     
25     #[step] Activate Part_1
26     waitForObjectItem(":Object browser_XGUI_DataTree", "Not loaded Part\\_1")
27     clickItem(":Object browser_XGUI_DataTree", "Not loaded Part\\_1", 51, 7, 0, Qt.LeftButton)
28     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Not loaded Part\\_1", 51, 7, 0)
29     activateItem(waitForObjectItem(":_QMenu", "Activate"))
30     
31     #[step] Edit Sketch_1
32     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1")
33     clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1", 54, 11, 0, Qt.LeftButton)
34     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Sketch\\_1", 54, 11, 0)
35     activateItem(waitForObjectItem(":_QMenu", "Edit..."))
36     
37     #[step] Click '+OZ' view button
38     clickButton(waitForObject(":SALOME*.+OZ_QToolButton"))
39     #[step] Make lines perpendicular    
40     perpendicular((331, 155), (386, 169))
41     
42     #[step] Fit all
43     clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
44     
45     #[check] that lines are perpendicular
46     test.vp("VP1")
47     
48     #[step] Select the 'perpendicular' icon near the line
49     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 372, 263, 0, Qt.LeftButton)
50     
51     #[check] Check that Input panel 'Perpendicular' appears, there are the names of lines in text boxes
52     waitFor("object.exists(':Perpendicular.First line_QLineEdit')", 20000)
53     test.compare(str(findObject(":Perpendicular.First line_QLineEdit").text), "SketchLine_1")
54     waitFor("object.exists(':Perpendicular.Second line_QLineEdit')", 20000)
55     test.compare(str(findObject(":Perpendicular.Second line_QLineEdit").text), "SketchLine_2")
56     
57     # [check] Check that lines are selected and highlighted in viewer
58     test.vp("VP3")
59     
60     #[step] Confirm 'Perpendicular' operation
61     clickButton(waitForObject(":Perpendicular.property_panel_ok_QToolButton"))
62     
63     #[step] Confirm edition of the sketch
64     clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton"))
65     
66     #[step] Close application
67     close_application()
68