]> SALOME platform Git repositories - modules/shaper.git/blob - test.squish/suite_ISSUES/shared/scripts/common.py
Salome HOME
Improve SQUISH tests
[modules/shaper.git] / test.squish / suite_ISSUES / shared / scripts / common.py
1 testSettings.logScreenshotOnError = True
2 testSettings.logScreenshotOnFail = True
3
4 def parameter_create(name, expression):
5     clickButton(waitForObject(":Parameters.Parameter_AppElements_Button"))
6     type(waitForObject(":Parameter_QLineEdit"), name)
7     type(waitForObject(":Parameter_ExpressionEditor"), expression)
8     clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton"))
9
10 def part_create():
11     clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Part")
12     clickButton(waitForObject(":Operations.New part_AppElements_Button"))
13     
14 def sketch_create(point, actions):
15     clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Sketch")
16     clickButton(waitForObject(":Basic.Sketch_AppElements_Button"))
17     mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
18     
19     actions()
20     
21     clickButton(waitForObject(":Sketch.Ok_QToolButton"))
22
23 def point_create(point):
24     clickButton(waitForObject(":Basic.Point_AppElements_Button"))
25
26     type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
27     type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), point[0])
28     type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
29     type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), point[1])
30
31     clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))       
32
33 def line_create(start_point, end_point):
34     clickButton(waitForObject(":Basic.Line_AppElements_Button"))
35
36     type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
37     type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), start_point[0])
38     type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
39     type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), start_point[1])
40
41     type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
42     type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), end_point[0])
43     type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
44     type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), end_point[1])
45
46     clickButton(waitForObject(":Line.property_panel_ok_QToolButton"))    
47
48 def circle_create(x, y, radius):
49     clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
50     
51     type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
52     type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), x)
53     type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
54     type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), y)
55     
56     type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
57     type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius)
58     
59     clickButton(waitForObject(":Circle.property_panel_ok_QToolButton"))
60
61 def distance_create(point_1, point_2, annotaion_point, distance):
62     clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
63     
64     mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
65     mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
66     mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton) # move annotation
67
68     type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
69     type(waitForObject(":_ModuleBase_ParamSpinBox"), distance)
70     type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Return>")
71
72     clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))    
73
74 def extrusion_feature(points, to_size):
75     clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features")
76     clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button"))    
77
78     mouseClick(waitForObject(":Extrusion.Select a sketch face_QListWidget"), 10, 10, 0, Qt.LeftButton)
79     for point in points:
80         mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
81     
82     type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
83     type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), to_size)
84
85     clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton"))