def checkForOpenDialogs(self): User.idle() topwins = wx.GetTopLevelWindows() if len(topwins) > 1: for win in topwins: title = win.GetTitle() if title != u'Chandler': self.report(False, '%s window is still open at end of test' % title) if title == 'Recurring event change': proxy = getattr(win, 'proxy', None) if proxy is not None: self.report(False, 'Proxy contents: item title=%s, buffer=%s' % (proxy.proxiedItem.displayName, proxy.changeBuffer[0]['args']))
def checkForOpenDialogs(self): User.idle() topwins = wx.GetTopLevelWindows() if len(topwins) > 1: for win in topwins: title = win.GetTitle() if title != u'Chandler': self.report( False, '%s window is still open at end of test' % title) if title == 'Recurring event change': proxy = getattr(win, 'proxy', None) if proxy is not None: self.report( False, 'Proxy contents: item title=%s, buffer=%s' % (proxy.proxiedItem.displayName, proxy.changeBuffer[0]['args']))
block = Block.findBlockByName("ApplicationBarQuickEntry") quickEntryWidget = block.widget quickEntryWidget.SetFocus() User.emulate_typing("Dinner at 7 pm tomorrow night") # XXX I'd really just like to be able to call User.emulate_return() in the # XXX timed part below, but for some reason it does not work. keyEvent = wx.KeyEvent() keyEvent.m_keyCode = wx.WXK_RETURN keyEvent.arguments = {'sender': block} mainView = schema.ns("osaf.views.main", wx.GetApp().UIRepositoryView).MainView # Time how long it takes to create the event starting from pressing ENTER logger.Start("Quick entry") mainView.onQuickEntryEvent(keyEvent) # XXX See above User.idle() logger.Stop() # Test Phase: Verification # XXX TODO logger.SetChecked(True) logger.Report("Quick entry") finally: # cleanup logger.Close()