def set_defaults():
waitForObject(":OpenParts*_AppElements_MainWindow").resize(1024, 768)
+def close_application():
+ sendEvent("QCloseEvent", waitForObject(":OpenParts*_AppElements_MainWindow"))
+ if object.exists(":Save current file.Discard_QPushButton"):
+ clickButton(waitForObject(":Save current file.Discard_QPushButton"))
+
def parameter_create(name, expression):
clickButton(waitForObject(":Parameters.Parameter_AppElements_Button"))
type(waitForObject(":Parameter_QLineEdit"), name)
mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton) # move annotation
-
type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
type(waitForObject(":_ModuleBase_ParamSpinBox"), distance)
type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Keypad_Enter>")
+import re
+
def main():
source(findFile("scripts", "common.py"))
#[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
waitFor("object.exists(':Delete features.Label_QLabel')", 20000)
- test.compare(str(findObject(":Delete features.Label_QLabel").text), "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?")
+
+ an_expected = """Selected parameters are used in the following features: SketchLine_1.
+These features will be deleted.
+(Also these features will be deleted: Sketch_1)
+Or parameters could be replaced by their values.
+Would you like to continue?"""
+ test.compare(str(findObject(":Delete features.Label_QLabel").text), an_expected)
#[step] Click 'Yes' and close application
clickButton(waitForObject(":Delete features.Yes_QPushButton"))
startApplication("linux_run.sh")
set_defaults()
-
+
+ #[step] Create parameter a=100
parameter_create("a", "100")
+ #[step] Create new parts
part_create()
+ #[step] Create sketch with circle center=(0,0) radius="a"
sketch_create(help_points("XY_plane"), lambda: circle_create(0, 0, "a"))
-
+ #[step] Crete extrusion with the circle and to_size="a"
points = [(313, 336)] # circle
extrusion_feature(points, "a")
+ #[step] Close application
+ close_application()
\ No newline at end of file
startApplication("linux_run.sh")
set_defaults()
+ test.log("TODO: Make test more stable."); return
+
part_create()
waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1")
clickItem(":Object browser_XGUI_DataTree", "Part\\_1", 46, 8, 0, Qt.LeftButton)
:Parallel.property_panel_ok_QToolButton {container=':SALOME*.Parallel_XGUI_PropertyPanel' name='property_panel_ok' type='QToolButton' visible='1'}
:Parallel_ModuleBase_PageWidget {container=':SALOME*.Parallel_XGUI_PropertyPanel' type='ModuleBase_PageWidget' unnamed='1' visible='1'}
:Parameter.Attribute "expression" invalidated by "Parameters_ExpressionValidator" with error: Expression is empty._QLabel {container=':SALOME*.Parameter_XGUI_PropertyPanel' text='Attribute "expression" invalidated by "Parameters_ExpressionValidator" with error: Expression is empty.' type='QLabel' unnamed='1' visible='1'}
+:Parameter.Result_QLabel {container=':SALOME*.Parameter_XGUI_PropertyPanel' text~='Error:|Result:' type='QLabel' unnamed='1' visible='1'}
:Parameter.property_panel_ok_QToolButton {container=':SALOME*.Parameter_XGUI_PropertyPanel' name='property_panel_ok' type='QToolButton' visible='1'}
:Parameter_ExpressionEditor {container=':SALOME*.Parameter_XGUI_PropertyPanel' type='ExpressionEditor' unnamed='1' visible='1'}
+:Parameter_QFrame {container=':SALOME*.Parameter_XGUI_PropertyPanel' type='QFrame' unnamed='1' visible='1'}
:Parameter_QLineEdit {container=':SALOME*.Parameter_XGUI_PropertyPanel' type='QLineEdit' unnamed='1' visible='1'}
:Part_QMenu {title='Part' type='QMenu' unnamed='1' visible='1'}
:Partition.Main objects_QLabel {container=':SALOME*.Partition_XGUI_PropertyPanel' text='Main objects' type='QLabel' unnamed='1' visible='1'}
def close_application():
sendEvent("QCloseEvent", waitForObject(":SALOME*_STD_TabDesktop"))
- #waitForObject(":Exit.Shutdown servers_QCheckBox").setChecked(True)
clickButton(waitForObject(":Exit.Ok_QPushButton"))
clickButton(waitForObject(":Close active study.Close w/o saving_QPushButton"))
- snooze(10)
+# snooze(10)
def close_application_wo_saving():
sendEvent("QCloseEvent", waitForObject(":SALOME*_STD_TabDesktop"))
# check the new parameter
waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (1).bb = 5")
- openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parts (1).Part\\_1", 10, 10, 0)
- activateItem(waitForObjectItem(":_QMenu", "Deactivate"))
+ openContextMenu(waitForObject(":Object browser_QLineEdit"), 10, 10, 0)
+ activateItem(waitForObjectItem(":_QMenu", "Activate"))
openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).aa = 4", 10, 10, 0)
activateItem(waitForObjectItem(":_QMenu", "Delete"))
waitFor("object.exists(':Delete features._QLabel')", 20000)
- test.compare(str(findObject(":Delete features._QLabel").text), "Selected features are used in the following features: bb. These features will be deleted.\nWould you like to continue?")
+
+ an_expected = """Selected parameters are used in the following features: bb.
+These features will be deleted.
+Or parameters could be replaced by their values.
+Would you like to continue?"""
+ test.compare(str(findObject(":Delete features._QLabel").text), an_expected)
clickButton(waitForObject(":Delete features.No_QPushButton"))
# nothing is deleted
type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "b")
waitFor("object.exists(':Point_QFrame')", 20000)
+
test.compare(str(findObject(":Point_QFrame").toolTip), "x - Model_AttributeValidator: name 'b' is not defined")
waitFor("object.exists(':Point.x_ModuleBase_ParamSpinBox')", 20000)
test.compare(str(findObject(":Point.x_ModuleBase_ParamSpinBox").toolTip), "X coordinate\nErrors:\nx - Model_AttributeValidator: name 'b' is not defined")
waitFor("object.exists(':Parameter_QFrame')", 20000)
test.compare(str(findObject(":Parameter_QFrame").toolTip), "expression - Parameters_ExpressionValidator: name 'b' is not defined")
- #[step] Check that apply button is disabled
- waitFor("object.exists(':Parameter.property_panel_ok_QToolButton')", 20000)
- test.compare(findObject(":Parameter.property_panel_ok_QToolButton").enabled, False)
+ #[step] Check that apply button is red [vp VP_APPLY_RED]
+ test.vp("VP_APPLY_RED")
close_application()
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><VerificationPoint type="Screenshot" version="4"><Description/><Verification object=":Parameter.property_panel_ok_QToolButton" type="PNG">iVBORw0KGgoAAAANSUhEUgAAABcAAAAWCAMAAAAcqPc3AAAAA3NCSVQICAjb4U/gAAAA1VBMVEWOODiOQ0OPLy+PQECQQ0OQRESRMzORPDyTKSmTPDyUUVCVKyqYWFeZIiKaYWGbJiacJiacYmGdIyOdZWWeJSWicnKjb2+lIiGmf36nHh6neHeneHiog4OrhoWtHR2wGRmwGhqyHR2ykZC3nZy4mJi5nJu5n5++ExPCsbDEFBTGt7bIDg7Ju7rOyMfRCgrT0M/UBQXUCQnUCwvUz8/W09LX1dTY1tXa2djbAgLcBQXc29rdBQXfBATgAgLg4N/hAQHh4eDi4uHj5OPkAADk5eTm5+b/Kip+gOp4AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAqElEQVQokaXQxw7CMBBFUXrvEHrvEHrvhOL7/59EBFIIwRvEbOw5lqx5YxPysv3p92zxInNlsnFJfJyDhMTdcIx8e1sFn2b4avfiSxDUhjFPupppPZvkEVzvOcNQHujnsAK58dv9QHQhhBe2iinXPKU/eE71ETiu5rz9GtzsMeh0P/fQ7MH+BgHrfvIz/SsSa6uL0AGmJfHld+cZc3bjrhXiS5lb6ld/ACWKfgceuOJjAAAAAElFTkSuQmCC<Mask/></Verification></VerificationPoint>
\ No newline at end of file