- Revision
- 11430
- Author
- heikki
- Date
- 2006-08-16 17:03:42 -0700 (Wed, 16 Aug 2006)
Log Message
Backing out fix for bug 6161, seems there are still problems
visible when running the full suite.
visible when running the full suite.
Modified Paths
- trunk/chandler/tools/QATestScripts/Functional/FunctionalTestSuite.py
- trunk/chandler/tools/QATestScripts/Functional/TestFlickr.py
- trunk/chandler/tools/QATestScripts/Functional/TestSharing.py
- trunk/chandler/tools/QATestScripts/Performance/PerfLargeDataSharing.py
- trunk/chandler/tools/QAUITestAppLib.py
- trunk/chandler/tools/cats/Functional/TestFlickr.py
- trunk/chandler/tools/cats/framework/ChandlerTestLib.py
Added Paths
Diff
Modified: trunk/chandler/tools/QATestScripts/Functional/FunctionalTestSuite.py (11429 => 11430)
--- trunk/chandler/tools/QATestScripts/Functional/FunctionalTestSuite.py 2006-08-16 23:27:07 UTC (rev 11429) +++ trunk/chandler/tools/QATestScripts/Functional/FunctionalTestSuite.py 2006-08-17 00:03:42 UTC (rev 11430) @@ -66,6 +66,7 @@ "TestRemoveFromTrashOnImport.py", "TestEnableTimezones.py", "TestSwitchTimezone.py", + "TestSubscribe.py", "TestBlocks.py", "TestCleanRepo.py", ] @@ -92,6 +93,7 @@ "TestDates.py", #Chandler not handling daylightsavings bug#5038 "TestEditModeOnEnter.py", #Chandler bug 5744 "TestRemoveFromTrashOnImport.py", #not tested on all platforms yet + "TestSubscribe.py", # new test not yet working ) }
Modified: trunk/chandler/tools/QATestScripts/Functional/TestFlickr.py (11429 => 11430)
--- trunk/chandler/tools/QATestScripts/Functional/TestFlickr.py 2006-08-16 23:27:07 UTC (rev 11429) +++ trunk/chandler/tools/QATestScripts/Functional/TestFlickr.py 2006-08-17 00:03:42 UTC (rev 11430) @@ -53,11 +53,22 @@ # Add the channel to the sidebar app_ns().sidebarCollection.add(fc) + def sidebarCollectionNamed(name): + """ + Look for a sidebar collection with name, otherwise return False + """ + sidebarWidget = app_ns().sidebar.widget + for i in range(sidebarWidget.GetNumberRows()): + collection = sidebarWidget.GetTable().GetValue(i,0)[0] + if collection.displayName == name: + return collection + return False + # force sidebar to update User.idle() # check results - col = QAUITestAppLib.sidebarCollectionNamed(uw("oscon2005")) + col = sidebarCollectionNamed(uw("oscon2005")) if not col: logger.ReportFailure("Flickr Collection wasn't created") if col and len(col) != 10:
Modified: trunk/chandler/tools/QATestScripts/Functional/TestSharing.py (11429 => 11430)
--- trunk/chandler/tools/QATestScripts/Functional/TestSharing.py 2006-08-16 23:27:07 UTC (rev 11429) +++ trunk/chandler/tools/QATestScripts/Functional/TestSharing.py 2006-08-17 00:03:42 UTC (rev 11430) @@ -13,13 +13,89 @@ # limitations under the License. import tools.QAUITestAppLib as QAUITestAppLib +import os, sys +from application.dialogs.PublishCollection import ShowPublishDialog +import wx +from i18n import ChandlerMessageFactory as _ +from osaf.sharing import Sharing, unpublish +import osaf.sharing.ICalendar as ICalendar +import tools.QAUITestAppLib as QAUITestAppLib +import osaf.pim as pim +from i18n.tests import uw +from osaf.framework.blocks.Block import Block +App_ns = app_ns() + # initialization fileName = "TestSharing.log" logger = QAUITestAppLib.QALogger(fileName, "TestSharing") try: - QAUITestAppLib.publishSubscribe(logger) + # action + # Webdav Account Setting + ap = QAUITestAppLib.UITestAccounts(logger) + ap.Open() # first, open the accounts dialog window + ap.CreateAccount("WebDAV") + ap.TypeValue("displayName", uw("Sharing Test WebDAV")) + ap.TypeValue("host", "qacosmo.osafoundation.org") + ap.TypeValue("path", "cosmo/home/demo1") + ap.TypeValue("username", "demo1") + ap.TypeValue("password", "ad3leib5") + ap.TypeValue("port", "8080") + ap.ToggleValue("ssl", False) + ap.ToggleValue("default", True) + ap.Ok() + + # verification + ap.VerifyValues("WebDAV", uw("Sharing Test WebDAV"), host = "qacosmo.osafoundation.org", username = "demo1", password="ad3leib5", port=8080) + + # import events so test will have something to share even when run by itself + path = os.path.join(os.getenv('CHANDLERHOME'),"tools/QATestScripts/DataFiles") + # Upcast path to unicode since Sharing requires a unicode path + path = unicode(path, sys.getfilesystemencoding()) + share = Sharing.OneTimeFileSystemShare(path, u'testSharing.ics', ICalendar.ICalendarFormat, itsView=App_ns.itsView) + + collection = share.get() + App_ns.sidebarCollection.add(collection) + User.idle() + + # Collection selection + sidebar = App_ns.sidebar + QAUITestAppLib.scripting.User.emulate_sidebarClick(sidebar, "testSharing") + + # Sharing dialog + collection = Block.findBlockByName("MainView").getSidebarSelectedCollection() + if collection is not None: + if sidebar.filterKind is None: + filterClassName = None + else: + klass = sidebar.filterKind.classes['python'] + filterClassName = "%s.%s" % (klass.__module__, klass.__name__) + win = ShowPublishDialog(wx.GetApp().mainFrame, view=App_ns.itsView, + collection=collection, + filterClassName=filterClassName, + modal=False) + #Share button call + win.PublishCollection() + + while not win.done: + wx.GetApp().Yield() + + if not win.success: + logger.ReportFailure("(On publish collection)") + + #Done button call + win.OnPublishDone(None) + wx.GetApp().Yield() + logger.SetChecked(True) + + # cleanup + # cosmo can only handle so many shared calendars + # so remove this one when done + # Note: We don't need a try: here if this raises, the + # test has already reported success. + unpublish(collection) + finally: # cleaning logger.Report('Sharing')
Copied: trunk/chandler/tools/QATestScripts/Functional/TestSubscribe.py (from rev 11425, trunk/chandler/tools/QATestScripts/Functional/TestSubscribe.py) ( => )
Modified: trunk/chandler/tools/QATestScripts/Performance/PerfLargeDataSharing.py =================================================================== --- trunk/chandler/tools/QATestScripts/Performance/PerfLargeDataSharing.py 2006-08-16 23:27:07 UTC (rev 11429) +++ trunk/chandler/tools/QATestScripts/Performance/PerfLargeDataSharing.py 2006-08-17 00:03:42 UTC (rev 11430) @@ -13,13 +13,161 @@ # limitations under the License. import tools.QAUITestAppLib as QAUITestAppLib +import os +from application.dialogs.PublishCollection import ShowPublishDialog +import application.dialogs.SubscribeCollection as SubscribeCollection +import wx +from i18n import ChandlerMessageFactory as _ +from osaf.sharing import Sharing, unpublish +from osaf import sharing +import osaf.sharing.ICalendar as ICalendar +import tools.QAUITestAppLib as QAUITestAppLib +import osaf.pim as pim +from i18n.tests import uw +from osaf.framework.blocks.Block import Block +App_ns = app_ns() + + +def sidebarCollectionNamed(name): + """ + Look for a sidebar collection with name, otherwise return None + """ + sidebarWidget = app_ns().sidebar.widget + for i in range(sidebarWidget.GetNumberRows()): + collection = sidebarWidget.GetTable().GetValue(i,0)[0] + if collection.displayName == name: + return collection + return None + # initialization fileName = "PerfLargeDataSharing.log" logger = QAUITestAppLib.QALogger(fileName, "PerfLargeDataSharing") try: - QAUITestAppLib.publishSubscribe(logger) + # action + # Webdav Account Setting + ap = QAUITestAppLib.UITestAccounts(logger) + ap.Open() # first, open the accounts dialog window + ap.CreateAccount("WebDAV") + ap.TypeValue("displayName", uw("Publish Test WebDAV")) + ap.TypeValue("host", "qacosmo.osafoundation.org") + ap.TypeValue("path", "cosmo/home/demo1") + ap.TypeValue("username", "demo1") + ap.TypeValue("password", "ad3leib5") + ap.TypeValue("port", "8080") + ap.ToggleValue("ssl", False) + ap.ToggleValue("default", True) + ap.Ok() + + # verification + ap.VerifyValues("WebDAV", uw("Publish Test WebDAV"), host = "qacosmo.osafoundation.org", username = "demo1", password="ad3leib5", port=8080) + + # import events so test will have something to share even when run by itself + path = os.path.join(os.getenv('CHANDLERHOME'),"tools/QATestScripts/DataFiles") + # Upcast path to unicode since Sharing requires a unicode path + path = unicode(path, 'utf8') + share = Sharing.OneTimeFileSystemShare(path, u'testSharing.ics', ICalendar.ICalendarFormat, itsView=App_ns.itsView) + + collection = share.get() + App_ns.sidebarCollection.add(collection) + User.idle() + + # Collection selection + sidebar = App_ns.sidebar + QAUITestAppLib.scripting.User.emulate_sidebarClick(sidebar, "testSharing") + + # Sharing dialog + collection = Block.findBlockByName("MainView").getSidebarSelectedCollection() + if collection is not None: + if sidebar.filterKind is None: + filterClassName = None + else: + klass = sidebar.filterKind.classes['python'] + filterClassName = "%s.%s" % (klass.__module__, klass.__name__) + win = ShowPublishDialog(wx.GetApp().mainFrame, view=App_ns.itsView, + collection=collection, + filterClassName=filterClassName, + modal=False) + #Share button call + + app = wx.GetApp() + + # We are interested in seeing how quickly we can upload the collection + logger.Start('Publish') + win.PublishCollection() + while not win.done: + app.Yield() + logger.Stop() + + if not win.success: + logger.ReportFailure("(On publish collection)") + + # Get a read-write ticket to the published collection + # XXX This is ripped from PublishCollection + if win.publishType == 'freebusy': + share = sharing.getFreeBusyShare(win.collection) + else: + share = sharing.getShare(win.collection) + urls = sharing.getUrls(share) + if len(urls) == 1: + urlString = urls[0] + elif win.publishType == 'freebusy': + urlString = urls[1] + else: + urlString = urls[0] # read-write + + #Done button call + win.OnPublishDone(None) + app.Yield() + + # Unsubscribe and delete the (local) collection we just published so + # that we can subscribe to it below. + sharing.unsubscribe(collection) + collection.delete(recursive=True) + User.idle() + + # Subscribe to the remote collection + win = SubscribeCollection.Show(wx.GetApp().mainFrame, + view=App_ns.itsView, modal=False) + url = "" + url.SetFocus() + url.Clear() + + # Need to have this or first letter of URL is not + # typed into control on Linux + User.idle() + + QAUITestAppLib.scripting.User.emulate_typing(urlString) + + # We are interested in seeing how quickly we can download the collection + logger.Start('Subscribe') + win.OnSubscribe(None) + try: + while win.subscribing: + app.Yield() + except wx.PyDeadObjectError: + # XXX The C++ part of the dialog was gone, so we are no longer + # XXX supposed to touch any attributes of the dialog. In our + # XXX case this is safe, so just ignore. This seems to be needed + # XXX on Linux only. + pass + logger.Stop() + + User.idle() + + # verification + if QAUITestAppLib.scripting.User.emulate_sidebarClick(App_ns.sidebar, "testSharing"): + # cleanup + # cosmo can only handle so many shared calendars + # so remove this one when done + unpublish(sidebarCollectionNamed('testSharing')) + + logger.ReportPass("(On Subscribe collection)") + else: + logger.ReportFailure("(On Subscribe collection)") + + logger.SetChecked(True) finally: # cleaning logger.Report('Sharing')
Modified: trunk/chandler/tools/QAUITestAppLib.py (11429 => 11430)
--- trunk/chandler/tools/QAUITestAppLib.py 2006-08-16 23:27:07 UTC (rev 11429) +++ trunk/chandler/tools/QAUITestAppLib.py 2006-08-17 00:03:42 UTC (rev 11430) @@ -28,159 +28,11 @@ import osaf.sharing.ICalendar as ICalendar import os, sys from itertools import chain -from i18n.tests import uw -from osaf.sharing import Sharing, unpublish -from osaf.framework.blocks.Block import Block -from application.dialogs.PublishCollection import ShowPublishDialog -import application.dialogs.SubscribeCollection as SubscribeCollection -from osaf import sharing #Global AppProxy instance App_ns = scripting.app_ns() -def sidebarCollectionNamed(name): - """ - Look for a sidebar collection with name, otherwise return None - """ - sidebarWidget = App_ns.sidebar.widget - for i in range(sidebarWidget.GetNumberRows()): - collection = sidebarWidget.GetTable().GetValue(i,0)[0] - if collection.displayName == name: - return collection - return None - - -def publishSubscribe(logger): - """ - A function to publish and subscribe a collection. - """ - # action - # Webdav Account Setting - ap = UITestAccounts(logger) - ap.Open() # first, open the accounts dialog window - ap.CreateAccount("WebDAV") - ap.TypeValue("displayName", uw("Publish Test WebDAV")) - ap.TypeValue("host", "qacosmo.osafoundation.org") - ap.TypeValue("path", "cosmo/home/demo1") - ap.TypeValue("username", "demo1") - ap.TypeValue("password", "ad3leib5") - ap.TypeValue("port", "8080") - ap.ToggleValue("ssl", False) - ap.ToggleValue("default", True) - ap.Ok() - - # verification - ap.VerifyValues("WebDAV", uw("Publish Test WebDAV"), displayName = uw("Publish Test WebDAV"), host = "qacosmo.osafoundation.org", username = "demo1", password="ad3leib5", port=8080) - - # import events so test will have something to share even when run by itself - path = os.path.join(os.getenv('CHANDLERHOME'),"tools/QATestScripts/DataFiles") - # Upcast path to unicode since Sharing requires a unicode path - path = unicode(path, 'utf8') - share = Sharing.OneTimeFileSystemShare(path, u'testSharing.ics', ICalendar.ICalendarFormat, itsView=App_ns.itsView) - - collection = share.get() - App_ns.sidebarCollection.add(collection) - scripting.User.idle() - - # Collection selection - sidebar = App_ns.sidebar - scripting.User.emulate_sidebarClick(sidebar, "testSharing") - - # Sharing dialog - collection = Block.findBlockByName("MainView").getSidebarSelectedCollection() - if collection is not None: - if sidebar.filterKind is None: - filterClassName = None - else: - klass = sidebar.filterKind.classes['python'] - filterClassName = "%s.%s" % (klass.__module__, klass.__name__) - win = ShowPublishDialog(wx.GetApp().mainFrame, view=App_ns.itsView, - collection=collection, - filterClassName=filterClassName, - modal=False) - #Share button call - - app = wx.GetApp() - - # We are interested in seeing how quickly we can upload the collection - logger.Start('Publish') - win.PublishCollection() - while not win.done: - app.Yield() - logger.Stop() - - if not win.success: - logger.ReportFailure("(On publish collection)") - - # Get a read-write ticket to the published collection - # XXX This is ripped from PublishCollection - if win.publishType == 'freebusy': - share = sharing.getFreeBusyShare(win.collection) - else: - share = sharing.getShare(win.collection) - urls = sharing.getUrls(share) - if len(urls) == 1: - urlString = urls[0] - elif win.publishType == 'freebusy': - urlString = urls[1] - else: - urlString = urls[0] # read-write - - #Done button call - win.OnPublishDone(None) - app.Yield() - - # Unsubscribe and delete the (local) collection we just published so - # that we can subscribe to it below. - sharing.unsubscribe(collection) - collection.delete(recursive=True) - scripting.User.idle() - - # Subscribe to the remote collection - win = SubscribeCollection.Show(wx.GetApp().mainFrame, - view=App_ns.itsView, modal=False) - url = "" - url.SetFocus() - url.Clear() - - # Need to have this or first letter of URL is not - # typed into control on Linux - scripting.User.idle() - - scripting.User.emulate_typing(urlString) - - # We are interested in seeing how quickly we can download the collection - logger.Start('Subscribe') - win.OnSubscribe(None) - try: - while win.subscribing: - app.Yield() - except wx.PyDeadObjectError: - # XXX The C++ part of the dialog was gone, so we are no longer - # XXX supposed to touch any attributes of the dialog. In our - # XXX case this is safe, so just ignore. This seems to be needed - # XXX on Linux only. - pass - logger.Stop() - - scripting.User.idle() - - # verification - if scripting.User.emulate_sidebarClick(App_ns.sidebar, "testSharing"): - # cleanup - # cosmo can only handle so many shared calendars - # so remove this one when done - collection = sidebarCollectionNamed('testSharing') - unpublish(collection) - collection.delete(recursive=True) - - logger.ReportPass("(On Subscribe collection)") - else: - logger.ReportFailure("(On Subscribe collection)") - - logger.SetChecked(True) - - + def getTime(date): """ Return a string representation in 24h format of the time corresponding to the given date
Modified: trunk/chandler/tools/cats/Functional/TestFlickr.py (11429 => 11430)
--- trunk/chandler/tools/cats/Functional/TestFlickr.py 2006-08-16 23:27:07 UTC (rev 11429) +++ trunk/chandler/tools/cats/Functional/TestFlickr.py 2006-08-17 00:03:42 UTC (rev 11430) @@ -52,11 +52,22 @@ # Add the channel to the sidebar self.app_ns.sidebarCollection.add(fc) + def sidebarCollectionNamed(name): + """ + Look for a sidebar collection with name, otherwise return False + """ + sidebarWidget = self.app_ns.sidebar.widget + for i in range(sidebarWidget.GetNumberRows()): + collection = sidebarWidget.GetTable().GetValue(i,0)[0] + if collection.displayName == name: + return collection + return False + # force sidebar to update self.scripting.User.idle() # check results - col = QAUITestAppLib.sidebarCollectionNamed(uw("oscon2005")) + col = sidebarCollectionNamed(uw("oscon2005")) if not col: self.logger.endAction(False, "Flickr Collection wasn't created") if col and len(col) != 10:
Copied: trunk/chandler/tools/cats/Functional/TestSubscribe.py (from rev 11425, trunk/chandler/tools/cats/Functional/TestSubscribe.py) ( => )
Modified: trunk/chandler/tools/cats/framework/ChandlerTestLib.py =================================================================== --- trunk/chandler/tools/cats/framework/ChandlerTestLib.py 2006-08-16 23:27:07 UTC (rev 11429) +++ trunk/chandler/tools/cats/framework/ChandlerTestLib.py 2006-08-17 00:03:42 UTC (rev 11430) @@ -34,159 +34,11 @@ import osaf.sharing.ICalendar as ICalendar import os, sys from itertools import chain -from i18n.tests import uw -from osaf.sharing import Sharing, unpublish -from osaf.framework.blocks.Block import Block -from application.dialogs.PublishCollection import ShowPublishDialog -import application.dialogs.SubscribeCollection as SubscribeCollection -from osaf import sharing #Global AppProxy instance App_ns = scripting.app_ns() -def sidebarCollectionNamed(name): - """ - Look for a sidebar collection with name, otherwise return None - """ - sidebarWidget = App_ns.sidebar.widget - for i in range(sidebarWidget.GetNumberRows()): - collection = sidebarWidget.GetTable().GetValue(i,0)[0] - if collection.displayName == name: - return collection - return None - - -def publishSubscribe(logger): - """ - A function to publish and subscribe a collection. - """ - # action - # Webdav Account Setting - ap = UITestAccounts(logger) - ap.Open() # first, open the accounts dialog window - ap.CreateAccount("WebDAV") - ap.TypeValue("displayName", uw("Publish Test WebDAV")) - ap.TypeValue("host", "qacosmo.osafoundation.org") - ap.TypeValue("path", "cosmo/home/demo1") - ap.TypeValue("username", "demo1") - ap.TypeValue("password", "ad3leib5") - ap.TypeValue("port", "8080") - ap.ToggleValue("ssl", False) - ap.ToggleValue("default", True) - ap.Ok() - - # verification - ap.VerifyValues("WebDAV", uw("Publish Test WebDAV"), displayName = uw("Publish Test WebDAV"), host = "qacosmo.osafoundation.org", username = "demo1", password="ad3leib5", port=8080) - - # import events so test will have something to share even when run by itself - path = os.path.join(os.getenv('CHANDLERHOME'),"tools/QATestScripts/DataFiles") - # Upcast path to unicode since Sharing requires a unicode path - path = unicode(path, 'utf8') - share = Sharing.OneTimeFileSystemShare(path, u'testSharing.ics', ICalendar.ICalendarFormat, itsView=App_ns.itsView) - - collection = share.get() - App_ns.sidebarCollection.add(collection) - scripting.User.idle() - - # Collection selection - sidebar = App_ns.sidebar - scripting.User.emulate_sidebarClick(sidebar, "testSharing") - - # Sharing dialog - collection = Block.findBlockByName("MainView").getSidebarSelectedCollection() - if collection is not None: - if sidebar.filterKind is None: - filterClassName = None - else: - klass = sidebar.filterKind.classes['python'] - filterClassName = "%s.%s" % (klass.__module__, klass.__name__) - win = ShowPublishDialog(wx.GetApp().mainFrame, view=App_ns.itsView, - collection=collection, - filterClassName=filterClassName, - modal=False) - #Share button call - - app = wx.GetApp() - - # We are interested in seeing how quickly we can upload the collection - logger.Start('Publish') - win.PublishCollection() - while not win.done: - app.Yield() - logger.Stop() - - if not win.success: - logger.ReportFailure("(On publish collection)") - - # Get a read-write ticket to the published collection - # XXX This is ripped from PublishCollection - if win.publishType == 'freebusy': - share = sharing.getFreeBusyShare(win.collection) - else: - share = sharing.getShare(win.collection) - urls = sharing.getUrls(share) - if len(urls) == 1: - urlString = urls[0] - elif win.publishType == 'freebusy': - urlString = urls[1] - else: - urlString = urls[0] # read-write - - #Done button call - win.OnPublishDone(None) - app.Yield() - - # Unsubscribe and delete the (local) collection we just published so - # that we can subscribe to it below. - sharing.unsubscribe(collection) - collection.delete(recursive=True) - scripting.User.idle() - - # Subscribe to the remote collection - win = SubscribeCollection.Show(wx.GetApp().mainFrame, - view=App_ns.itsView, modal=False) - url = "" - url.SetFocus() - url.Clear() - - # Need to have this or first letter of URL is not - # typed into control on Linux - scripting.User.idle() - - scripting.User.emulate_typing(urlString) - - # We are interested in seeing how quickly we can download the collection - logger.Start('Subscribe') - win.OnSubscribe(None) - try: - while win.subscribing: - app.Yield() - except wx.PyDeadObjectError: - # XXX The C++ part of the dialog was gone, so we are no longer - # XXX supposed to touch any attributes of the dialog. In our - # XXX case this is safe, so just ignore. This seems to be needed - # XXX on Linux only. - pass - logger.Stop() - - scripting.User.idle() - - # verification - if scripting.User.emulate_sidebarClick(App_ns.sidebar, "testSharing"): - # cleanup - # cosmo can only handle so many shared calendars - # so remove this one when done - collection = sidebarCollectionNamed('testSharing') - unpublish(collection) - collection.delete(recursive=True) - - logger.ReportPass("(On Subscribe collection)") - else: - logger.ReportFailure("(On Subscribe collection)") - - logger.SetChecked(True) - - + def getTime(date): """ Return a string representation in 24h format of the time corresponding to the given date
_______________________________________________ Commits mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/commits
