diff options
author | prashmohan <prashmohan> | 2006-09-13 17:28:23 +0000 |
---|---|---|
committer | prashmohan <prashmohan> | 2006-09-13 17:28:23 +0000 |
commit | ef23196f5fe3a688de5c041b71e54033861b5b30 (patch) | |
tree | afcde10b6df7c366a51616858c06861e7d8e6865 | |
parent | 0e348125818f8ba8409d452a752585e2a367012d (diff) |
Added LDTP Regression Suite
-rw-r--r-- | reg-suite/README | 15 | ||||
-rw-r--r-- | reg-suite/checkbox.py | 104 | ||||
-rw-r--r-- | reg-suite/checkmenuitem.py | 98 | ||||
-rw-r--r-- | reg-suite/closeall.py | 33 | ||||
-rw-r--r-- | reg-suite/combobox.py | 163 | ||||
-rw-r--r-- | reg-suite/combobox.xml | 5 | ||||
-rw-r--r-- | reg-suite/menu.py | 109 | ||||
-rw-r--r-- | reg-suite/pagetablist.py | 101 | ||||
-rw-r--r-- | reg-suite/pushbutton.py | 67 | ||||
-rw-r--r-- | reg-suite/radiomenuitem.py | 87 | ||||
-rw-r--r-- | reg-suite/reg-suite.xml | 492 | ||||
-rw-r--r-- | reg-suite/regression.py | 83 | ||||
-rw-r--r-- | reg-suite/regression.pyc | bin | 0 -> 1969 bytes | |||
-rw-r--r-- | reg-suite/run.xml | 59 | ||||
-rw-r--r-- | reg-suite/spinbutton.py | 84 | ||||
-rw-r--r-- | reg-suite/table.py | 141 | ||||
-rw-r--r-- | reg-suite/text.py | 354 | ||||
-rw-r--r-- | reg-suite/textvalue.xml | 10 |
18 files changed, 2005 insertions, 0 deletions
diff --git a/reg-suite/README b/reg-suite/README new file mode 100644 index 0000000..5bebf67 --- /dev/null +++ b/reg-suite/README @@ -0,0 +1,15 @@ + LDTP Regression Suite + --------------------- + +Requirements: LDTP (>=0.5.0), gedit (=2.14.x), evolution (=2.6.x) + +This Regression Suite tests the following functionalities of LDTP: + Text Box (text.py) + Menu Bar (menu.py) + Push Button (pushbutton.py) + Check Box (checkbox.py) + Check Menu Item (checkmenuitem.py) + Radio Menu Item (radiomenuitem.py) + Spin Button (spinbutton.py) + Table and Tree Table (table.py) + Combobox (combobox.py) diff --git a/reg-suite/checkbox.py b/reg-suite/checkbox.py new file mode 100644 index 0000000..4ce8d2e --- /dev/null +++ b/reg-suite/checkbox.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os + + +try: + check_open('gedit') +except: + raise + +data_object = LdtpDataFileParser (datafilename) +chkbox = data_object.gettagvalue ('checkbox') +if chkbox == []: + chkbox = 'chkDisplaylinenumbers' +else: + chkbox = chkbox[0] + +pref = '*Pref*' +log ('check','teststart') +try: + open_pref() + if guiexist (pref) != 1: + log ('Gedit Preferences Window not open','cause') + raise LdtpExecutionError (0) + if check (pref,chkbox) != 1: + log ('Check failed','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if verifycheck (pref,chkbox) != 1: + log ('Checkbox not checked','cause') + raise LdtpExecutionError (0) + if verifyuncheck (pref,chkbox) != 0: + log ('Checkbox not checked','cause') + raise LdtpExecutionError (0) +except: + testfail ('check') + raise LdtpExecutionError (0) +testpass ('check') + + +log ('uncheck','teststart') +try: + if uncheck (pref,chkbox) != 1: + log ('UnCheck failed','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if verifyuncheck (pref,chkbox) != 1: + log ('Checkbox not unchecked','cause') + raise LdtpExecutionError (0) + if verifycheck (pref,chkbox) != 0: + log ('Checkbox not unchecked','cause') + raise LdtpExecutionError (0) +except: + testfail ('uncheck') + raise LdtpExecutionError (0) +testpass ('uncheck') + + +log ('click on checkbox','teststart') +try: + pres = verifycheck (pref,chkbox) + click (pref,chkbox) + time.sleep (2) + if verifycheck (pref,chkbox) == pres: + log ('Click did not function properly','cause') + raise LdtpExecutionError (0) + click (pref,chkbox) + time.sleep (2) + if verifycheck (pref,chkbox) != pres: + log ('Click did not function properly','cause') + raise LdtpExecutionError (0) + click (pref,'btnClose') + waittillguinotexist (pref) +except: + testfail ('click on checkbox') + raise LdtpExecutionError (0) +testpass ('click on checkbox') diff --git a/reg-suite/checkmenuitem.py b/reg-suite/checkmenuitem.py new file mode 100644 index 0000000..641e4c9 --- /dev/null +++ b/reg-suite/checkmenuitem.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os + +try: + check_open('gedit') +except: + raise + + +log ('menucheck','teststart') +try: + if menucheck ('*gedit','mnuView;mnuStatusbar') != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if verifymenucheck ('*gedit','mnuView;mnuStatusbar') != 1: + log ('verifymenucheck - Check Menu item not checked','cause') + raise LdtpExecutionError (0) + if verifymenuuncheck ('*gedit','mnuView;mnuStatusbar') != 0: + log ('verifymenuuncheck - Check Menu item not checked','cause') + raise LdtpExecutionError (0) +except: + testfail ('menucheck') + raise LdtpExecutionError (0) +testpass ('menucheck') + + + +log ('menuuncheck','teststart') +try: + if menuuncheck ('*gedit','mnuView;mnuStatusbar') != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if verifymenuuncheck ('*gedit','mnuView;mnuStatusbar') != 1: + log ('verifymenuuncheck - Check Menu item not checked','cause') + raise LdtpExecutionError (0) + if verifymenucheck ('*gedit','mnuView;mnuStatusbar') != 0: + log ('verifymenucheck - Check Menu item not checked','cause') + raise LdtpExecutionError (0) +except: + testfail ('menuuncheck') + raise LdtpExecutionError (0) +testpass ('menuuncheck') + + +log ('selectmenuitem on checkmenu','teststart') +try: + curstate = verifymenucheck ('*gedit','mnuView;mnuStatusbar') + if selectmenuitem ('*gedit','mnuView;mnuStatusbar') != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if verifymenucheck ('*gedit','mnuView;mnuStatusbar') == curstart: + log ('verifymenucheck - Check Menu item not inverted','cause') + raise LdtpExecutionError (0) + curstate = verifymenucheck ('*gedit','mnuView;mnuStatusbar') + if selectmenuitem ('*gedit','mnuView;mnuStatusbar') != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if verifymenucheck ('*gedit','mnuView;mnuStatusbar') == curstart: + log ('verifymenucheck - Check Menu item not inverted 2nd time','cause') + raise LdtpExecutionError (0) +except: + testfail ('selectmenuitem on checkmenu') + raise LdtpExecutionError (0) +testpass ('selectmenuitem on checkmenu') + + diff --git a/reg-suite/closeall.py b/reg-suite/closeall.py new file mode 100644 index 0000000..00dc8d3 --- /dev/null +++ b/reg-suite/closeall.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + + +from regression import * + +close_gedit() +close_evo() diff --git a/reg-suite/combobox.py b/reg-suite/combobox.py new file mode 100644 index 0000000..1c69cf4 --- /dev/null +++ b/reg-suite/combobox.py @@ -0,0 +1,163 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + + +from regression import * +import tempfile + +try: + check_open('gedit') +except: + raise + +data_object = LdtpDataFileParser (datafilename) +value = data_object.gettagvalue ('language') +text = data_object.gettagvalue ('text') +if value == []: + value = 'C' +else: + value = value[0] +if text == []: + text = 'test text' +else: + text = text[0] + +pref = '*Pref*' + +log ('comboselect','teststart') +try: + if guiexist (pref) == 0: + open_pref() + if selecttab (pref,'ptl0','Syntax Highlighting') == 0: + log ('Unable to select tab','cause') + raise LdtpExecutionError (0) + if comboselect (pref,'cboHighlightmode',value) != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + if verifyselect (pref,'cboHighlightmode', value) != 1: + log ('Option not selected','cause') + raise LdtpExecutionError (0) +except: + testfail ('comboselect') + raise LdtpExecutionError (0) +testpass ('comboselect') + + +log ('capturetofile','teststart') +try: + file_name = tempfile.NamedTemporaryFile() + if capturetofile (pref,'cboHighlightmode',file_name.name) != 1: + log ('Undefined return Value','cause') + raise LdtpExecutionError (0) + contents = file_name.file.read().split('\n')[:-1] + for value in contents: + comboselect (pref,'cboHighlightmode',value) + time.sleep (1) + if verifyselect (pref,'cboHighlightmode', value) != 1: + log ('Option not selected','cause') + raise LdtpExecutionError (0) + click (pref,'btnClose') + file_name.close () +except: + testfail ('capturetofile') + raise LdtpExecutionError (0) +testpass ('capturetofile') + + +## http://bugzilla.gnome.org/show_bug.cgi?id=352149 +log ('selectindex','teststart') +try: + selectmenuitem ('*gedit','mnuSearch;mnuFind') + index = 0 + file_name = tempfile.NamedTemporaryFile() + waittillguiexist ('*Find') + if capturetofile ('*Find','cboSearchfor',file_name.name) != 1: + log ('Undefined return Value','cause') + raise LdtpExecutionError (0) + contents = file_name.file.read().split('\n') + for value in contents: + if selectindex ('*Find', 'cboSearchfor', index) != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (1) + if verifyselect ('*Find', 'cboSearchfor', value) != 1: + log ('Option not selected','cause') + raise LdtpExecutionError (0) +except: + testfail ('selectindex') + raise LdtpExecutionError (0) +testpass ('selectindex') + + +log ('settextvalue on combobox','teststart') +try: + if guiexist ('*Find') != 0: + log ('Find window not open','cause') + raise LdtpExecutionError (0) + if settextvalue ('*Find','cboSearchfor', text) != 1: + log ('settextvalue failed','cause') + raise LdtpExecutionError (0) + time.sleep (0) + if verifyselect ('*Find', 'cboSearchfor', text) != 1: + log ('Option not selected','cause') + raise LdtpExecutionError (0) +except: + testfail ('settextvalue on combobox') + raise LdtpExecutionError (0) +testpass ('settextvalue on combobox') + + +log ('showlist','teststart') +try: + if showlist ('*Find','cboSearchfor') != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (1) + if verifyshowlist ('*Find','cboSearchfor') != 1: + log ('List not being shown','cause') + raise LdtpExecutionError (0) +except: + testfail ('showlist') + raise LdtpExecutionError (0) +testpass ('showlist') + + +log ('hidelist','teststart') +try: + if hidelist ('*Find','cboSearchfor') != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (1) + if verifyhidelist ('*Find','cboSearchfor') != 1: + log ('List still being shown','cause') + raise LdtpExecutionError (0) + click ('*Find','btnClose') +except: + testfail ('hidelist') + raise LdtpExecutionError (0) +testpass ('hidelist') diff --git a/reg-suite/combobox.xml b/reg-suite/combobox.xml new file mode 100644 index 0000000..0dd346c --- /dev/null +++ b/reg-suite/combobox.xml @@ -0,0 +1,5 @@ +<?xml version="1.0"?> +<data> + <text>test text</text> + <language>C++</language> +</data> diff --git a/reg-suite/menu.py b/reg-suite/menu.py new file mode 100644 index 0000000..0ef9b54 --- /dev/null +++ b/reg-suite/menu.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os + +try: + check_open('gedit') +except: + raise + + +log ('listsubmenus','teststart') +try: + listsubmenus ('*gedit','mnuFile') + listsubmenus ('*gedit','mnuView') +# http://bugzilla.gnome.org/show_bug.cgi?id=351234 +# Currently Does not work for more than 1 Level of menus +# listsubmenus ('*gedit','mnuView;mnuHighlightMode') +except: + testfail ('listsubmenus') + raise LdtpExecutionError (0) +testpass ('listsubmenus') + + +log ('doesmenuitemexist','teststart') +try: + if doesmenuitemexist ('*gedit','mnuFile;mnuNew') != 1: + log ('File-->New is reported as non existent','cause') + raise LdtpExecutionError (0) + if doesmenuitemexist ('*gedit','mnuFile;mnuTESTVALUE') != 0: + log ('non existent item reported as existent','cause') + raise LdtpExecutionError (0) + if doesmenuitemexist ('*gedit','mnuFile') != 0: + log ('File is reported as end node','cause') + raise LdtpExecutionError (0) + ## Long Heirarchy + # http://bugzilla.gnome.org/show_bug.cgi?id=351802 +# if doesmenuitemexist ('*gedit','mnuView;mnuHighlightMode;mnuNormal') != 1 or \ +# doesmenuitemexist ('*gedit','mnuView;mnuHighlightMode;mnuSources;mnuC') != 1: +# log ('Long Heirarchy is reported as non existent','cause') +# raise LdtpExecutionError (0) +except: + testfail ('doesmenuitemexist') + raise LdtpExecutionError (0) +testpass ('doesmenuitemexist') + + +# log ('selectmenuitem','teststart') +# try: +# if doesmenuitemexist ('*gedit','mnuFile;mnuNew') == 1: +# selectmenuitem ('*gedit','mnuFile;mnuNew') +# time.sleep (5) +# # pres_txt = [x for x in getobjectlist ('*gedit') if x.startswith ('txt0')] +# # remap ('gedit','*gedit') +# # flag = False +# # objects = getobjeclist ('*gedit') +# # for obj in objects: +# # if obj.startswith ('txt') and obj != 'txt0': +# # flag = True +# # break +# # if not flag: +# # log ('New Tab not opened','cause') +# # raise LdtpExecutionError (0) +# else: +# raise LdtpExecutionError(0) +# if doesmenuitemexist ('*gedit','mnuFile;mnuClose') == 1: +# selectmenuitem ('*gedit','mnuFile;mnuClose') +# time.sleep (5) +# # remap ('gedit','*gedit') +# # flag = True +# # objects = getobjeclist ('*gedit') +# # for obj in objects: +# # if obj.startswith ('txt') and obj != 'txt0': +# # flag = False +# # break +# # if flag: +# # raise LdtpExecutionError (0) +# else: +# raise LdtpExecutionError(0) +# except: +# testfail ('selectmenuitem') +# raise LdtpExecutionError (0) +# testpass ('selectmenuitem') diff --git a/reg-suite/pagetablist.py b/reg-suite/pagetablist.py new file mode 100644 index 0000000..b1c3264 --- /dev/null +++ b/reg-suite/pagetablist.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os + +try: + check_open('gedit') +except: + raise + +data_object = LdtpDataFileParser (datafilename) +tab_count = data_object.gettagvalue ('tabcount') + + +if tab_count == []: + tab_count = 5 +else: + tab_count = int(tab_count[0]) + +pref = '*Pref*' +log ('tab list count','teststart') +try: + open_pref() + count = gettabcount (pref,'ptl0') + if count != tab_count: + log ('number of tabs do not tally','cause') + raise LdtpExecutionError (0) +except: + testfail ('tab list count') + raise LdtpExecutionError (0) +testpass ('tab list count') + + +log ('selecttab','teststart') +try: + open_pref() + obj = [ x for x in getobjectlist(pref) if x.startswith ('ptab')] + if selecttab (pref,'ptl0','View') == 0: + log ('Unable to select tab','cause') + raise LdtpExecutionError (0) + if selecttab (pref,'ptl0','Editor') == 0: + log ('Unable to select tab','cause') + raise LdtpExecutionError (0) + if selecttab (pref,'ptl0','Font & Colors') == 0: + log ('Unable to select tab','cause') + raise LdtpExecutionError (0) + if selecttab (pref,'ptl0','Syntax Highlighting') == 0: + log ('Unable to select tab','cause') + raise LdtpExecutionError (0) + if selecttab (pref,'ptl0','Plugins') == 0: + log ('Unable to select tab','cause') + raise LdtpExecutionError (0) + +# for tab in obj: +# if selecttab (pref,'ptl0',tab[4:]) == 0: +# log ('Unable to select tab','cause') +# raise LdtpExecutionError (0) +except: + testfail ('selecttab') + raise LdtpExecutionError (0) +testpass ('selecttab') + + +log ('selecttabindex','teststart') +try: + for ind in range (tab_count): + if selecttabindex (pref,'ptl0',ind) == 0: + log ('Unable to select tab','cause') + raise LdtpExecutionError (0) + click (pref,'btnClose') + waittillguinotexist (pref) +except: + testfail ('selecttabindex') + raise LdtpExecutionError (0) +testpass ('selecttabindex') diff --git a/reg-suite/pushbutton.py b/reg-suite/pushbutton.py new file mode 100644 index 0000000..5c590dc --- /dev/null +++ b/reg-suite/pushbutton.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os + +try: + check_open('gedit') +except: + raise + + +log ('click on push button','teststart') +try: + selectmenuitem ('*gedit','mnuTools;mnuDocumentStatistics') + waittillguiexist ('*DocumentStatistics') + click ('*DocumentStatistics','btnUpdate') + flag = True + try: + click ('*DocumentStatistics','btn123') + except: + flag = False + if flag: + log ('Also clicking unavailable buttons','cause') + raise LdtpExecutionError (0) +except: + testfail ('click on push button') + raise LdtpExecutionError (0) +testpass ('click on push button') + + +log ('enterstring on push button','teststart') +try: + enterstring ('*DocumentStatistics','btnClose','<return>') + waittillguinotexist ('*DocumentStatistics') + if guiexist ('*DocumentStatistics') == 1: + log ('Dialog did not close','cause') + raise LdtpExecutionErro (0) +except: + testfail ('enterstring on push button') + raise LdtpExecutionError (0) +testpass ('enterstring on push button') diff --git a/reg-suite/radiomenuitem.py b/reg-suite/radiomenuitem.py new file mode 100644 index 0000000..f29dc38 --- /dev/null +++ b/reg-suite/radiomenuitem.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os + +try: + open_evo() +except: + raise + +try: + click ('*Evolution*','tbtnMail') + time.sleep (3) + selectrowpartialmatch ('*Evolution*','ttblMailFolderTree','Inbox') + waittillguiexist ('*Evolution-Inbox*') +except: + log ('Could not set up initial Conditions in Evolution','cause') + raise LdtpExecutionError (0) + + +log ('menucheck on radiomenuitem','teststart') +try: + time.sleep (3) + if menucheck ('*Evolution-Inbox*','mnuView;mnuCurrentView;mnuBySubject') != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if verifymenucheck ('*Evolution-Inbox*','mnuView;mnuCurrentView;mnuBySubject') != 1: + log ('verifymenucheck - Radio Menu item not checked','cause') + raise LdtpExecutionError (0) + if verifymenuuncheck ('*Evolution-Inbox*','mnuView;mnuCurrentView;mnuBySubject') != 0: + log ('verifymenuuncheck - Radio Menu item not checked','cause') + raise LdtpExecutionError (0) +except: + testfail ('menucheck on radiomenuitem') + raise LdtpExecutionError (0) +testpass ('menucheck on radiomenuitem') + + +log ('selectmenuitem on radiomenuitem','teststart') +try: + if selectmenuitem ('*Evolution-Inbox*', + 'mnuView;mnuCurrentView;mnuBySender') != 1: + log ('Undefined return value','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if verifymenucheck ('*Evolution-Inbox*', + 'mnuView;mnuCurrentView;mnuBySender') != 1: + log ('verifymenucheck - Radio Menu item not inverted','cause') + raise LdtpExecutionError (0) + if verifymenuuncheck ('*Evolution-Inbox*', + 'mnuView;mnuCurrentView;mnuBySender') != 0: + log ('verifymenuuncheck - Radio Menu item not inverted','cause') + raise LdtpExecutionError (0) + selectmenuitem ('*Evolution-Inbox*', 'mnuView;mnuCurrentView;mnuMessages') +except: + testfail ('selectmenuitem on radiomenuitem') + raise LdtpExecutionError (0) +testpass ('selectmenuitem on radiomenuitem') + +close_evo() diff --git a/reg-suite/reg-suite.xml b/reg-suite/reg-suite.xml new file mode 100644 index 0000000..4a2f24d --- /dev/null +++ b/reg-suite/reg-suite.xml @@ -0,0 +1,492 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- XML Logging --> +<ldtp> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group1"> +<script name="text.py"> +<datafilename>textvalue.xml</datafilename> +<error>Unable to update context: *gedit in appmap</error> +<test name="settextvalue"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="gettextvalue"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="verifysettext"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<cause>Verify set text value failed</cause> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<cause>Verify set text value failed</cause> +<pass>1</pass> +</test> +<test name="stateenabled"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<info>Successfully completed</info> +<info>State Enabled</info> +<pass>1</pass> +</test> +<test name="appendtext"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="getcharactercount"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="getcursorposition"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="inserttext"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="cuttext"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="pastetext"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="copytext"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="pastetext"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="deletetext"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="cursorposition"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +<test name="verifypartialmatch"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<cause>Verify partial match failed</cause> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<cause>Verify partial match failed</cause> +<pass>1</pass> +</test> +<test name="selecttextbyname"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<pass>1</pass> +</test> +</script> +<groupstatus>1 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group2"> +<debug>Data file maynot be present</debug> +<script name="menu.py"> +<warning>data xml tag missing</warning> +<test name="listsubmenus"> +<info>New</info> +<info>Open...</info> +<info>Open Location...</info> +<info>Save</info> +<info>Save As...</info> +<info>Revert</info> +<info>Page Setup...</info> +<info>Print Preview</info> +<info>Print...</info> +<info>1. bst-1.cpp</info> +<info>2. kripa</info> +<info>3. INSTALL</info> +<info>4. README</info> +<info>5. sources-list.txt</info> +<info>Close</info> +<info>Quit</info> +<info>Empty</info> +<info>Toolbar</info> +<info>Statusbar</info> +<info>Side Pane</info> +<info>Bottom Pane</info> +<info>Highlight Mode</info> +<info>Empty</info> +<pass>1</pass> +</test> +<test name="doesmenuitemexist"> +<debug>Object definition mnuTESTVALUE not found in appmap</debug> +<debug>Object definition mnuTESTVALUE not found in appmap</debug> +<error>ldtp-gui.c - 1077 - Unable to find object name: mnuTESTVALUE in appmap</error> +<cause>Unable to get gui handle mnuTESTVALUE menu.c 252</cause> +<cause>Unable to get gui handle menu.c 204</cause> +<pass>1</pass> +</test> +</script> +<groupstatus>1 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group3"> +<debug>Data file maynot be present</debug> +<script name="pushbutton.py"> +<warning>data xml tag missing</warning> +<test name="click-on-push-button"> +<debug>Object definition *DocumentStatistics not found in appmap</debug> +<error>Unable to update context: *DocumentStatistics in appmap</error> +<debug>Object definition *DocumentStatistics not found in appmap</debug> +<error>Unable to update context: *DocumentStatistics in appmap</error> +<debug>Object definition *DocumentStatistics not found in appmap</debug> +<debug>Object definition btn123 not found in appmap</debug> +<debug>Object definition btn123 not found in appmap</debug> +<error>ldtp-gui.c - 1077 - Unable to find object name: btn123 in appmap</error> +<pass>1</pass> +</test> +<test name="enterstring-on-push-button"> +<pass>1</pass> +</test> +</script> +<groupstatus>1 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group4"> +<debug>Data file maynot be present</debug> +<script name="checkbox.py"> +<warning>data xml tag missing</warning> +<error>XML "" file not found</error> +<test name="check"> +<debug>Object definition *Pref* not found in appmap</debug> +<error>Unable to update context: *Pref* in appmap</error> +<debug>Object definition *Pref* not found in appmap</debug> +<error>Unable to update context: *Pref* in appmap</error> +<debug>Object definition *Pref* not found in appmap</debug> +<pass>1</pass> +</test> +<test name="uncheck"> +<pass>1</pass> +</test> +<test name="click-on-checkbox"> +<pass>1</pass> +</test> +</script> +<groupstatus>1 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group5"> +<debug>Data file maynot be present</debug> +<script name="checkmenuitem.py"> +<warning>data xml tag missing</warning> +<test name="menucheck"> +<warning>Check Menu Item is already checked</warning> +<pass>1</pass> +</test> +<test name="menuuncheck"> +<pass>1</pass> +</test> +<test name="selectmenuitem-on-checkmenu"> +<pass>0</pass> +</test> +<error>stopping this group execution</error> +<cause>0</cause> +</script> +<groupstatus>0 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group6"> +<debug>Data file maynot be present</debug> +<script name="spinbutton.py"> +<warning>data xml tag missing</warning> +<error>XML "" file not found</error> +<test name="getvalue"> +<debug>Property label not found in appmap</debug> +<debug>Object definition sbtnSOMETHINGNOTPRESENT not found in appmap</debug> +<debug>Object definition sbtnSOMETHINGNOTPRESENT not found in appmap</debug> +<error>ldtp-gui.c - 1077 - Unable to find object name: sbtnSOMETHINGNOTPRESENT in appmap</error> +<pass>1</pass> +</test> +<test name="setvalue"> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<pass>1</pass> +</test> +</script> +<groupstatus>1 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group7"> +<debug>Data file maynot be present</debug> +<script name="radiomenuitem.py"> +<warning>data xml tag missing</warning> +<debug>Object definition *Evolution-* not found in appmap</debug> +<error>Unable to update context: *Evolution-* in appmap</error> +<debug>Object definition *Evolution not found in appmap</debug> +<error>Unable to update context: *Evolution in appmap</error> +<debug>Object definition *Evolution-* not found in appmap</debug> +<error>Unable to update context: *Evolution-* in appmap</error> +<debug>Object definition *Evolution-* not found in appmap</debug> +<debug>Object definition *Evolution-Inbox* not found in appmap</debug> +<test name="menucheck-on-radiomenuitem"> +<cause>Radio menu item already checked</cause> +<pass>1</pass> +</test> +<test name="selectmenuitem-on-radiomenuitem"> +<cause>Radio menu item already checked</cause> +<pass>1</pass> +</test> +</script> +<groupstatus>1 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group8"> +<debug>Data file maynot be present</debug> +<script name="table.py"> +<warning>data xml tag missing</warning> +<debug>Object definition *Evolution not found in appmap</debug> +<error>Unable to update context: *Evolution in appmap</error> +<error>XML "" file not found</error> +<test name="getrowcount"> +<debug>Object definition frmEvolution-* not found in appmap</debug> +<debug>Object definition frmEvolution-* not found in appmap</debug> +<debug>Object definition *EvolutionPreferences not found in appmap</debug> +<error>Unable to update context: *EvolutionPreferences in appmap</error> +<debug>Object definition *EvolutionPreferences not found in appmap</debug> +<error>Unable to update context: *EvolutionPreferences in appmap</error> +<debug>Object definition *EvolutionPreferences not found in appmap</debug> +<error>Unable to update context: *EvolutionPreferences in appmap</error> +<debug>Object definition *EvolutionPreferences not found in appmap</debug> +<error>Unable to update context: *EvolutionPreferences in appmap</error> +<debug>Object definition *EvolutionPreferences not found in appmap</debug> +<error>Unable to update context: *EvolutionPreferences in appmap</error> +<debug>Object definition *EvolutionPreferences not found in appmap</debug> +<error>Unable to update context: *EvolutionPreferences in appmap</error> +<debug>Object definition *EvolutionPreferences not found in appmap</debug> +<pass>1</pass> +</test> +<test name="getcellvalue"> +<pass>1</pass> +</test> +<test name="selectrowindex"> +<pass>1</pass> +</test> +<test name="selectrow"> +<pass>1</pass> +</test> +<test name="selectlastrow"> +<pass>1</pass> +</test> +<test name="checkrow"> +<pass>1</pass> +</test> +</script> +<groupstatus>1 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group9"> +<debug>Data file maynot be present</debug> +<script name="combobox.py"> +<warning>data xml tag missing</warning> +<error>XML "" file not found</error> +<test name="comboselect"> +<debug>Property label not found in appmap</debug> +<debug>Property label_by not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<pass>1</pass> +</test> +<test name="capturetofile"> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<pass>1</pass> +</test> +<test name="selectindex"> +<debug>Object definition *Find not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<debug>Property label not found in appmap</debug> +<cause>Verify set text value failed</cause> +<cause>Verify Combo box SetTextValue action failed</cause> +<cause>verify Combo box select action failed</cause> +<cause>Option not selected</cause> +<pass>0</pass> +</test> +<error>stopping this group execution</error> +<cause>0</cause> +</script> +<groupstatus>0 test scripts passed of 1</groupstatus> +</group> +<warning>testcaseid entry not present - skipping</warning> +<warning>comment entry not present - skipping</warning> +<group name="Executing-group10"> +<debug>Data file maynot be present</debug> +<script name="closeall.py"> +<warning>data xml tag missing</warning> +<debug>Object definition *Question not found in appmap</debug> +</script> +<groupstatus>1 test scripts passed of 1</groupstatus> +</group> +</ldtp> diff --git a/reg-suite/regression.py b/reg-suite/regression.py new file mode 100644 index 0000000..d2c4eee --- /dev/null +++ b/reg-suite/regression.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from ldtp import * +from ldtputils import * + +def check_open (app_name='gedit'): + print 'in check_open' + if guiexist ('*gedit') != 1: + launchapp (app_name,1) + waittillguiexist ('*gedit') + if guiexist ('*gedit') !=1: + raise LdtpExecutionError (0) + return + + +def close_gedit (): + selectmenuitem ('*gedit','mnuFile;mnuQuit') + if guiexist ('*Question') == 1: + click ('*Question','btnClosewithoutSaving') + return + + +def open_evo(): + if guiexist ('*Evolution-*') != 1: + launchapp ('evolution',1) + time.sleep (2) + if guiexist ('*Evolution') == 1: + click ('*Evolution','btnNo') + waittillguiexist ('*Evolution-*') + if guiexist ('*Evolution-*') !=1: + raise LdtpExecutionError (0) + return + + +def close_evo(): + selectmenuitem ('*Evolution*','mnuFile;mnuQuit') + waittillguinotexist ('*Evolution*') + return + + +def open_pref (): + selectmenuitem ('*-gedit','mnuEdit;mnuPreferences') + waittillguiexist ('*Pref*') + if guiexist ('*Pref*') == 0: + log ('Preferences Window could not be opened','cause') + raise LdtpExecutionError (0) + return + + +def testfail (testname): + log (testname, 'fail') + log (testname, 'testend') + + +def testpass (testname): + log (testname, 'pass') + log (testname, 'testend') diff --git a/reg-suite/regression.pyc b/reg-suite/regression.pyc Binary files differnew file mode 100644 index 0000000..cb2db70 --- /dev/null +++ b/reg-suite/regression.pyc diff --git a/reg-suite/run.xml b/reg-suite/run.xml new file mode 100644 index 0000000..d40ea4f --- /dev/null +++ b/reg-suite/run.xml @@ -0,0 +1,59 @@ +<?xml version="1.0"?> +<ldtp> + <logfileoverwrite>1</logfileoverwrite> + <logfile>reg-suite.xml</logfile> + <group> + <script> + <name>text.py</name> + <data>textvalue.xml</data> + </script> + </group> + <group> + <script> + <name>menu.py</name> + </script> + </group> + <group> + <script> + <name>pushbutton.py</name> + </script> + </group> + <group> + <script> + <name>checkbox.py</name> + </script> + <!-- <script> + <name>pagetablist.py</name> + </script> --> + </group> + <group> + <script> + <name>checkmenuitem.py</name> + </script> + </group> + <group> + <script> + <name>spinbutton.py</name> + </script> + </group> + <group> + <script> + <name>radiomenuitem.py</name> + </script> + </group> + <group> + <script> + <name>table.py</name> + </script> + </group> + <group> + <script> + <name>combobox.py</name> + </script> + </group> + <group> + <script> + <name>closeall.py</name> + </script> + </group> +</ldtp> diff --git a/reg-suite/spinbutton.py b/reg-suite/spinbutton.py new file mode 100644 index 0000000..1af7cb8 --- /dev/null +++ b/reg-suite/spinbutton.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os +data_object = LdtpDataFileParser (datafilename) +tab_width = data_object.gettagvalue ('tabwidth') + +if tab_width == []: + tab_width = 10 +else: + tab_width = int(tab_width[0]) + +try: + check_open('gedit') +except: + raise + +pref = '*Pref*' +log ('getvalue','teststart') +try: + open_pref() + if guiexist (pref) != 1: + log ('Gedit Preferences Window not open','cause') + raise LdtpExecutionError (0) + tab = getvalue (pref,'sbtnTabwidth') + flag = True + try: + getvalue (pref,'sbtnSOMETHINGNOTPRESENT') + except: + flag = False + if flag: + log ('get value works for non present objects','cause') + raise LdtpExecutionError (0) +except: + testfail ('getvalue') + raise LdtpExecutionError (0) +testpass ('getvalue') + + +log ('setvalue','teststart') +try: + setvalue (pref,'sbtnTabwidth',tab_width) + time.sleep (2) + if int(getvalue (pref,'sbtnTabwidth')) != tab_width: #and \ +# verifysetvalue (pref,'sbtnTabwidth',tab_width) == 1: + log ('Spin Button value not set','cause') + raise LdtpExecutionError (0) + setvalue (pref,'sbtnTabwidth',tab) + if getvalue (pref,'sbtnTabwidth') != tab:# and \: +# verifysetvalue (pref,'sbtnTabwidth',tab) == 1: + log ('Spin Button value not set to initial value','cause') + raise LdtpExecutionError (0) +except: + testfail ('setvalue') + raise LdtpExecutionError (0) +testpass ('setvalue') + +click (pref, 'btnClose') diff --git a/reg-suite/table.py b/reg-suite/table.py new file mode 100644 index 0000000..28a3acc --- /dev/null +++ b/reg-suite/table.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os + +try: + open_evo () +except: + raise + +data_object = LdtpDataFileParser (datafilename) +rows = data_object.gettagvalue ('rowcount') + + +evo_win = 'frmEvolution-*' +pref = '*EvolutionPreferences' +acnt_tab = 'tblMailAccounts' + +log ('getrowcount','teststart') +try: + selectmenuitem (evo_win,'mnuEdit;mnuPreferences') + if waittillguiexist (pref) == 0: + log ('Preferences Window not open yet','cause') + raise LdtpExecutionError (0) + row_count = getrowcount (pref, acnt_tab) + if rows != [] and rows != row_count: + log ('No of rows does not match with input','cause') + raise LdtpExecutionError (0) +except: + testfail ('getrowcount') + raise LdtpExecutionError (0) +testpass ('getrowcount') + + +acnts = [] +log ('getcellvalue','teststart') +try: + for index in range (row_count): + val = getcellvalue (pref, acnt_tab, index, 1) +## http://bugzilla.gnome.org/show_bug.cgi?id=352220 +# if verifytablecell (pref, acnt_tab, index, 1, val) == 0: +# log ('problem in getcellvalue','cause') +# raise LdtpExecutionError (0) + acnts.append (val) +except: + testfail ('getcellvalue') + raise LdtpExecutionError (0) +testpass ('getcellvalue') + + +log ('selectrowindex','teststart') +try: + for index in range (row_count): + if selectrowindex (pref, acnt_tab, index) != 1: + log ('Unable to select index','cause') + raise LdtpExecutionError (0) + time.sleep (1) + + if gettablerowindex (pref, acnt_tab, acnts[index]) != index: + log ('Index not selected','cause') + raise LdtpExecutionError (0) +except: + testfail ('selectrowindex') + raise LdtpExecutionError (0) +testpass ('selectrowindex') + + +log ('selectrow','teststart') +try: + index = 0 + for acnt in acnts: + if doesrowexist (pref, acnt_tab, acnt) == 1 and selectrow (pref, acnt_tab, acnt) != 1: + log ('Unable to select row','cause') + raise LdtpExecutionError (0) + time.sleep (1) + if gettablerowindex (pref, acnt_tab, acnt) != index: + log ('Index not selected','cause') + raise LdtpExecutionError (0) + index += 1 +except: + testfail ('selectrow') + raise LdtpExecutionError (0) +testpass ('selectrow') + + +log ('selectlastrow','teststart') +try: + if selectlastrow (pref,acnt_tab) != 1: + log ('selectlastrow failed','cause') + raise LdtpExecutionError (0) + time.sleep (1) + if gettablerowindex (pref, acnt_tab, acnt) != (len (acnts)-1): + log ('Index not selected','cause') + raise LdtpExecutionError (0) +except: + testfail ('selectlastrow') + raise LdtpExecutionError (0) +testpass ('selectlastrow') + + +log ('checkrow','teststart') +try: + for index in range (row_count): + if uncheckrow (pref, acnt_tab, index) == 0: + log ('Unable to uncheck row','cause') + raise LdtpExecutionError (0) + time.sleep (2) + if checkrow (pref, acnt_tab, index) == 0: + log ('Unable to check row','cause') + raise LdtpExecutionError (0) +except: + testfail ('checkrow') + raise LdtpExecutionError (0) +testpass ('checkrow') +click (pref,'btnClose') diff --git a/reg-suite/text.py b/reg-suite/text.py new file mode 100644 index 0000000..31dbe6d --- /dev/null +++ b/reg-suite/text.py @@ -0,0 +1,354 @@ +#!/usr/bin/env python +# +# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp +# +# Description: +# This set of test scripts will test the LDTP framework for correct +# functioning of its APIs. This is a Regression Suite. +# +# Author: +# Prashanth Mohan <prashmohan@gmail.com> +# +# +# 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. +# + +from regression import * +import random, os + +try: + check_open('gedit') +except: + raise + +data_object = LdtpDataFileParser (datafilename) +text = data_object.gettagvalue ('text') +insert_text = data_object.gettagvalue ('inserttext') +insert_pos = data_object.gettagvalue ('insertpos') +cut_start = data_object.gettagvalue ('cutstart') +cut_stop = data_object.gettagvalue ('cutstop') +delete_start = data_object.gettagvalue ('deletestart') +delete_stop = data_object.gettagvalue ('deletestop') + +if text == []: + text = 'This is the default text for the LDTP Regression Suite' +else: + text = text[0] + +if insert_text == []: + insert_text = text +else: + insert_text = insert_text[0] +if insert_pos == []: + insert_pos = 0 +else: + insert_pos = int(insert_pos[0]) +if cut_start == []: + cut_start = 0 +else: + cut_start = int(cut_start[0]) + +try: + check_open('gedit') +except: + raise + +log ('settextvalue','teststart') +try: + if settextvalue ('*gedit','txt0',text) == 0: + raise LdtpExecutionError (0) + + if verifysettext ('*gedit','txt0',text) == 0: + raise LdtpExecutionError (0) +except: + testfail ('settextvalue') + raise LdtpExecutionError (0) +testpass ('settextvalue') + + +log ('gettextvalue','teststart') +try: + present_text = gettextvalue ('*gedit','txt0') + if present_text != text: + raise LdtpExecutionError (0) +except: + testfail ('gettextvalue') + raise LdtpExecutionError (0) +testpass ('gettextvalue') + + +log ('verifysettext','teststart') +try: + present_text = gettextvalue ('*gedit','txt0') + if verifysettext ('*gedit','txt0',present_text) != 1: + log ('Text present but says not present','cause') + raise LdtpExecutionError (0) + if verifysettext ('*gedit','txt0',present_text+'123') != 0: + log ('Text not present but says present','cause') + raise LdtpExecutionError (0) + if verifysettext ('*gedit','txt0',present_text[:-1]) != 0: + log ('Text not present but says present','cause') + raise LdtpExecutionError (0) + # http://bugzilla.gnome.org/show_bug.cgi?id=351227 +# if verifysettext ('*gedit','txt0','') != 0 and present_text != '': +# log ('Text not present but says present','cause') +# raise LdtpExecutionError (0) +except: + testfail ('verifysettext') + raise LdtpExecutionError (0) +testpass('verifysettext') + + +log ('stateenabled','teststart') +try: + if istextstateenabled ('*gedit','txt0') == 0: + log ('State Disabled','info') + raise LdtpExecutionError (0) + else: + log ('State Enabled','info') +except: + testfail ('stateenbled') + raise LdtpExecutionError (0) +testpass ('stateenbled') + + +log ('appendtext','teststart') +try: + present_text = gettextvalue ('*gedit','txt0') + if appendtext ('*gedit','txt0',text) == 0: + raise LdtpExecutionError (0) + if gettextvalue ('*gedit','txt0') != present_text+text: + raise LdtpExecutionError (0) +except: + testfail ('appendtext') + raise LdtpExecutionError (0) +testpass ('appendtext') + + +log ('getcharactercount','teststart') +try: + present_text = gettextvalue ('*gedit','txt0') + if getcharcount ('*gedit','txt0') != len(present_text): + raise LdtpExecutionError (0) +except: + testfail ('getcharactercount') + raise LdtpExecutionError (0) +testpass ('getcharactercount') + + +log ('getcursorposition','teststart') +try: + if getcharcount ('*gedit','txt0') != getcursorposition ('*gedit','txt0'): + raise LdtpExecutionError (0) +except: + testfail ('getcursorposition') + raise LdtpExecutionError (0) +testpass ('getcursorposition') + + +if len (present_text) < insert_pos: + new_text = present_text+insert_text +else: + new_text = present_text[:insert_pos]+insert_text+present_text[insert_pos:] + +log ('inserttext','teststart') +try: + if inserttext ('*gedit', 'txt0', insert_pos, insert_text) == 0: + raise LdtpExecutionError (0) + + if gettextvalue ('*gedit','txt0') != new_text: + raise LdtpExecutionError (0) +except: + testfail ('inserttext') + raise LdtpExecutionError (0) +testpass ('inserttext') + + +log ('cuttext','teststart') +try: + if cut_stop == []: + cut_stop = getcharactercount ('*gedit','txt0') + else: + cut_stop = int(cut_stop[0]) + + present_text = gettextvalue ('*gedit','txt0') + length = getcharcount ('*gedit','txt0') + + if cut_stop < cut_start or cut_start > length or cut_stop > length: + log ('Input not proper','cause') + raise LdtpExecutionError (0) + new_text = present_text[:cut_start]+present_text[cut_stop:] + cut_text = present_text[cut_start:cut_stop] + + if cuttext ('*gedit','txt0',cut_start, cut_stop) == 0: + raise LdtpExecutionError (0) + if gettextvalue ('*gedit','txt0') != new_text: + raise LdtpExecutionError (0) +except: + testfail ('cuttext') + raise LdtpExecutionError (0) +testpass ('cuttext') + + +log ('pastetext','teststart') +try: + present_text = gettextvalue ('*gedit','txt0') + new_text = present_text[:cut_start]+cut_text+present_text[cut_start:] + + if pastetext ('*gedit','txt0',cut_start) == 0: + raise LdtpExecutionError (0) + if gettextvalue ('*gedit','txt0') != new_text: + raise LdtpExecutionError (0) + +except: + testfail ('pastetext') + raise LdtpExecutionError (0) +testpass ('pastetext') + + +log ('copytext','teststart') +try: + length = getcharcount ('*gedit','txt0') + if cut_stop < cut_start or cut_start > length: + log ('Input not proper','cause') + raise LdtpExecutionError (0) + if cut_stop > length: + cut_stop = length-1 + + present_text = gettextvalue ('*gedit','txt0') + copy_text = present_text[cut_start:cut_stop] + + if copytext ('*gedit','txt0',cut_start, cut_stop) == 0: + raise LdtpExecutionError (0) + if gettextvalue ('*gedit','txt0') != present_text: + raise LdtpExecutionError (0) +except: + testfail ('copytext') + raise LdtpExecutionError (0) +testpass ('copytext') + + +log ('pastetext','teststart') +try: + present_text = gettextvalue ('*gedit','txt0') + new_text = present_text[:cut_start]+copy_text+present_text[cut_start:] + + if pastetext ('*gedit','txt0',cut_start) == 0: + raise LdtpExecutionError (0) + if gettextvalue ('*gedit','txt0') != new_text: + raise LdtpExecutionError (0) + +except: + testfail ('pastetext') + raise LdtpExecutionError (0) +testpass ('pastetext') + + +log ('deletetext','teststart') +try: + length = getcharcount ('*gedit','txt0') + present_text = gettextvalue ('*gedit','txt0') + if delete_start == []: + delete_start = 0 + else: + delete_start = int (delete_start[0]) + if delete_stop == []: + if delete_start+1 <= length: + log ('Not enough text on screen','cause') + raise LdtpExecutionError (0) + delete_stop = delete_start + 1 + else: + delete_stop = int (delete_stop[0]) + + if delete_stop < delete_start or delete_start > length or delete_stop > length: + log ('Input not proper','cause') + raise LdtpExecutionError (0) + + new_text = present_text[:delete_start]+present_text[delete_stop:] + + if deletetext ('*gedit','txt0',delete_start, delete_stop) == 0: + raise LdtpExecutionError (0) + if gettextvalue ('*gedit','txt0') != new_text: + raise LdtpExecutionError (0) +except: + testfail ('deletetext') + raise LdtpExecutionError (0) +testpass ('deletetext') + + +log ('cursorposition','teststart') #tests for getcursorposition and setcursorposition +try: + length = getcharcount ('*gedit','txt0') + setcursorposition ('*gedit','txt0',0) + if getcursorposition ('*gedit','txt0') != 0: + log ('Unable to Set Cursor position to 0','cause') + raise LdtpExecutionError (0) + if length == 0: + val = 0 + else: + val = length - 1 + setcursorposition ('*gedit','txt0',val) + if getcursorposition ('*gedit','txt0') != val: + log ('Unable to Set Cursor position to end of sentence','cause') + raise LdtpExecutionError (0) + val = length/2 + setcursorposition ('*gedit','txt0',val) + if getcursorposition ('*gedit','txt0') != val: + log ('Unable to Set Cursor position to middle of sentence','cause') + raise LdtpExecutionError (0) +except: + testfail ('cursorposition') + raise LdtpExecutionError (0) +testpass ('cursorposition') + + +log ('verifypartialmatch','teststart') +try: + present_text = gettextvalue ('*gedit','txt0') + length = len (present_text) + middle = random.randint (0,length-1) + if verifypartialmatch ('*gedit','txt0', + present_text[middle:random.randint (middle, length-1)]) != 1: + log ('Does not do correct matching','cause') + raise LdtpExecutionError (0) + if verifypartialmatch ('*gedit','txt0',text+'123') != 0: + log ('Does not check for overflow','cause') + raise LdtpExecutionError (0) + if verifypartialmatch ('*gedit','txt0','123'+text) != 0: + log ('Does not check for overflow','cause') + raise LdtpExecutionError (0) +except: + testfail ('cursorposition') + raise LdtpExecutionError (0) +testpass ('cursorposition') + + +log ('selecttextbyname','teststart') +try: + selecttextbyname ('*gedit','txt0') + ## FIXME :: Find a way to verify this!!! + setcursorposition ('*gedit','txt0',0) +except: + testfail ('selecttextbyname') + raise LdtpExecutionError (0) +testpass ('selecttextbyname') + + +## FIXME :: Add test for text properties -- gettextproperty and comparetextproperty +# try: +# close_gedit() +# except: +# raise diff --git a/reg-suite/textvalue.xml b/reg-suite/textvalue.xml new file mode 100644 index 0000000..dcb6339 --- /dev/null +++ b/reg-suite/textvalue.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<data> + <text>Test Data for text manipulations in Gedit</text> + <inserttext>Inserted TEXT</inserttext> + <insertpos>0</insertpos> + <cutstart>0</cutstart> + <cutstop>5</cutstop> + <deletestart>3</deletestart> + <deletestop>5</deletestop> +</data> |