summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatrickgu <patrickgu>2006-03-07 09:55:43 +0000
committerpatrickgu <patrickgu>2006-03-07 09:55:43 +0000
commit653151fd5242334c38d561548cd681b5b84dc4bf (patch)
tree3547762e0e8688f7c5a30fe4a9c7a2ae1069c1ba
parenta629d3f267394c1f614ed38477d94c4c905b63b2 (diff)
Comments remap, undoremap...
-rw-r--r--evolution/Assigned_Task_modify.py34
-rw-r--r--evolution/New_assigned_task.py19
-rw-r--r--evolution/compose-mail.py19
-rw-r--r--evolution/contact.py12
-rw-r--r--evolution/copymail.py20
-rw-r--r--evolution/create-appointment.py6
-rw-r--r--evolution/create-mail-folder.py6
-rw-r--r--evolution/create-search-folder-from-message.py14
-rw-r--r--evolution/del_task.py6
-rw-r--r--evolution/delete-mail-folder.py14
-rw-r--r--evolution/deletemail.py12
-rw-r--r--evolution/evoutils/calendar.py10
-rw-r--r--evolution/evoutils/composemail.py25
-rw-r--r--evolution/evoutils/mail.py29
-rw-r--r--evolution/evoutils/mailpreferences.py19
-rw-r--r--evolution/forward-mail.py26
-rw-r--r--evolution/movemail.py20
-rw-r--r--evolution/newmsg_fromsent.py14
-rw-r--r--evolution/rename-mail-folder.py8
-rw-r--r--evolution/search.py22
20 files changed, 181 insertions, 154 deletions
diff --git a/evolution/Assigned_Task_modify.py b/evolution/Assigned_Task_modify.py
index 3a4b820..4dcfdb7 100644
--- a/evolution/Assigned_Task_modify.py
+++ b/evolution/Assigned_Task_modify.py
@@ -29,9 +29,9 @@ from ldtputils import *
#from evoutils.Task import getrowindex
def getrowindex(subject):
try:
- noofchild=getrowcount ('frmEvolution-Tasks','tblTaskTable')
+ noofchild=getrowcount ('frmEvolution-Tasks','tblTasks')
for ind in range (noofchild):
- if getcellvalue('frmEvolution-Tasks','tblTaskTable',ind,2) == subject:
+ if getcellvalue('frmEvolution-Tasks','tblTasks',ind,2) == subject:
return ind
if ind == noofchild-1:
log ('Message not present','cause')
@@ -47,44 +47,44 @@ def modify_task(Due_date, Progress, Summary, old_Summary):
# read the row index from the user and delete that particular task.
try:
log('Modify an assigned task','teststart')
- remap('evolution','frmEvolution-Tasks')
- selectrow ('frmEvolution-Tasks', 'tblTaskTable', old_Summary[0])
+ #remap('evolution','frmEvolution-Tasks')
+ selectrow ('frmEvolution-Tasks', 'tblTasks', old_Summary[0])
selectmenuitem('frmEvolution-Tasks', 'mnuFile;mnuOpenTask')
- setcontext('Assigned Task - No summary','Assigned Task - ' + old_Summary[0])
- waittillguiexist('frmAssignedTask-Nosummary')
- remap('evolution','frmAssignedTask-Nosummary')
+ #setcontext('Assigned Task - No summary','Assigned Task - ' + old_Summary[0])
+ waittillguiexist('frmAssignedTask-*')
+ #remap('evolution','frmAssignedTask-Nosummary')
log('The window opened' ,'info')
except:
log('unable to read the data','error')
log('Modify an assigned task','testend')
- undoremap('evolution','frmEvolution-Tasks')
+ #undoremap('evolution','frmEvolution-Tasks')
raise LdtpExecutionError(0)
# Modifies the task according to users wish.
try:
- settextvalue ('frmAssignedTask-Nosummary', 'txtTextDateEntry',Due_date[0])
- settextvalue ('frmAssignedTask-Nosummary', 'txtSummary',Summary[0])
- setcontext('Assigned Task - No summary','Assigned Task - ' + Summary[0])
+ settextvalue ('frmAssignedTask-*', 'txtDate',Due_date[0])
+ settextvalue ('frmAssignedTask-*', 'txtSummary',Summary[0])
+ #setcontext('Assigned Task - No summary','Assigned Task - ' + Summary[0])
log('User data Loaded','info')
time.sleep(2)
- if stateenabled ('frmAssignedTask-Nosummary','btnSave')==1:
- click('frmAssignedTask-Nosummary','btnSave')
+ if stateenabled ('frmAssignedTask-*','btnSave')==1:
+ click('frmAssignedTask-*','btnSave')
log('The required task list has been modified','info')
else:
log('The Task is not modified because of no change in summary','info')
- click('frmAssignedTask-Nosummary','btnClose')
+ click('frmAssignedTask-*','btnClose')
time.sleep(2)
if guiexist('dlgEvolutionQuery'):
- click('dlgEvolutionQuery','btnDon\'tSend')
+ click('dlgEvolutionQuery','btnDonotSend')
log('Task has been modified successfully','info')
print 'The Assigned task has been modifed'
except:
log('Unable to load the user data','error')
log('Modify an assigned task','testend')
- undoremap('evolution','frmEvolution-Tasks')
+ #undoremap('evolution','frmEvolution-Tasks')
raise LdtpExecutionError(0)
#Change the Progress of the task.
@@ -100,7 +100,7 @@ def modify_task(Due_date, Progress, Summary, old_Summary):
except:
log('unable to change the progress of the task','error')
log('Modify an assigned task','testend')
- undoremap('evolution','frmEvolution-Tasks')
+ #undoremap('evolution','frmEvolution-Tasks')
raise LdtpExecutionError(0)
log('modify an assigned task','testend')
diff --git a/evolution/New_assigned_task.py b/evolution/New_assigned_task.py
index 22e5109..79b4cdf 100644
--- a/evolution/New_assigned_task.py
+++ b/evolution/New_assigned_task.py
@@ -35,7 +35,7 @@ def addattendees(attendee,email,addrbook):
waittillguiexist ('dlgRequiredParticipants')
time.sleep (1)
comboselect ('dlgRequiredParticipants','cboAddressBook',addrbook)
- remap ('evolution','dlgRequiredParticipants')
+ #remap ('evolution','dlgRequiredParticipants')
attendee=attendee[0].split (':')
email=email[0].split (':')
if len(attendee)!=len(email):
@@ -55,7 +55,7 @@ def addattendees(attendee,email,addrbook):
log ('User not found','cause')
raise LdtpExceptionError(0)
click ('dlgRequiredParticipants', 'btnClose')
- undoremap ('evolution','dlgRequiredParticipants')
+ #undoremap ('evolution','dlgRequiredParticipants')
except:
log ('Attendee Addition failed','error')
log ('Add Attendees','testend')
@@ -107,11 +107,12 @@ def new_task():
setcontext('Assigned Task - No summary','Assigned Task - ' + Summary[0])
time.sleep(3)
settextvalue ('frmAssignedTask-Nosummary', 'txtDescription', Desc[0])
- settextvalue ('frmAssignedTask-Nosummary', 'txtTextDateEntry1',Start_date[0])
- settextvalue ('frmAssignedTask-Nosummary', 'txtTextDateEntry',End_date[0])
- settextvalue ('frmAssignedTask-Nosummary', 'txt5',Start_time[0])
- settextvalue ('frmAssignedTask-Nosummary', 'txt3',End_time[0])
- settextvalue ('frmAssignedTask-Nosummary', 'txt7',Organizer[0]+ ' <'+Email[0]+'>')
+ settextvalue ('frmAssignedTask-Nosummary', 'txtDate1',Start_date[0])
+ settextvalue ('frmAssignedTask-Nosummary', 'txtDate',End_date[0])
+ settextvalue ('frmAssignedTask-Nosummary', 'txt8',Start_time[0])
+ settextvalue ('frmAssignedTask-Nosummary', 'txt6',End_time[0])
+ #settextvalue ('frmAssignedTask-Nosummary', 'txt7',Organizer[0]+ ' <'+Email[0]+'>')
+ # Organizer is not text. It's a noname combo. Need file bug
comboselect ('frmAssignedTask-Nosummary', 'cboPersonal', Group[0])
time.sleep(2)
addattendees(Attendees,Att_emails,addr_book[0])
@@ -128,9 +129,9 @@ def new_task():
click('frmAssignedTask-Nosummary','btnSave')
time.sleep(3)
if guiexist('dlgEvolutionQuery') == 1:
- remap('evolution','dlgEvolutionQuery')
+ #remap('evolution','dlgEvolutionQuery')
click('dlgEvolutionQuery','btnDon\'tSend')
- undoremap('evolution','dlgEvolutionQuery')
+ #undoremap('evolution','dlgEvolutionQuery')
log('Assigned Task Creation Completed','info')
print 'Task has been created'
except:
diff --git a/evolution/compose-mail.py b/evolution/compose-mail.py
index 43e22ee..d8109fb 100644
--- a/evolution/compose-mail.py
+++ b/evolution/compose-mail.py
@@ -35,9 +35,9 @@ def compose_mail (to, subject, body, cc, attachment, sentitemsfolder, refimg):
else:
sent_folder = 'Sent Items'
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', sent_folder)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', sent_folder)
time.sleep (2)
- sent_mail_count = getrowcount ('frmEvolution-Mail', 'ttblMessageList')
+ sent_mail_count = getrowcount ('frmEvolution-*', 'ttblMessages')
compose (to, subject, body, cc, attachment)
if verifymailwithimage (sent_folder, sent_mail_count, refimg) == 1:
log ('Compose new message', 'pass')
@@ -49,7 +49,20 @@ def compose_mail (to, subject, body, cc, attachment, sentitemsfolder, refimg):
raise LdtpExecutionError (0)
# Reading Input from File
-to, subject, body, cc, attachment, sentitemsfolder, refimg = read_maildata (datafilename)
+#to, subject, body, cc, attachment, sentitemsfolder, refimg = read_maildata (datafilename)
+try:
+ data_object = LdtpDataFileParser (datafilename)
+ to = data_object.gettagvalue ('to')
+ cc = data_object.gettagvalue ('cc')
+ subject = data_object.gettagvalue ('subject')
+ body = data_object.gettagvalue ('body')
+ sentitemsfolder = data_object.gettagvalue ('sentitemsfolder')
+ refimg = data_object.gettagvalue ('refimg')
+ attachment = data_object.gettagvalue ('attachment')
+ log('User data read successfull','info')
+except:
+ log('Unable to read the user data or data file missing','error')
+ raise LdtpExecutionError(0)
# Call the functions
compose_mail (to, subject, body, cc, attachment, sentitemsfolder, refimg)
diff --git a/evolution/contact.py b/evolution/contact.py
index 7ce880a..5b1604b 100644
--- a/evolution/contact.py
+++ b/evolution/contact.py
@@ -170,9 +170,9 @@ def selectaddrbook (name):
log ('Selecting a given Address book','teststart')
try:
selectContactPane()
- remap ('evoltion','frmEvolution-Contacts')
+ #remap ('evoltion','frmEvolution-Contacts')
selectrow ('frmEvolution-Contacts','ttblContactSourceSelector',name)
- undoremap ('evolution','frmEvolution-Contacts')
+ #undoremap ('evolution','frmEvolution-Contacts')
except:
log ('Unable to Select AddressBook','error')
log ('Selecting a given Address book','testend')
@@ -235,7 +235,10 @@ def selectcontact(name):
if guiexist ('frmEvolution-Contacts')!=1:
selectContactPane()
try:
- remap ('evolution','frmEvolution-Contacts')
+ #remap ('evolution','frmEvolution-Contacts')
+ print "HERE"
+ print getobjectlist ('frmEvolution-Contacts')
+ print "AFTER"
for obj in getobjectlist ('frmEvolution-Contacts'):
if obj.startswith ('pnlcurrentaddressbook'):
panel_name=obj
@@ -374,7 +377,8 @@ def addcontact(AddrBook,FullName,Nick,WorkEmail,HomeMail,BusPhone,Yahoo,HomePage
#=getcontactvals(datafilename)
selectContactPane()
selectaddrbook (AddrBook[0])
- selectmenuitem ('frmEvolution-Contacts','mnuNew;mnuFile;mnuContact')
+ selectmenuitem ('frmEvolution-Contacts','mnuFile;mnuNew;mnuContact')
+ time.sleep(2)
waittillguiexist ('dlgContactEditor')
except:
log ('Could Not select Contacts Button','error')
diff --git a/evolution/copymail.py b/evolution/copymail.py
index 1c5e5f6..ec9112b 100644
--- a/evolution/copymail.py
+++ b/evolution/copymail.py
@@ -34,19 +34,19 @@ from evoutils.mail import *
# Section to select and copy mail
def copy_mail (from_fldr, to_fldr, mail_index):
try:
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', to_fldr)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', to_fldr)
time.sleep (2)
- row_before = getrowcount('frmEvolution-Mail', 'ttblMessageList')
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', from_fldr)
+ row_before = getrowcount('frmEvolution-*', 'ttblMessages')
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', from_fldr)
time.sleep (2)
- rowcount = getrowcount('frmEvolution-Mail', 'ttblMessageList')
+ rowcount = getrowcount('frmEvolution-*', 'ttblMessages')
if rowcount > 0:
if mail_index == -1:
mail_index = rowcount-1
- selectrowindex ('frmEvolution-Mail', 'ttblMessageList', mail_index)
+ selectrowindex ('frmEvolution-*', 'ttblMessages', mail_index)
time.sleep (1)
- selectmenuitem ('frmEvolution-Mail', 'mnuMessage;mnuCopytoFolder')
+ selectmenuitem ('frmEvolution-*', 'mnuMessage;mnuCopytoFolder')
if waittillguiexist ('dlgSelectfolder') == 0:
log ('Select folder dialog not opened', 'error')
raise LdtpExecutionError (0)
@@ -60,12 +60,12 @@ def copy_mail (from_fldr, to_fldr, mail_index):
raise LdtpExecutionError (0)
else:
# TODO: Copying a duplicate message has to be handled
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', to_fldr)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', to_fldr)
time.sleep (2)
- row_after = getrowcount('frmEvolution-Mail', 'ttblMessageList')
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', from_fldr)
+ row_after = getrowcount('frmEvolution-*', 'ttblMessages')
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', from_fldr)
time.sleep (2)
- rowcount_after_copy = getrowcount('frmEvolution-Mail', 'ttblMessageList')
+ rowcount_after_copy = getrowcount('frmEvolution-*', 'ttblMessages')
if row_after == (row_before+1) and rowcount == rowcount_after_copy:
log ('Copying a mail passed successfully','pass')
else:
diff --git a/evolution/create-appointment.py b/evolution/create-appointment.py
index bbbde86..5200653 100644
--- a/evolution/create-appointment.py
+++ b/evolution/create-appointment.py
@@ -49,11 +49,11 @@ categories = data_object.gettagvalue ('categories')[0]
log ('Appointment Creation', 'teststart')
try:
- windowname = 'frmAppointment-Nosummary'
+ windowname = 'frmAppointment-*'
ptlistname = 'ptl0'
flag = 0
#selectmenuitem ('frmEvolution-Calendars', 'mnuView;mnuWindow;mnuCalendars')
- selectmenuitem ('frmEvolution-Calendars', 'mnuFile;mnuFile;mnuAppointment')
+ selectmenuitem ('frmEvolution-*', 'mnuFile;mnuFile;mnuAppointment')
time.sleep(2)
#click ('frmEvolution-Calendars', 'btnNew')
waittillguiexist (windowname)
@@ -91,7 +91,7 @@ try:
log ('Appointment creation succeeded', 'fail')
else:
log ('Appointment creation succeeded', 'pass')
-except LdtpExecutionError:
+except LdtpExecutionError,msg:
#releasecontext ()
print 'Creation of appointment failed' + str(msg)
log ('Creation of appointment failed', 'error')
diff --git a/evolution/create-mail-folder.py b/evolution/create-mail-folder.py
index d4eb4d0..423766d 100644
--- a/evolution/create-mail-folder.py
+++ b/evolution/create-mail-folder.py
@@ -38,15 +38,15 @@ def create_mail_folder (parent, folder_name):
log ('Can not create vFolder using this script', 'fail')
return
else:
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', parent)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', parent)
- selectmenuitem ('frmEvolution-Mail', 'mnuFolder;mnuNew1')
+ selectmenuitem ('frmEvolution-*', 'mnuFile;mnuNew;mnuMailFolder')
if waittillguiexist ('dlgCreatefolder') == 0:
log ('Create folder dialog not opened', 'error')
raise LdtpExecutionError (0)
selectrowpartialmatch ('dlgCreatefolder', 'ttblMailFolderTree', parent)
- settextvalue ('dlgCreatefolder', 'txtFoldername', folder_name)
+ settextvalue ('dlgCreatefolder', 'txtFoldername:', folder_name)
click ('dlgCreatefolder', 'btnCreate')
if waittillguinotexist ('dlgCreatefolder') == 0:
log ('Create folder dialog not closed', 'error')
diff --git a/evolution/create-search-folder-from-message.py b/evolution/create-search-folder-from-message.py
index 40b6186..1a3c220 100644
--- a/evolution/create-search-folder-from-message.py
+++ b/evolution/create-search-folder-from-message.py
@@ -33,16 +33,16 @@ from ldtputils import *
def create_search_folder (source_folder, message_index, search_condition, search_folder):
try:
search_mail_count = 0
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', source_folder)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', source_folder)
time.sleep (2)
- total_messages = getrowcount ('frmEvolution-Mail', 'ttblMessageList')
- selectrowindex ('frmEvolution-Mail', 'ttblMessageList', message_index)
+ total_messages = getrowcount ('frmEvolution-*', 'ttblMessages')
+ selectrowindex ('frmEvolution-*', 'ttblMessages', message_index)
time.sleep (1)
if (search_condition == 'Subject'):
- search_text = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', message_index, 4)
+ search_text = getcellvalue ('frmEvolution-*', 'ttblMessages', message_index, 4)
elif (search_condition == 'Sender'):
- search_text = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', message_index, 3)
+ search_text = getcellvalue ('frmEvolution-*', 'ttblMessages', message_index, 3)
else:
log (search_condition + ' condition is not handled by this script', 'cause')
log ('Create Search folder failed', 'fail')
@@ -66,7 +66,7 @@ def create_search_folder (source_folder, message_index, search_condition, search
regexp[1] = re.compile (re.escape (sub_strings[1]), re.I)
for i in range (total_messages):
- subject = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', i, 4)
+ subject = getcellvalue ('frmEvolution-*', 'ttblMessages', i, 4)
if regexp[1].search (subject):
search_mail_count = search_mail_count + 1
continue
@@ -83,7 +83,7 @@ def create_search_folder (source_folder, message_index, search_condition, search
regexp = re.compile (re.escape (search_string))
for i in range (total_messages):
- sender = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', i, 3)
+ sender = getcellvalue ('frmEvolution-*', 'ttblMessages', i, 3)
if regexp.search (sender):
search_mail_count = search_mail_count + 1
diff --git a/evolution/del_task.py b/evolution/del_task.py
index 6a8af42..2706c41 100644
--- a/evolution/del_task.py
+++ b/evolution/del_task.py
@@ -57,10 +57,12 @@ try:
#remap('evolution','frmEvolution-Tasks')
no_rows_b4deleting = getrowcount ('frmEvolution-Tasks', 'tblTasks')
- #if selectrowpartialmatch ('frmEvolution-Tasks', 'tblTasks', summary[0]) == 1:
+ print summary[0]
+ print summary
+ if selectrowpartialmatch ('frmEvolution-Tasks', 'tblTasks', summary[0]) == 1:
# selectrowpartialmatch doesn't work: 333090
- if selectrow ('frmEvolution-Tasks', 'tblTasks', summary[0]) == 1:
+ #if selectrow ('frmEvolution-Tasks', 'tblTasks', summary[0]) == 1:
log('The specified task has been deleted','info')
click('frmEvolution-Tasks', 'btnDelete')
waittillguiexist('dlgEvolutionQuery')
diff --git a/evolution/delete-mail-folder.py b/evolution/delete-mail-folder.py
index 4479ae2..fa8abb3 100644
--- a/evolution/delete-mail-folder.py
+++ b/evolution/delete-mail-folder.py
@@ -39,16 +39,16 @@ def delete_mail_folder (folder_to_delete):
else:
folder_name = folder_to_delete
- selectrow ('frmEvolution-Mail', 'ttblMailFolderTree', folder_name)
- selectmenuitem ('frmEvolution-Mail', 'mnuFolder;mnuDelete')
+ selectrow ('frmEvolution-*', 'ttblMailFolderTree', folder_name)
+ selectmenuitem ('frmEvolution-*', 'mnuFolder;mnuDelete')
dialog_title = 'Delete \"' + folder_to_delete + '\"?'
- setcontext ('folder label', dialog_title)
- if waittillguiexist ('dlgDeleteFolder') == 0:
+ #setcontext ('folder label', dialog_title)
+ if waittillguiexist ('dlgDelete*') == 0:
log ('Delete folder dialog not opened', 'error')
raise LdtpExecutionError (0)
- click ('dlgDeleteFolder', 'btnDelete')
- if waittillguinotexist ('dlgDeleteFolder') == 0:
+ click ('dlgDelete*', 'btnDelete')
+ if waittillguinotexist ('dlgDelete*') == 0:
log ('Delete folder dialog not closed', 'error')
raise LdtpExecutionError (0)
@@ -60,7 +60,7 @@ def delete_mail_folder (folder_to_delete):
# Pass/Fail condition has to be changed in case of system folders
log ('Delete mail folder', 'fail')
else:
- if (doesrowexist ('frmEvolution-Mail', 'ttblMailFolderTree', folder_name)):
+ if (doesrowexist ('frmEvolution-*', 'ttblMailFolderTree', folder_name)):
log ('Mail folder not deleted', 'cause')
log ('Delete mail folder failed', 'fail')
else:
diff --git a/evolution/deletemail.py b/evolution/deletemail.py
index 609513d..8d090be 100644
--- a/evolution/deletemail.py
+++ b/evolution/deletemail.py
@@ -33,19 +33,19 @@ from evoutils.mail import *
# Section to delete a mail
def delete_mail (source_fldr, mail_index):
try:
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', source_fldr)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', source_fldr)
time.sleep (2)
- rowcount = getrowcount('frmEvolution-Mail', 'ttblMessageList')
+ rowcount = getrowcount('frmEvolution-*', 'ttblMessages')
if rowcount > 0:
if mail_index == -1:
mail_index = rowcount-1
- selectrowindex ('frmEvolution-Mail', 'ttblMessageList', mail_index)
+ selectrowindex ('frmEvolution-*', 'ttblMessages', mail_index)
time.sleep (1)
- selectmenuitem ('frmEvolution-Mail', 'mnuEdit;mnuDeleteMessage')
+ selectmenuitem ('frmEvolution-*', 'mnuEdit;mnuDeleteMessage')
time.sleep (1)
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', source_fldr)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', source_fldr)
time.sleep (2)
- row_after = getrowcount('frmEvolution-Mail','ttblMessageList')
+ row_after = getrowcount('frmEvolution-*','ttblMessages')
if row_after == (rowcount-1):
log ('Deleting a mail passed successfully', 'pass')
else:
diff --git a/evolution/evoutils/calendar.py b/evolution/evoutils/calendar.py
index 86da7b2..7839089 100644
--- a/evolution/evoutils/calendar.py
+++ b/evolution/evoutils/calendar.py
@@ -75,7 +75,8 @@ def selectdate (new_date):
else:
month='December'
- comboselect ('dlgSelectDate', 'cboDecember', month)
+ click ('dlgSelectDate', 'cbo*')
+ comboselect ('dlgSelectDate', 'cbo*', month)
time.sleep (3)
day = int (date_components[0])
if day < 1 or day > 31:
@@ -99,9 +100,10 @@ def insert_appointment (windowname, summary, location, description, from_date, f
flag = 0
time.sleep (2)
settextvalue (windowname, 'txtSummary', summary)
- setcontext ('Appointment - No summary', 'Appointment - ' + summary)
+ #setcontext ('Appointment - No summary', 'Appointment - ' + summary)
time.sleep (2)
if setandverify (windowname, 'txtLocation', location) == 0:
+ #if settextvalue (windowname, 'txtLocation', location) == 0:
log ('Failed to set value in location field', 'cause')
raise LdtpExecutionError (0)
else:
@@ -244,10 +246,10 @@ def selectcalevent(fromdate,summary):
log ('Selecting a Cal event','testend')
raise LdtpExecutionError (0)
try:
- remap ('evolution','frmEvolution-Calendars')
+ #remap ('evolution','frmEvolution-Calendars')
activatewin ('frmEvolution-Calendars')
selectevent ('frmEvolution-Calendars','calDayView',summary)
- undoremap ('evolution','frmEvolution-Calendars')
+ #undoremap ('evolution','frmEvolution-Calendars')
time.sleep (3)
except:
log ('Unable to select event','error')
diff --git a/evolution/evoutils/composemail.py b/evolution/evoutils/composemail.py
index 505cee5..d75d60e 100644
--- a/evolution/evoutils/composemail.py
+++ b/evolution/evoutils/composemail.py
@@ -30,9 +30,9 @@ from evoutils.mail import *
# Section to compose a new mail through File menu
def compose (to, subject=[], body=[], cc=[], bcc=[],attachment=[], format=[]):
try:
- selectmenuitem ('frmEvolution-Mail', 'mnuFile;mnuNew;mnuMailMessage')
+ selectmenuitem ('frmEvolution-*', 'mnuFile;mnuNew;mnuMailMessage')
time.sleep (2)
- if waittillguiexist ('frmComposeamessage') == 0:
+ if waittillguiexist ('frmComposeMessage') == 0:
log('Compose message window does not appear', 'error')
raise LdtpExecutionError (0)
else:
@@ -40,9 +40,9 @@ def compose (to, subject=[], body=[], cc=[], bcc=[],attachment=[], format=[]):
if len(format)>0:
try:
if format[0]=='HTML':
- check ('frmComposeamessage','mnuHTML')
+ check ('frmComposeMessage','mnuHTML')
elif format[0]=='Plain Text':
- uncheck ('frmComposeamessage','mnuHTML')
+ uncheck ('frmComposeMessage','mnuHTML')
else:
log ('Format not proper','warning')
except:
@@ -58,13 +58,13 @@ def compose (to, subject=[], body=[], cc=[], bcc=[],attachment=[], format=[]):
def sendmail(subject):
try:
- click ('frmComposeamessage', 'btnSend')
+ click ('frmComposeMessage', 'btnSend')
time.sleep (3)
if len(subject)==0 and guiexist ('dlgEvolutionQuery')==1:
remap ('evolution','dlgEvolutionQuery')
click ('dlgEvolutionQuery','btnSend')
undoremap ('evolution','dlgEvolutionQuery')
- if waittillguinotexist ('frmComposeamessage') == 0:
+ if waittillguinotexist ('frmComposeMessage') == 0:
log ('Failed during clicking the send button', 'error')
raise LdtpExecutionError (0)
if guiexist ('dlgEvolutionError'):
@@ -84,11 +84,11 @@ def savethismail (savemethod):
savemethod == 1 --> save in FS"""
try:
if savemethod==0:
- selectmenuitem ('frmComposeamessage','mnuFile;mnuSaveDraft')
+ selectmenuitem ('frmComposeMessage','mnuFile;mnuSaveDraft')
time.sleep (1)
- selectmenuitem ('frmComposeamessage','mnuFile;mnuClose')
+ selectmenuitem ('frmComposeMessage','mnuFile;mnuClose')
elif savemethod==1:
- selectmenuitem ('frmComposeamessage','mnuFile;mnuSaveAs')
+ selectmenuitem ('frmComposeMessage','mnuFile;mnuSaveAs')
waittillguiexist ('dlgSaveas')
settextvalue ('dlgSaveas','txtName','testfile')
click ('dlgSaveas','btnSave')
@@ -96,7 +96,7 @@ def savethismail (savemethod):
if guiexist ('dlgOverwritefile?')==1:
click ('dlgOverwritefile?','btnOverwrite')
log ('testfile already exists','warning')
- selectmenuitem ('frmComposeamessage','mnuFile;mnuClose')
+ selectmenuitem ('frmComposeMessage','mnuFile;mnuClose')
waittillguiexist ('dlgWarning')
click ('dlgWarning','btnDiscardChanges')
else:
@@ -115,7 +115,7 @@ def attach_files (attachment):
try:
n_attachments = len (attachment)
for i in range(n_attachments):
- selectmenuitem ('frmComposeamessage', 'mnuInsert;mnuAttachment')
+ selectmenuitem ('frmComposeMessage', 'mnuInsert;mnuAttachment')
if waittillguiexist ('dlgAttachfile(s)') == 0:
log ('Select file dialog does not appear','error')
raise LdtpExecutionError (0)
@@ -144,5 +144,6 @@ def read_maildata (datafile):
attachment = data_object.gettagvalue ('attachment')
sentitemsfolder = data_object.gettagvalue ('sentitemsfolder')
refimg = data_object.gettagvalue ('refimg')
- return [to, subject, body, cc, bcc, attachment, sentitemsfolder, refimg]
+ #return [to, subject, body, cc, bcc, attachment, sentitemsfolder, refimg]
+ return to, cc, bcc, subject, body, attachment, sentitemsfolder, refimg
diff --git a/evolution/evoutils/mail.py b/evolution/evoutils/mail.py
index 2ce6a28..e330dfb 100644
--- a/evolution/evoutils/mail.py
+++ b/evolution/evoutils/mail.py
@@ -41,6 +41,7 @@ def get_window (component=None):
window_id = 'frmEvolution-Contacts'
elif guiexist ('frmEvolution-Memos') == 1:
window_id = 'frmEvolution-Memos'
+ window_id = 'frmEvolution-*'
if component:
if window_id:
selectmenuitem (window_id, 'mnuView;mnuWindow;mnu' + component)
@@ -55,7 +56,9 @@ def get_window (component=None):
def setandverify (win_name, box_name, value):
try:
text = ''
- if type (value) == types.StringType:
+ print type (value)
+ if type (value) is types.StringType:
+ #if isinstance(value,types.StringType):
text = value
else:
length = len (value)
@@ -78,26 +81,26 @@ def setandverify (win_name, box_name, value):
#To populate mail header
def populate_mail_header (to=[], subject=[], body=[], cc = [], bcc = []):
try:
- if to and setandverify ('frmComposeamessage', 'txtTo', to) == 0:
+ if to and setandverify ('frmComposeMessage', 'txtTo', to) == 0:
log ('Failed to insert text into To field','error')
raise LdtpExecutionError (0)
-
+ print "HERE"
if cc:
- check ('frmComposeamessage','mnuCcField')
- if setandverify ('frmComposeamessage', 'txtCc', cc) == 0:
+ check ('frmComposeMessage','mnuCcField')
+ if setandverify ('frmComposeMessage', 'txtCc', cc) == 0:
log ('Failed to insert text into Cc field','error')
raise LdtpExecutionError (0)
if bcc:
- check ('frmComposeamessage','mnuBccField')
- if setandverify ('frmComposeamessage', 'txtBcc', bcc) == 0:
+ check ('frmComposeMessage','mnuBccField')
+ if setandverify ('frmComposeMessage', 'txtBcc', bcc) == 0:
log ('Failed to insert text into Bcc field','error')
raise LdtpExecutionError (0)
#cant use set and verify since context switching is involved
if subject:
- settextvalue ('frmComposeamessage', 'txtSubject', subject[0])
- setcontext ('Compose a message', subject[0])
- if verifysettext ('frmComposeamessage', 'txtSubject',
+ settextvalue ('frmComposeMessage', 'txtSubject', subject[0])
+ setcontext ('Compose Message', subject[0])
+ if verifysettext ('frmComposeMessage', 'txtSubject',
subject[0]) == 0:
log ('Failed to insert text into subject Field','error')
raise LdtpExecutionError (0)
@@ -105,15 +108,15 @@ def populate_mail_header (to=[], subject=[], body=[], cc = [], bcc = []):
#TODO: Change 'txt6' to some meaningful name in
#evolution.map also in the following code
- if body and setandverify ('frmComposeamessage', 'txt6', str(body[0])) == 0:
+ if body and setandverify ('frmComposeMessage', 'txt6', str(body[0])) == 0:
log ('Failed to insert text into Body field','error')
raise LdtpExecutionError (0)
#TODO: Check bcc field
return 1
except:
log ('Compose mail failed', 'error')
- if guiexist ('frmComposeamessage'):
- selectmenuitem ('frmComposeamessage', 'mnuFile;mnuClose')
+ if guiexist ('frmComposeMessage'):
+ selectmenuitem ('frmComposeMessage', 'mnuFile;mnuClose')
time.sleep (2)
raise LdtpExecutionError (0)
diff --git a/evolution/evoutils/mailpreferences.py b/evolution/evoutils/mailpreferences.py
index 0ae439c..0198aee 100644
--- a/evolution/evoutils/mailpreferences.py
+++ b/evolution/evoutils/mailpreferences.py
@@ -54,15 +54,16 @@ def change_style (type, style):
# To Change default Sent Items folder
def change_sentfolder (accountname, folder):
try:
- selectmenuitem ('frmEvolution-Mail', 'mnuEdit;mnuPreferences')
- if waittillguiexist ('dlgEvolutionSettings') == 0:
+ selectmenuitem ('frmEvolution-*', 'mnuEdit;mnuPreferences')
+ if waittillguiexist ('dlgEvolutionPreferences') == 0:
log ('Evolution Settings dialog not opened', 'error')
raise LdtpExecutionError (0)
time.sleep (3)
- selecttab ('dlgEvolutionSettings', 'ptl0', 'Mail Accounts')
+ selecttab ('dlgEvolutionPreferences', 'ptl0', 'Mail Accounts')
time.sleep (2)
- selectrow ('dlgEvolutionSettings', 'tblMailAccountsTable', accountname)
- click ('dlgEvolutionSettings', 'btnEdit')
+ selectrowpartialmatch ('dlgEvolutionPreferences', 'tblMailAccounts', accountname)
+ click ('dlgEvolutionPreferences', 'btnEdit')
+ time.sleep (2)
if waittillguiexist ('dlgAccountEditor') == 0:
log ('Account Editor dialog not opened', 'error')
raise LdtpExecutionError (0)
@@ -82,8 +83,8 @@ def change_sentfolder (accountname, folder):
if waittillguinotexist ('dlgAccountEditor') == 0:
log ('Account Editor dialog not closed', 'error')
raise LdtpExecutionError (0)
- click ('dlgEvolutionSettings', 'btnClose')
- if waittillguinotexist ('dlgEvolutionSettings') == 0:
+ click ('dlgEvolutionPreferences', 'btnClose')
+ if waittillguinotexist ('dlgEvolutionPreferences') == 0:
log ('Evolution Settings dialog not closed', 'error')
raise LdtpExecutionError (0)
except ldtp.error, msg:
@@ -92,8 +93,8 @@ def change_sentfolder (accountname, folder):
click ('dlgSelectFolder', 'btnCancel')
if guiexist ('dlgAccountEditor'):
click ('dlgAccountEditor', 'btnCancel')
- if guiexist ('dlgEvolutionSettings'):
- click ('dlgEvolutionSettings', 'btnClose')
+ if guiexist ('dlgEvolutionPreferences'):
+ click ('dlgEvolutionPreferences', 'btnClose')
time.sleep (3)
raise LdtpExecutionError (0)
diff --git a/evolution/forward-mail.py b/evolution/forward-mail.py
index f3db53d..4b6e0cd 100644
--- a/evolution/forward-mail.py
+++ b/evolution/forward-mail.py
@@ -41,20 +41,20 @@ def forward_mail (source_fldr, mail_index, to, body, subject_new, cc, refimg):
# Change the forward style
change_style ('Forward', style)
# forward mail section
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', sentitems)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', sentitems)
time.sleep (2)
- n_sentitems = getrowcount ('frmEvolution-Mail', 'ttblMessageList')
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', source_fldr)
+ n_sentitems = getrowcount ('frmEvolution-*', 'ttblMessages')
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', source_fldr)
time.sleep (2)
if mail_index == -1:
- mail_index = getrowcount ('frmEvolution-Mail', 'ttblMessageList') - 1
+ mail_index = getrowcount ('frmEvolution-*', 'ttblMessages') - 1
- selectrowindex ('frmEvolution-Mail', 'ttblMessageList', mail_index)
- subject = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', mail_index, 4)
- click ('frmEvolution-Mail','btnForward')
+ selectrowindex ('frmEvolution-*', 'ttblMessages', mail_index)
+ subject = getcellvalue ('frmEvolution-*', 'ttblMessages', mail_index, 4)
+ click ('frmEvolution-*','btnForward')
time.sleep (2)
- setcontext ('Compose a message', '[Fwd: '+subject+']')
- if waittillguiexist ('frmComposeamessage') == 0:
+ setcontext ('Compose Message', '[Fwd: '+subject+']')
+ if waittillguiexist ('frmComposeMessage') == 0:
log ('Failed to open forward frame', 'error')
raise LdtpExecutionError(0)
@@ -63,15 +63,15 @@ def forward_mail (source_fldr, mail_index, to, body, subject_new, cc, refimg):
raise LdtpExecutionError (0)
else:
if subject_new:
- setcontext ('Compose a message', subject_new[0])
+ setcontext ('Compose Message', subject_new[0])
- click ('frmComposeamessage', 'btnSend')
- if waittillguinotexist ('frmComposeamessage') == 0:
+ click ('frmComposeMessage', 'btnSend')
+ if waittillguinotexist ('frmComposeMessage') == 0:
log ('Failed to close Compose dialog after sending','error')
raise LdtpExecutionError(0)
releasecontext ()
- click ('frmEvolution-Mail', 'btnSend/Receive')
+ click ('frmEvolution-*', 'btnSend/Receive')
time.sleep (3)
if verifymailwithimage (sentitems, n_sentitems, refimg) == 1:
log ('Forward message Success', 'pass')
diff --git a/evolution/movemail.py b/evolution/movemail.py
index c8fdbfd..ea48621 100644
--- a/evolution/movemail.py
+++ b/evolution/movemail.py
@@ -33,18 +33,18 @@ from evoutils.mail import *
# Section to select and move mail
def move_mail (from_fldr, to_fldr, mail_index):
try:
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', to_fldr)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', to_fldr)
time.sleep (2)
- row_before = getrowcount('frmEvolution-Mail', 'ttblMessageList')
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', from_fldr)
+ row_before = getrowcount('frmEvolution-*', 'ttblMessages')
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', from_fldr)
time.sleep (2)
- rowcount = getrowcount('frmEvolution-Mail', 'ttblMessageList')
+ rowcount = getrowcount('frmEvolution-*', 'ttblMessages')
if rowcount > 0:
if mail_index == -1:
mail_index = rowcount-1
- selectrowindex ('frmEvolution-Mail', 'ttblMessageList', mail_index)
+ selectrowindex ('frmEvolution-*', 'ttblMessages', mail_index)
time.sleep (1)
- selectmenuitem ('frmEvolution-Mail', 'mnuMessage;mnuMovetoFolder')
+ selectmenuitem ('frmEvolution-*', 'mnuMessage;mnuMovetoFolder')
if waittillguiexist ('dlgSelectfolder') == 0:
log ('Select folder dialog not opened', 'error')
raise LdtpExecutionError(0)
@@ -58,12 +58,12 @@ def move_mail (from_fldr, to_fldr, mail_index):
raise LdtpExecutionError(0)
else:
# TODO: Moving a duplicate message has to be handled
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree',to_fldr)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree',to_fldr)
time.sleep (2)
- row_after = getrowcount ('frmEvolution-Mail', 'ttblMessageList')
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', from_fldr)
+ row_after = getrowcount ('frmEvolution-*', 'ttblMessages')
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', from_fldr)
time.sleep (2)
- rowcount_after_move = getrowcount('frmEvolution-Mail', 'ttblMessageList')
+ rowcount_after_move = getrowcount('frmEvolution-*', 'ttblMessages')
if row_after == (row_before+1) and rowcount == (rowcount_after_move+1):
log ('Moving a mail passed successfully', 'pass')
else:
diff --git a/evolution/newmsg_fromsent.py b/evolution/newmsg_fromsent.py
index 2aca7fa..8679602 100644
--- a/evolution/newmsg_fromsent.py
+++ b/evolution/newmsg_fromsent.py
@@ -41,17 +41,17 @@ def read_data():
def create_fromsent():
try:
log('create a message from sent mails','teststart')
- windowname = 'frmComposeamessage'
+ windowname = 'frmComposeMessage'
fldr = 'Sent'
Row_index, summary_to_append, subject, to = read_data()
- remap('evolution','frmEvolution-Mail')
- if selectrowpartialmatch ('frmEvolution-Mail','ttblMailFolderTree',fldr) == 1:
+ #remap('evolution','frmEvolution-Mail')
+ if selectrowpartialmatch ('frmEvolution-*','ttblMailFolderTree',fldr) == 1:
time.sleep(3)
log('Folder identified','info')
print Row_index
- selectrowindex('frmEvolution-Mail','ttblMessageList',int(Row_index))
- summary = getcellvalue('frmEvolution-Mail','ttblMessageList',int(Row_index),4)
- selectmenuitem('frmEvolution-Mail','mnuMessage;mnuEditasNewMessage')
+ selectrowindex('frmEvolution-*','ttblMessageList',int(Row_index))
+ summary = getcellvalue('frmEvolution-*','ttblMessageList',int(Row_index),4)
+ selectmenuitem('frmEvolution-*','mnuMessage;mnuEditasNewMessage')
time.sleep(3)
setcontext('Compose a message',summary)
if waittillguiexist(windowname) == 1:
@@ -69,7 +69,7 @@ def create_fromsent():
else:
print 'Unable to modify the existing messsage'
log('Unable to edit the existing message','error')
- undoremap('evolution','frmEvolution-Mail')
+ #undoremap('evolution','frmEvolution-Mail')
log('Message created from an existing mail','info')
print 'Message created from an exixting mail'
else:
diff --git a/evolution/rename-mail-folder.py b/evolution/rename-mail-folder.py
index fc642ac..881cfe1 100644
--- a/evolution/rename-mail-folder.py
+++ b/evolution/rename-mail-folder.py
@@ -33,8 +33,8 @@ from ldtputils import *
# Section to rename a mail folder
def rename_mail_folder (prev_label, new_label):
try:
- selectrow ('frmEvolution-Mail', 'ttblMailFolderTree', prev_label)
- selectmenuitem ('frmEvolution-Mail', 'mnuFolder;mnuRename')
+ selectrow ('frmEvolution-*', 'ttblMailFolderTree', prev_label)
+ selectmenuitem ('frmEvolution-*', 'mnuFolder;mnuRename*')
if waittillguiexist ('dlgRenameFolder') == 0:
log ('Rename Folder dialog not opened', 'error')
raise LdtpExecutionError (0)
@@ -56,10 +56,10 @@ def rename_mail_folder (prev_label, new_label):
log ('Renaming folder failed', 'cause')
log ('Renaming folder failed', 'fail')
else:
- if doesrowexist ('frmEvolution-Mail', 'ttblMailFolderTree', prev_label):
+ if doesrowexist ('frmEvolution-*', 'ttblMailFolderTree', prev_label):
log ('Renaming a folder failed, renaming not done properly', 'cause')
log ('Renaming a folder failed, renaming not done properly', 'fail')
- elif doesrowexist ('frmEvolution-Mail', 'ttblMailFolderTree', new_label):
+ elif doesrowexist ('frmEvolution-*', 'ttblMailFolderTree', new_label):
log ('Renaming a folder passed successfully', 'pass')
else:
log ('Renaming a folder failed', 'cause')
diff --git a/evolution/search.py b/evolution/search.py
index df2a36e..dca1454 100644
--- a/evolution/search.py
+++ b/evolution/search.py
@@ -37,28 +37,28 @@ from ldtputils import *
# Section to perform search for mail based on above search condition
def search (search_type, search_folder, search_text):
try:
- selectrowpartialmatch ('frmEvolution-Mail', 'ttblMailFolderTree', search_folder)
+ selectrowpartialmatch ('frmEvolution-*', 'ttblMailFolderTree', search_folder)
time.sleep (2)
search_mail_count = 0
- total_mail_count = getrowcount ('frmEvolution-Mail', 'ttblMessageList')
+ total_mail_count = getrowcount ('frmEvolution-*', 'ttblMessages')
print 'Counting the number of mails which satisfy the condition...'
regexp = re.compile (re.escape (search_text), re.I)
if (search_type == 'Subject or Sender contains'):
for i in range (total_mail_count):
- subject = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', i, 4)
- sender = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', i, 3)
+ subject = getcellvalue ('frmEvolution-*', 'ttblMessages', i, 4)
+ sender = getcellvalue ('frmEvolution-*', 'ttblMessages', i, 3)
if (regexp.search (subject) or regexp.search (sender)):
search_mail_count = search_mail_count + 1
elif (search_type == 'Subject contains'):
for i in range (total_mail_count):
- subject = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', i, 4)
+ subject = getcellvalue ('frmEvolution-*', 'ttblMessages', i, 4)
if (regexp.search (subject)):
search_mail_count = search_mail_count + 1
elif (search_type == 'Sender contains'):
for i in range (total_mail_count):
- sender = getcellvalue ('frmEvolution-Mail', 'ttblMessageList', i, 3)
+ sender = getcellvalue ('frmEvolution-*', 'ttblMessages', i, 3)
if (regexp.search (sender)):
search_mail_count = search_mail_count + 1
else:
@@ -67,12 +67,12 @@ def search (search_type, search_folder, search_text):
return
print '...done'
- comboselect ('frmEvolution-Mail', 'cboSearchType', search_type)
- settextvalue ('frmEvolution-Mail', 'txtSearchTextEntry', search_text)
- click ('frmEvolution-Mail', 'btnFindNow')
+ comboselect ('frmEvolution-*', 'cboSearchType', search_type)
+ settextvalue ('frmEvolution-*', 'txtSearchTextEntry', search_text)
+ click ('frmEvolution-*', 'btnFindNow')
time.sleep (2)
- filter_mail_count = getrowcount ('frmEvolution-Mail', 'ttblMessageList')
- click ('frmEvolution-Mail', 'btnClear')
+ filter_mail_count = getrowcount ('frmEvolution-*', 'ttblMessages')
+ click ('frmEvolution-*', 'btnClear')
time.sleep (2)
if search_mail_count == filter_mail_count: