summaryrefslogtreecommitdiff
path: root/evolution/verify_readonly_tasklist.py
blob: ede1c0f43128701c51192da3da41f557031f33bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
#  Linux Desktop Testing Project http://ldtp.freedesktop.org
#
#  Author:
#     Venkateswaran S <wenkat.s@gmail.com>
#
#  Copyright 2004 Novell, Inc.
#
#  This test script is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Library General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Library General Public License for more details.
#
#  You should have received a copy of the GNU Library General Public
#  License along with this library; if not, write to the
#  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
#  Boston, MA 02111-1307, USA.
#
# verify the Tasks in the server is readonly (while working offline)

from ldtp import *
from ldtputils import *

def read_data():
	#Initialising XML parser with data file
	data_object = LdtpDataFileParser (datafilename)
	
	#Extracting imput data from xml file
	summary = data_object.gettagvalue ('summary')[0]
	return summary

def verify_readonly():

	try:
		log('Verify readonly','teststart')
		summary = read_data()
		windowname = 'frmTask-*'
	        #remap('evolution','frmEvolution-Tasks')
		selectmenuitem('frmEvolution-Tasks','mnuFile;mnuWorkOffline')

		#selectrowpartialmatch ('frmEvolution-Tasks', 'tblTasks', summary)
		
                selectrow ('frmEvolution-Tasks', 'tblTasks', summary)
		selectmenuitem('frmEvolution-Tasks','mnuFile;mnuOpenTask')
		time.sleep(3)
		#setcontext('Task - No summary','Task - ' + summary)
		waittillguiexist(windowname)		
	        time.sleep(3)
                print 'here'
           	if settextvalue (windowname, 'txtDescription', summary+'.') == 0:
			print 'Verify Success'
			log('Verify Success','info')
		else:
			print 'Verify failed'
			log('Verify Failed','error')
		click(windowname,'btnClose')
		#undoremap('evolution','frmEvolution-Tasks')
	        #remap('evolution','frmEvolution-Tasks')
		selectmenuitem('frmEvolution-Tasks','mnuFile;mnuWorkOnline')
		#undoremap('evolution','frmEvolution-Tasks')
		time.sleep(3)
	except:
		print 'Unable to verify'
		log('Unable to verify','error')
		#undoremap('evolution','frmEvolution-Tasks')
	        #remap('evolution','frmEvolution-Tasks')
		selectmenuitem('frmEvolution-Tasks','mnuFile;mnuWorkOnline')
		log('verify readonly','testend')
		raise LdtpExecutionError (0)
	log('verify readonly','testend')

verify_readonly()