Title: [commits] (dan) [11335] New test framework: add stearns new TestTriageSectioning.py
Revision
11335
Author
dan
Date
2006-08-04 17:26:28 -0700 (Fri, 04 Aug 2006)

Log Message

New test framework: add stearns new TestTriageSectioning.py

Modified Paths

Added Paths

Diff

Modified: trunk/chandler/tools/cats/Functional/FunctionalTestSuite.py (11334 => 11335)

--- trunk/chandler/tools/cats/Functional/FunctionalTestSuite.py	2006-08-05 00:13:49 UTC (rev 11334)
+++ trunk/chandler/tools/cats/Functional/FunctionalTestSuite.py	2006-08-05 00:26:28 UTC (rev 11335)
@@ -35,6 +35,7 @@
                 ("TestNewTask","TestNewTask"),
                 ("TestNewNote","TestNewNote"),
                 ("TestTableSelection","TestTableSelection"),
+                ("TestTriageSectioning","TestTriageSectioning"),
                 ("TestStamping","TestStamping"), 
                 ("TestSharing","TestSharing"), 
                 ("TestMoveToTrash","TestMoveToTrash"), 

Added: trunk/chandler/tools/cats/Functional/TestTriageSectioning.py (11334 => 11335)

--- trunk/chandler/tools/cats/Functional/TestTriageSectioning.py	2006-08-05 00:13:49 UTC (rev 11334)
+++ trunk/chandler/tools/cats/Functional/TestTriageSectioning.py	2006-08-05 00:26:28 UTC (rev 11335)
@@ -0,0 +1,90 @@
+#   Copyright (c) 2003-2006 Open Source Applications Foundation
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+from tools import QAUITestAppLib
+import osaf.pim as pim
+import osaf.framework.scripting as scripting
+from tools.cats.framework.ChandlerTestCase import ChandlerTestCase
+
+class TestTriageSectioning(ChandlerTestCase):
+    
+    def startTest(self):
+
+        # setup
+        
+        # create a collection and select it in the sidebar
+        view = QAUITestAppLib.UITestView(self.logger)
+        view.SwitchToAllView()
+    
+        col = QAUITestAppLib.UITestItem("Collection", self.logger)
+        col.SetDisplayName("TestTriageSectioning")
+        self.scripting.User.emulate_sidebarClick(self.app_ns.sidebar, "TestTriageSectioning")
+    
+        items = []
+        for status in pim.TriageEnum.values:
+            item = QAUITestAppLib.UITestItem("Note", self.logger)
+            if status != 'now': # it should default to 'now'!
+                item.item.triageStatus = status
+            items.append(item)
+            
+        # action
+        
+        # Get ready to bang on the dashboard
+        dashboardBlock = self.app_ns.TableSummaryView
+        dashboard = dashboardBlock.widget
+        rowHeight = dashboard.GetDefaultRowSize()
+        rowMiddle = rowHeight/2
+        header_widget = dashboard.GetGridColLabelWindow()
+    
+        # sort by triage status
+        self.scripting.User.emulate_click(header_widget, header_widget.GetSize()[0] - 15, 3)
+        self.scripting.User.idle()
+        
+        # Check the data structures: see that we're sectioned properly
+        # for a table with three items of different status:
+        goodExpandedSectioning = [(0, 1, 1), (2, 1, 1), (4, 1, 1)]
+        sectionRows = getattr(dashboard, 'sectionRows', None)
+        self.logger.startAction('Check Sectioning')
+        if not sectionRows:
+            self.logger.endAction(False, "Dashboard not sectioned")
+        else:
+            self.logger.endAction(True)
+        self.logger.startAction('Check section expansion')
+        if sectionRows != goodExpandedSectioning:
+            self.logger.endAction(False, "Dashboard not sectioned properly")
+        else:
+            self.logger.endAction(True)
+        
+        # Check that contraction and expansion work. For now, double-clicking 
+        # expands and contracts the section rows; eventually, it'll be clicking on
+        # the triangle.
+        for row in (4, 2, 0):
+            self.scripting.User.emulate_click(dashboard, 100, row*rowHeight + rowMiddle, double=True)
+        self.scripting.User.idle()
+        self.logger.startAction('Check contraction')
+        if dashboard.sectionRows != [(0, 0, 1), (1, 0, 1), (2, 0, 1)]:
+            self.logger.endAction(False, "Dashboard didn't contract properly")
+        else:
+            self.logger.endAction(True)
+        for row in (2, 1, 0):
+            self.scripting.User.emulate_click(dashboard, 100, row*rowHeight + rowMiddle, double=True)
+        self.scripting.User.idle()
+        self.logger.startAction('Check expansion')
+        if dashboard.sectionRows != goodExpandedSectioning:
+            self.logger.endAction(False, "Dashboard didn't expand properly")
+        else:
+            self.logger.endAction(True)
+       
+
+
Property changes on: trunk/chandler/tools/cats/Functional/TestTriageSectioning.py
___________________________________________________________________
Name: svn:eol-style
   + native




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to