]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add SQUISH test suite_OBJECT_BROWSER/tst_ACTIVE_DOC_MANAGEMENT
authorspo <sergey.pokhodenko@opencascade.com>
Fri, 16 Oct 2015 07:58:54 +0000 (10:58 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 16 Oct 2015 07:58:54 +0000 (10:58 +0300)
test.squish/suite_OBJECT_BROWSER/envvars [new file with mode: 0644]
test.squish/suite_OBJECT_BROWSER/shared/scripts/common.py [new symlink]
test.squish/suite_OBJECT_BROWSER/suite.conf [new file with mode: 0644]
test.squish/suite_OBJECT_BROWSER/tst_ACTIVE_DOC_MANAGEMENT/test.py [new file with mode: 0644]
test_squish.sh

diff --git a/test.squish/suite_OBJECT_BROWSER/envvars b/test.squish/suite_OBJECT_BROWSER/envvars
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/test.squish/suite_OBJECT_BROWSER/shared/scripts/common.py b/test.squish/suite_OBJECT_BROWSER/shared/scripts/common.py
new file mode 120000 (symlink)
index 0000000..c9dd6a8
--- /dev/null
@@ -0,0 +1 @@
+../../../shared/scripts/common.py
\ No newline at end of file
diff --git a/test.squish/suite_OBJECT_BROWSER/suite.conf b/test.squish/suite_OBJECT_BROWSER/suite.conf
new file mode 100644 (file)
index 0000000..1dcb781
--- /dev/null
@@ -0,0 +1,10 @@
+AUT=salome_run.sh
+CWD=<AUT_path>
+ENVVARS=envvars
+HOOK_SUB_PROCESSES=true
+IMPLICITAUTSTART=0
+LANGUAGE=Python
+OBJECTMAP=../objects_salome.map
+TEST_CASES=tst_BASE tst_ACTIVE_DOC_MANAGEMENT
+VERSION=3
+WRAPPERS=Qt
diff --git a/test.squish/suite_OBJECT_BROWSER/tst_ACTIVE_DOC_MANAGEMENT/test.py b/test.squish/suite_OBJECT_BROWSER/tst_ACTIVE_DOC_MANAGEMENT/test.py
new file mode 100644 (file)
index 0000000..68fabf9
--- /dev/null
@@ -0,0 +1,126 @@
+#[tested functionality] 
+
+ENABLE_COLOR='#FF000000'
+DISABLE_COLOR='#FFC0C0C0'
+
+def checkPartActivatedState(scenario):
+    #[step] Check that Part is activated
+    allPartSetElements = [
+                "Parameters (0)", 
+                "Constructions (4)", 
+                "Constructions (4).Origin", 
+                "Constructions (4).YOZ",
+                "Constructions (4).XOZ",
+                "Constructions (4).XOY",
+                "Parts (1)"]
+    for element in allPartSetElements:
+        test.compare(DISABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", element).foregroundColor, "%s is disabled after: %s" % (element, scenario))
+
+    partElements = [
+                "Part\\_1", 
+                "Part\\_1.Parameters (0)",
+                "Part\\_1.Constructions (0)",
+                "Part\\_1.Bodies (0)"]
+    for element in partElements:
+        test.compare(ENABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", element).foregroundColor, "%s is enabled after: %s" % (element, scenario))
+    
+    #[step] Check that Part tree is unfolded
+    test.compare(False, waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1").collapsed, "Part is unfolded after: %s" % scenario)
+
+#     #[step] Check that PartSet elements are folded
+#     partSetElements = [
+#                 "Parameters (0)", 
+#                 "Constructions (4)", 
+#                 "Parts (1)"]
+#     for element in partSetElements:
+#         test.compare(True, waitForObjectItem(":Object browser_XGUI_DataTree", element).collapsed, "%s is folded after: %s" % (element, scenario))
+
+def checkPartDeactivatedState(scenario):
+    #[step] Check that Part id disabled and folded 
+    partElements = [
+                "Part\\_1.Parameters (0)",
+                "Part\\_1.Constructions (0)",
+                "Part\\_1.Bodies (0)"]
+    for element in partElements:
+        test.compare(DISABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", element).foregroundColor, "%s is disabled after: %s" % (element, scenario))
+    test.compare(ENABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1").foregroundColor, "Part is enable after: %s" % scenario)
+    test.compare(True, waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1").collapsed, "Part is unfolded after: %s" % scenario)
+    
+    #[step] Check that PartSet is enabled  
+    allPartSetElements = [
+                "Parameters (0)", 
+                "Constructions (4)", 
+                "Constructions (4).Origin", 
+                "Constructions (4).YOZ",
+                "Constructions (4).XOZ",
+                "Constructions (4).XOY",
+                "Parts (1)"]
+    for element in allPartSetElements:
+        test.compare(ENABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", element).foregroundColor, "%s is enabled after: %s" % (element, scenario))
+
+def findMenuItem(menuObject, item):
+    for child in object.children(menuObject):
+        if child.text == item:
+            return child    
+    return None
+
+def main():
+    source(findFile("scripts", "common.py"))
+    
+    startApplication("salome_run.sh")
+    activate_newgeom()
+
+    #[step] Check that default elements are enabled: Parameters (0), Constructions (4), Parts (0)
+    waitForObjectItem(":Object browser_XGUI_DataTree", "Constructions (4)")
+    clickItem(":Object browser_XGUI_DataTree", "Constructions (4)", -10, 10, 0, Qt.LeftButton)
+     
+    allPartSetElements = [
+                "Parameters (0)", 
+                "Constructions (4)", 
+                "Constructions (4).Origin", 
+                "Constructions (4).YOZ",
+                "Constructions (4).XOZ",
+                "Constructions (4).XOY",
+                "Parts (0)"]
+    for element in allPartSetElements:
+        test.compare(ENABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", element).foregroundColor, "%s is enabled by default" % element)
+
+    #[step] Create Part
+    activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part"))
+    activateItem(waitForObjectItem(":Part_QMenu", "New part"))
+     
+    checkPartActivatedState("Part creation")
+    #[step] Deactivate part by double click 
+    waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1")
+    doubleClickItem(":Object browser_XGUI_DataTree", "Part\\_1", 10, 10, 0, Qt.LeftButton)
+
+    checkPartDeactivatedState("Part deactivation by double click")
+
+    #[step] Activate part by double click 
+    waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1")
+    doubleClickItem(":Object browser_XGUI_DataTree", "Part\\_1", 10, 10, 0, Qt.LeftButton)
+
+    checkPartActivatedState("Part activation by double click")
+
+    #[step] Check that Activate is disabled in Part context menu  
+    openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1", 10, 10, 0)
+    test.compare(False, findMenuItem(waitForObject(":_QMenu"), "Activate").enabled, "Activate is disabled on active Part")
+
+    #[step] Deactivate part by context menu on PartSet 
+    openContextMenu(waitForObject(":Object browser_QLineEdit"), 10, 10, 0)
+    activateItem(waitForObjectItem(":_QMenu", "Activate"))
+    
+    checkPartDeactivatedState("Part deactivation by context menu on PartSet")
+
+    #[step] Check that Activate is disabled in PartSet context menu  
+    openContextMenu(waitForObject(":Object browser_QLineEdit"), 10, 10, 0)
+    test.compare(False, findMenuItem(waitForObject(":_QMenu"), "Activate").enabled, "Activate is disabled on active PartSet")
+
+    #[step] Activate part by context menu on Part
+    openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1", 104, 6, 0)
+    activateItem(waitForObjectItem(":_QMenu", "Activate"))
+
+    checkPartActivatedState("Part activation by context menu on Part")
+
+    close_application()
index cf1fbad999ec33aa8220fb9feade5d0c9d435e50..8a660740fad84ea227198660b76ea55e68e5b91e 100755 (executable)
@@ -60,6 +60,10 @@ TESTCASES=""
 TESTCASES="${TESTCASES} --testcase tst_679"
 squishrunner-run suite_ERROR_NOTIFICATION "${TESTCASES}"
 
+TESTCASES=""
+TESTCASES="${TESTCASES} --testcase tst_ACTIVE_DOC_MANAGEMENT"
+squishrunner-run suite_OBJECT_BROWSER "${TESTCASES}"
+
 TESTCASES=""
 TESTCASES="${TESTCASES} --testcase tst_474"
 TESTCASES="${TESTCASES} --testcase tst_576"