Salome HOME
Sort SQUISH cases to suites
[modules/shaper.git] / test.squish / suite_FEATURE_SKETCH / tst_sketch_006 / test.py
1
2 def main():
3     #[project] NewGEOM
4     #[Scenario] Sketch_006
5     #[Topic] Parallel lines
6     #[Tested functionality] 'Parallel' 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_006.hdf")
21     
22     #[step] Activate NewGeom
23     clickButton(waitForObject(":SALOME*.NewGeom_QToolButton"))
24     
25     #[step] Activate Part_1
26     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
27     clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 51, 7, 0, Qt.LeftButton)
28     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 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 parallel
40     parallel((77, 174), (580, 284))
41
42     #[check] Check that lines are parallel
43     test.vp("VP1")
44     #[step] Select 'Parallel' icon near the line
45     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 103, 255, 0, Qt.LeftButton)
46     #[check] Check that Input panel 'Parallel' appears, there are the names of lines in text boxes
47     waitFor("object.exists(':Parallel.First line_QLineEdit')", 20000)
48     test.compare(str(findObject(":Parallel.First line_QLineEdit").text), "SketchLine_1")
49     waitFor("object.exists(':Parallel.Second line_QLineEdit')", 20000)
50     test.compare(str(findObject(":Parallel.Second line_QLineEdit").text), "SketchLine_2")
51     #[check] Check that lines are selected and highlighted in viewer
52     test.vp("VP3")
53     #[step] Confirm 'Parallel' operation
54     clickButton(waitForObject(":Parallel.property_panel_ok_QToolButton"))
55     #[step] Confirm edition of the sketch
56     clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton"))
57     #[step] Close application
58     close_application()