def startTest(self): ap = QAUITestAppLib.UITestAccounts(self.logger) pSMTP = uw("Personal SMTP") pIMAP = uw("Personal IMAP") pPOP = uw("Personal POP") pEMAIL = "*****@*****.**" pNAME = uw("Demo One") # action ap.Open() # first, open the accounts dialog window ap.GetDefaultAccount("OUTGOING") ap.TypeValue("displayName", pSMTP) # type the following values into their apporpriate fields ap.TypeValue("host","smtp.osafoundation.org") ap.SelectValue("security", 'TLS') # select the TLS radio button ap.ToggleValue("authentication", True) # turn on the authentication checkbox ap.TypeValue("port", '587') ap.TypeValue("email", pEMAIL) ap.TypeValue("name", pNAME) ap.TypeValue('username', 'demo1') ap.TypeValue('password', 'ad3leib5') ap.GetDefaultAccount("INCOMING") ap.TypeValue("displayName", pIMAP) ap.TypeValue("email", pEMAIL) ap.TypeValue("name", pNAME) ap.TypeValue("host", "imap.osafoundation.org") ap.TypeValue("username", "demo1") ap.TypeValue("password", "ad3leib5") ap.SelectValue("security", "SSL") ap.SelectValue("protocol", "IMAP") ap.CreateAccount("INCOMING") ap.TypeValue("displayName", pPOP) ap.TypeValue("email", pEMAIL) ap.TypeValue("name", pNAME) ap.TypeValue("host", "pop.osafoundation.org") ap.TypeValue("username", "demo1") ap.TypeValue("password", "ad3leib5") ap.SelectValue("security", "SSL") ap.SelectValue("protocol", "POP") ap.Ok() # verification self.logger.startAction("Verifying Account Values") ap.VerifyValues("SMTP", pSMTP, host= "smtp.osafoundation.org", connectionSecurity = "TLS", useAuth = True, port = 587, username = '******', password = '******' ) ap.VerifyValues("IMAP", pIMAP, host = "imap.osafoundation.org", connectionSecurity = "SSL", username = "******", password = "******") ap.VerifyValues("POP", pPOP, host = "pop.osafoundation.org", connectionSecurity = "SSL", username = "******", password = "******") self.logger.endAction(True, "Verifying Account Values") # creation mail = QAUITestAppLib.UITestItem("MailMessage", self.logger) # action mail.SetAttr(displayName=uw("Invitation Mail"), toAddress="*****@*****.**", body=uw("This is an email to invite you")) mail.SendMail() # verification mail.Check_DetailView({"displayName":uw("Invitation Mail"),"toAddress":"*****@*****.**","body":uw("This is an email to invite you")})
def startTest(self): # action -- Setup mail accounts #execfile(os.path.join(functional_dir,"TestCreateAccounts.py")) ## Create Accounts for Mail ap = QAUITestAppLib.UITestAccounts(self.logger) # action self.logger.startAction("Setup email account") ap.Open() # first, open the accounts dialog window ap.GetDefaultAccount("OUTGOING") # get the default SMTP account ap.TypeValue( "displayName", uw("Personal SMTP") ) # type the following values into their apporpriate fields ap.TypeValue("host", "smtp.osafoundation.org") ap.SelectValue("security", 'TLS') # select the TLS radio button ap.ToggleValue("authentication", True) # turn on the authentication checkbox ap.TypeValue("port", '587') ap.TypeValue('username', 'demo1') ap.TypeValue('password', 'ad3leib5') ap.GetDefaultAccount("INCOMING") ap.TypeValue("displayName", uw("Personal IMAP")) ap.TypeValue("email", "*****@*****.**") ap.TypeValue("name", uw("Demo One")) ap.TypeValue("host", "imap.osafoundation.org") ap.TypeValue("username", "demo1") ap.TypeValue("password", "ad3leib5") ap.SelectValue("security", "SSL") ap.SelectValue("protocol", "IMAP") ap.Ok() self.logger.endAction(True) # verification ap.VerifyValues("SMTP", uw("Personal SMTP"), host="smtp.osafoundation.org", connectionSecurity="TLS", useAuth=True, port=587, username='******', password='******') ap.VerifyValues("IMAP", uw("Personal IMAP"), host="imap.osafoundation.org", connectionSecurity="SSL", username="******", password="******") ## End Create accounts for Mail # action -- Create new Collection col = QAUITestAppLib.UITestItem("Collection", self.logger) # action -- Set the Display name for new Collection col.SetDisplayName(uw("TestCollection")) # verification -- Initial Existense of Collection col.Check_CollectionExistence(uw("TestCollection")) # creation note = QAUITestAppLib.UITestItem("Note", self.logger) # action -- Add to TestCollection note.AddCollection(uw("TestCollection")) # action -- Stamp as Mail message note.StampAsMailMessage(True) # action -- Set Note attributes #XXX Moving the attribute setting after stamping # fixes an issue where the displayName was not getting set. # I am not sure of the reasoning of why this was # failing but believe it has to do # with either the CATS or CPIA layers note.SetAttr( displayName=uw("Test Note in TestCollection"), body=uw("This is the body, can i give it \n for new line.")) # action -- Set attributes for mail sending note.SetAttr(toAddress="*****@*****.**") # action -- Send the Mail message note.SendMail() # action -- Stamp as Calendar message note.StampAsCalendarEvent(True) # action -- Set Event attributes note.SetAttr(startDate="09/12/2006", startTime="6:00 PM", location=uw("Club101"), status="FYI", timeZone="America/Chicago", recurrence="Daily", recurrenceEnd="10/14/2006") # adding recurrence will have caused UITestItem to have the master # as its item. That doesn't work very well for selection, since the # last occurrence is the only row that will be displayed in the # Dashboard, so set note's item to the (single) modification #note.item = pim.EventStamp(note.item).modifications.first() # verification -- Collection Display col.Check_CollectionExistence(uw("TestCollection")) # verification -- note object in TestCollection note.Check_ItemInCollection(uw("TestCollection"))