gnome-desktop-testing r3 - in trunk: . bin desktoptesting gedit gnometesting seahorse
- From: apulido svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-desktop-testing r3 - in trunk: . bin desktoptesting gedit gnometesting seahorse
- Date: Mon, 9 Feb 2009 16:09:12 +0000 (UTC)
Author: apulido
Date: Mon Feb 9 16:09:11 2009
New Revision: 3
URL: http://svn.gnome.org/viewvc/gnome-desktop-testing?rev=3&view=rev
Log:
Changed MAINTANERS file
New changes from changes in LDTP 1.5. (to be released)
Added:
trunk/bin/desktop-testing (contents, props changed)
- copied, changed from r2, /trunk/bin/gnome-desktop-test
trunk/desktoptesting/ (props changed)
- copied from r2, /trunk/gnometesting/
Removed:
trunk/bin/gnome-desktop-test
trunk/gnometesting/
Modified:
trunk/MAINTAINERS
trunk/desktoptesting/gnome.py
trunk/desktoptesting/gnome_constants.py
trunk/gedit/gedit_chains.py
trunk/gedit/gedit_chains.xml
trunk/report.xsl
trunk/seahorse/generate_pgp.py
Modified: trunk/MAINTAINERS
==============================================================================
--- trunk/MAINTAINERS (original)
+++ trunk/MAINTAINERS Mon Feb 9 16:09:11 2009
@@ -1,6 +1,6 @@
Ara Pulido
E-mail: ara ubuntu com
-Userid: ara
+Userid: apulido
Nagappan Alagappan
E-mail: nagappan gmail com
Copied: trunk/bin/desktop-testing (from r2, /trunk/bin/gnome-desktop-test)
==============================================================================
--- /trunk/bin/gnome-desktop-test (original)
+++ trunk/bin/desktop-testing Mon Feb 9 16:09:11 2009
@@ -67,10 +67,23 @@
return True
-def is_valid_suite_file(suite_file, suites):
+def is_valid_suite(suite_file, suites, files):
+
+ # If the user has specified a file, but not a suite, skip
+ if suites is None and files is not None:
+ return False
+
# Support specifying suites with or without the extension
+ # but do not include backup files LP#326177
if suites is not None:
- suites = [os.path.splitext(s)[0] + ".xml" for s in suites]
+ suites_clean = []
+ for s in suites:
+ if os.path.splitext(s)[1] is '':
+ suites_clean.append(s + ".xml")
+ else:
+ suites_clean.append(s)
+
+ suites = suites_clean
suite = os.path.basename(suite_file)
if suites is not None and suite not in suites:
@@ -91,7 +104,30 @@
return True
-def filter_suite_files(applications, suites):
+def is_valid_suite_file(file, suites):
+
+ suite = os.path.basename(file)
+
+ pattern = r"[a-z0-9][-_a-z0-9+.]*.xml"
+ if not re.match(pattern, suite, re.I):
+ logging.debug("Suite name `%s' does not match pattern: %s",
+ file, pattern)
+ return False
+
+ if not os.path.isfile(file):
+ logging.debug("Suite file `%s' is not a file",
+ file)
+ return False
+
+ if file in suites:
+ logging.debug("Suite file is already in the list",
+ file)
+ return False
+
+ return True
+
+
+def filter_suite_files(applications, suites, files):
if not os.path.isdir(TESTS_SHARE):
error("Share directory `%s' is not a directory.", TESTS_SHARE)
@@ -105,11 +141,17 @@
# Filter suites
for suite in os.listdir(application_directory):
suite_file = os.path.join(application_directory, suite)
- if not is_valid_suite_file(suite_file, suites):
+ if not is_valid_suite(suite_file, suites, files):
continue
suite_files.append(suite_file)
+ if files is not None:
+ for file in files:
+ if not is_valid_suite_file(file, suite_files):
+ continue
+ suite_files.append(file)
+
return suite_files
def run_suite_file(suite_file, log_file):
@@ -147,7 +189,7 @@
usage = "%prog [OPTIONS]"
parser = OptionParser(usage=usage)
- default_target = "~/.gnome-desktop-tests"
+ default_target = "~/.ubuntu-desktop-tests"
default_log_level = "critical"
parser.add_option("-l", "--log",
@@ -168,6 +210,11 @@
default=None,
help="Suite name to test within applications. Option "
"can be repeated and default to all suites")
+ parser.add_option("-f", "--file",
+ action="append",
+ type="string",
+ default=None,
+ help="XML file name of the suite to test within applications.")
parser.add_option("-t", "--target",
metavar="FILE",
default=default_target,
@@ -200,7 +247,7 @@
options.target)
# Filter suite files from project directory
- suite_files = filter_suite_files(options.application, options.suite)
+ suite_files = filter_suite_files(options.application, options.suite, options.file)
# Run filtered suite file
for suite_file in suite_files:
Modified: trunk/desktoptesting/gnome.py
==============================================================================
--- /trunk/gnometesting/gnome.py (original)
+++ trunk/desktoptesting/gnome.py Mon Feb 9 16:09:11 2009
@@ -3,12 +3,9 @@
The gnome module provides wrappers for LDTP to make the write of Gnome tests easier.
"""
-from ooldtp import *
-from ldtp import *
-from ldtputils import *
+import ooldtp
+import ldtp
import gnome_constants
-from time import *
-from re import *
def open_and_check_app(app_name, window_title_txt):
"""
@@ -30,13 +27,13 @@
"""
- launchapp(app_name)
+ ldtp.launchapp(app_name)
- wait(2)
- response = waittillguiexist(window_title_txt, '', 20)
+ ldtp.wait(2)
+ response = ldtp.waittillguiexist(window_title_txt, '', 20)
if response == 0:
- raise LdtpExecutionError, "The " + window_title_txt + " window was not found."
+ raise ldtp.LdtpExecutionError, "The " + window_title_txt + " window was not found."
class Application:
"""
@@ -47,9 +44,9 @@
def remap(self):
"""
- It reloads the application map for the given context.
+ It reloads the application map for the given ooldtp.context.
"""
- remap(self.name)
+ ldtp.remap(self.name)
def exit(self, close_type='menu', close_name='mnuQuit'):
"""
@@ -61,21 +58,23 @@
@param close_name: The name of the exit widget of the application. If not mentioned the default will be used ("Quit").
"""
try:
- app = context(self.name)
+ app = ooldtp.context(self.name)
try:
close_widget = app.getchild(close_name)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The " + close_name + " widget was not found."
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The " + close_name + " widget was not found."
if close_type == 'menu':
close_widget.selectmenuitem()
elif close_type == 'button':
close_widget.click()
else:
- raise LdtpExecutionError, "Wrong close item type."
- response = waittillguinotexist(self.name, '', 20)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "Mmm, something went wrong when closing the application: " + str(msg)
+ raise ldtp.LdtpExecutionError, "Wrong close item type."
+ response = ldtp.waittillguinotexist(self.name, '', 20)
+ if response == 0:
+ raise ldtp.LdtpExecutionError, "Mmm, something went wrong when closing the application."
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "Mmm, something went wrong when closing the application."
def save(self, save_menu='mnuSave'):
"""
@@ -86,36 +85,36 @@
@param save_menu: The name of the Save menu of the application. If not mentioned the default will be used ("Save").
"""
try:
- app = context(self.name)
+ app = ooldtp.context(self.name)
try:
actualMenu = app.getchild(save_menu)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The " + save_menu + " menu was not found."
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The " + save_menu + " menu was not found."
actualMenu.selectmenuitem()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "Mmm, something went wrong when saving the current document:" + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "Mmm, something went wrong when saving the current document."
def write_text(self, text, txt_field=''):
"""
Given an application it tries to write text to its current buffer.
"""
- app = context(self.name)
+ app = ooldtp.context(self.name)
if txt_field == '':
try:
- enterstring(text)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "We couldn't write text: " + str(msg)
+ ldtp.enterstring(text)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "We couldn't write text."
else:
try:
app_txt_field = app.getchild(txt_field)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The " + txt_field + " text field was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The " + txt_field + " text field was not found."
try:
app_txt_field.settextvalue(text)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "We couldn't write text: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "We couldn't write text."
class Seahorse(Application):
"""
@@ -130,23 +129,23 @@
def new_key(self, key_type):
- seahorse = context(self.name)
+ seahorse = ooldtp.context(self.name)
try:
mnu_new_key = seahorse.getchild(gnome_constants.SH_MNU_NEWKEY)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The new key menu was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The new key menu was not found."
try:
mnu_new_key.selectmenuitem()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "There was a problem when selecting new key menu item: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was a problem when selecting new key menu item."
try:
- waittillguiexist(gnome_constants.SH_NEWKEY_DLG)
- dlg_new_key = context(gnome_constants.SH_NEWKEY_DLG)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The new key dialog was not found: " + str(msg)
+ ldtp.waittillguiexist(gnome_constants.SH_NEWKEY_DLG)
+ dlg_new_key = ooldtp.context(gnome_constants.SH_NEWKEY_DLG)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The new key dialog was not found."
try:
table = dlg_new_key.getchild(role = 'table')
@@ -158,95 +157,95 @@
if candidate == key_type:
types_table.selectrowindex(i)
break
- wait(1)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "Error getting the key types table: " + str(msg)
+ ldtp.wait(1)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "Error getting the key types table."
try:
btn_continue = dlg_new_key.getchild(gnome_constants.SH_BTN_CONTINUE)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The continue button at the new key dialog was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The continue button at the new key dialog was not found."
try:
btn_continue.click()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "There was a problem when clicking the continue button: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was a problem when clicking the continue button."
def new_pgp_key(self, full_name, email, comment, passphrase):
self.new_key(gnome_constants.SH_TYPE_PGP)
try:
- waittillguiexist(gnome_constants.SH_NEWPGP_DLG)
- dlg_new_pgp = context(gnome_constants.SH_NEWPGP_DLG)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The new key dialog was not found: " + str(msg)
+ ldtp.waittillguiexist(gnome_constants.SH_NEWPGP_DLG)
+ dlg_new_pgp = ooldtp.context(gnome_constants.SH_NEWPGP_DLG)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The new key dialog was not found."
try:
txt_field = dlg_new_pgp.getchild(gnome_constants.SH_DLG_NEWPGP_FULLNAME)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The " + txt_field + " text field was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The " + txt_field + " text field was not found."
try:
txt_field.settextvalue(full_name)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "We couldn't write text: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was an error when writing the text."
try:
txt_field = dlg_new_pgp.getchild(gnome_constants.SH_DLG_NEWPGP_EMAIL)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The " + txt_field + " text field was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The " + txt_field + " text field was not found."
try:
txt_field.settextvalue(email)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "We couldn't write text: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was a problem when writing the text."
try:
txt_field = dlg_new_pgp.getchild(gnome_constants.SH_DLG_NEWPGP_COMMENT)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The " + txt_field + " text field was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The " + txt_field + " text field was not found."
try:
txt_field.settextvalue(comment)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "We couldn't write text: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was a problem when writing the text."
try:
btn_create = dlg_new_pgp.getchild(gnome_constants.SH_BTN_NEWPGP_CREATE)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The create button at the new PGP key dialog was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The create button at the new PGP key dialog was not found."
try:
btn_create.click()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "There was a problem when clicking the create button " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was a problem when clicking the create button."
try:
- waittillguiexist(gnome_constants.SH_DLG_NEWPGP_PASS)
- dlg_new_pgp_pass = context(gnome_constants.SH_DLG_NEWPGP_PASS)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The new pgp key passphrase dialog was not found: " + str(msg)
+ ldtp.waittillguiexist(gnome_constants.SH_DLG_NEWPGP_PASS)
+ dlg_new_pgp_pass = ooldtp.context(gnome_constants.SH_DLG_NEWPGP_PASS)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The new pgp key passphrase dialog was not found."
try:
- enterstring(passphrase)
- enterstring("<tab>")
- enterstring(passphrase)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "Error entering passphrase" + str(msg)
+ ldtp.enterstring(passphrase)
+ ldtp.enterstring("<tab>")
+ ldtp.enterstring(passphrase)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "Error entering passphrase."
try:
btn_pass_ok = dlg_new_pgp_pass.getchild(gnome_constants.SH_BTN_PASS_OK)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The OK button at the new PGP key passphrase dialog was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The OK button at the new PGP key passphrase dialog was not found."
try:
btn_pass_ok.click()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "There was a problem when clicking the OK button " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was a problem when clicking the OK button."
try:
- waittillguiexist(gnome_constants.SH_DLG_GENERATING_PGP)
- waittillguinotexist(gnome_constants.SH_DLG_GENERATING_PGP)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The new pgp generating key dialog was not found: " + str(msg)
+ ldtp.waittillguiexist(gnome_constants.SH_DLG_GENERATING_PGP)
+ ldtp.waittillguinotexist(gnome_constants.SH_DLG_GENERATING_PGP)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The new pgp generating key dialog was not found."
class GEdit(Application):
@@ -276,34 +275,34 @@
@param filename: The name of the file to save the buffer to.
"""
Application.save(self)
- gedit = context(self.name)
+ ooldtp.context(self.name)
try:
- waittillguiexist(gnome_constants.GE_SAVE_DLG)
- save_dialog = context(gnome_constants.GE_SAVE_DLG)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The Gedit save dialog was not found: " + str(msg)
+ ldtp.waittillguiexist(gnome_constants.GE_SAVE_DLG)
+ save_dialog = ooldtp.context(gnome_constants.GE_SAVE_DLG)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The Gedit save dialog was not found."
try:
save_dlg_txt_filename = save_dialog.getchild(gnome_constants.GE_SAVE_DLG_TXT_NAME)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The filename txt field in Gedit save dialog was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The filename txt field in Gedit save dialog was not found."
try:
- wait(2)
+ ldtp.wait(2)
save_dlg_txt_filename.settextvalue(filename)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "We couldn't write text: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "We couldn't write text."
try:
save_dlg_btn_save = save_dialog.getchild(gnome_constants.GE_SAVE_DLG_BTN_SAVE)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The button Save in Gedit save dialog was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The button Save in Gedit save dialog was not found."
try:
save_dlg_btn_save.click()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "There was an error when pushing the Save button: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was an error when pushing the Save button."
- waittillguinotexist(gnome_constants.GE_SAVE_DLG)
+ ldtp.waittillguinotexist(gnome_constants.GE_SAVE_DLG)
def open(self):
"""
@@ -327,72 +326,72 @@
# Exit using the Quit menu
try:
- gedit = context(self.name)
+ gedit = ooldtp.context(self.name)
try:
- actualMenu = gedit.getchild(gnome_constants.GE_MNU_QUIT)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The " + quit_menu + " menu was not found."
- actualMenu.selectmenuitem()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "Mmm, something went wrong when closing the application: " + str(msg)
+ quit_menu = gedit.getchild(gnome_constants.GE_MNU_QUIT)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The quit menu was not found."
+ quit_menu.selectmenuitem()
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "Mmm, something went wrong when closing the application."
- response = waittillguiexist(gnome_constants.GE_QUESTION_DLG, '', 20)
+ response = ldtp.waittillguiexist(gnome_constants.GE_QUESTION_DLG, '', 20)
# If the text has changed, the save dialog will appear
if response == 1:
try:
- question_dialog = context(gnome_constants.GE_QUESTION_DLG)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The Gedit question dialog was not found: " + str(msg)
+ question_dialog = ooldtp.context(gnome_constants.GE_QUESTION_DLG)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The Gedit question dialog was not found."
# Test if the file needs to be saved
if save:
try:
question_dlg_btn_save = question_dialog.getchild(gnome_constants.GE_QUESTION_DLG_BTN_SAVE)
question_dlg_btn_save.click()
- except LdtpExecutionError, msg:
+ except ldtp.LdtpExecutionError:
# If the Save button was not found, we will try to find the Save As
try:
question_dlg_btn_save = question_dialog.getchild(gnome_constants.GE_QUESTION_DLG_BTN_SAVE_AS)
question_dlg_btn_save.click()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The save or save as buttons in Gedit question dialog were not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The save or save as buttons in Gedit question dialog were not found."
try:
- waittillguiexist(gnome_constants.GE_SAVE_DLG)
- save_dialog = context(gnome_constants.GE_SAVE_DLG)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The Gedit save dialog was not found: " + str(msg)
+ ldtp.waittillguiexist(gnome_constants.GE_SAVE_DLG)
+ save_dialog = ooldtp.context(gnome_constants.GE_SAVE_DLG)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The Gedit save dialog was not found."
try:
save_dlg_txt_filename = save_dialog.getchild(gnome_constants.GE_SAVE_DLG_TXT_NAME)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The filename txt field in Gedit save dialog was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The filename txt field in Gedit save dialog was not found."
try:
- wait(2)
+ ldtp.wait(2)
save_dlg_txt_filename.settextvalue(filename)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "We couldn't write text: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was an error when writing the text."
try:
save_dlg_btn_save = save_dialog.getchild(gnome_constants.GE_SAVE_DLG_BTN_SAVE)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The save button in Gedit save dialog was not found: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The save button in Gedit save dialog was not found."
try:
save_dlg_btn_save.click()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "There was an error when pushing the Save button: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "There was an error when pushing the Save button."
- waittillguinotexist(gnome_constants.GE_SAVE_DLG)
+ ldtp.waittillguinotexist(gnome_constants.GE_SAVE_DLG)
else:
try:
question_dlg_btn_close = question_dialog.getchild(gnome_constants.GE_QUESTION_DLG_BTN_CLOSE)
question_dlg_btn_close.click()
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "It was not possible to click the close button: " + str(msg)
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "It was not possible to click the close button."
- response = waittillguinotexist(self.name, '', 20)
+ response = ldtp.waittillguinotexist(self.name, '', 20)
class PolicyKit(Application):
"""
@@ -416,43 +415,43 @@
@return 1, if the gksu window exists, 0 otherwise.
"""
- return waittillguiexist(gnome_constants.SU_WINDOW)
+ return ldtp.waittillguiexist(gnome_constants.SU_WINDOW)
def set_password(self):
"""
It enters the password in the text field and clicks enter.
"""
- polKit = context(gnome_constants.SU_WINDOW)
+ ooldtp.context(gnome_constants.SU_WINDOW)
try:
- enterstring (self.password)
- enterstring ("<enter>")
+ ldtp.enterstring (self.password)
+ ldtp.enterstring ("<enter>")
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The PolicyKit txt field for the password was not found."
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The PolicyKit txt field for the password was not found."
# TODO: Change this to use ooldtp
# try:
# btnOK = polKit.getchild(gnome_constants.SU_BTN_OK)
-# except LdtpExecutionError, msg:
-# raise LdtpExecutionError, "The GtkSudo OK button was not found."
+# except ldtp.LdtpExecutionError, msg:
+# raise ldtp.LdtpExecutionError, "The GtkSudo OK button was not found."
#
# btnOK.click()
#This also have problems because of the lack of accesibiliy information
- #waittillguinotexist (gnome_constants.SU_WINDOW)
+ #ldtp.waittillguinotexist (gnome_constants.SU_WINDOW)
def cancel(self):
- polKit = context(gnome_constants.SU_WINDOW)
+ polKit = ooldtp.context(gnome_constants.SU_WINDOW)
try:
cancelButton = polKit.getchild(gnome_constants.SU_BTN_CANCEL)
- except LdtpExecutionError, msg:
- raise LdtpExecutionError, "The PolicyKit cancel button was not found."
+ except ldtp.LdtpExecutionError:
+ raise ldtp.LdtpExecutionError, "The PolicyKit cancel button was not found."
cancelButton.click()
- waittillguinotexist (gnome_constants.SU_WINDOW)
+ ldtp.waittillguinotexist (gnome_constants.SU_WINDOW)
Modified: trunk/desktoptesting/gnome_constants.py
==============================================================================
--- /trunk/gnometesting/gnome_constants.py (original)
+++ trunk/desktoptesting/gnome_constants.py Mon Feb 9 16:09:11 2009
@@ -29,8 +29,8 @@
# Seahorse contants (prefix = SH)
SH_WINDOW = "frmPasswordsandEncryptionKeys"
SH_LAUNCHER = "seahorse"
-SH_MNU_NEWKEY = "mnuCreateNewKey"
-SH_NEWKEY_DLG = "dlgCreateaNewKey"
+SH_MNU_NEWKEY = "mnuNew"
+SH_NEWKEY_DLG = "Create New ..."
SH_BTN_CONTINUE = "btnContinue"
SH_TYPE_PGP = "PGP Key"
SH_NEWPGP_DLG = "dlgCreateaPGPKey"
Modified: trunk/gedit/gedit_chains.py
==============================================================================
--- trunk/gedit/gedit_chains.py (original)
+++ trunk/gedit/gedit_chains.py Mon Feb 9 16:09:11 2009
@@ -1,19 +1,18 @@
# -*- coding: utf-8 -*-
-from ooldtp import *
-from ldtp import *
-from ldtputils import *
+import ldtp
+import ldtputils
-from time import *
+from time import time, gmtime, strftime
-from gnometesting.gnome import *
-from gnometesting.check import *
+from desktoptesting.gnome import GEdit
+from desktoptesting.check import FileComparison
try:
test = GEdit()
- dataXml = LdtpDataFileParser(datafilename)
+ dataXml = ldtputils.LdtpDataFileParser(datafilename)
oracle = dataXml.gettagvalue("oracle")[0]
chain = dataXml.gettagvalue("string")[0]
test_file = strftime("/tmp/" + "%Y%m%d_%H%M%S" + ".txt", gmtime((time())))
@@ -32,13 +31,13 @@
testcheck = FileComparison(oracle, test_file)
check = testcheck.perform_test()
- log ('elapsed_time: ' + str(elapsed), 'comment')
+ ldtp.log (str(elapsed), 'time')
- if check == FAIL:
- log ('Files differ.', 'CAUSE')
- log ('Files differ.', 'ERROR')
+ if check == desktoptesting.check.FAIL:
+ ldtp.log ('Files differ.', 'cause')
+ ldtp.log ('Files differ.', 'error')
-except LdtpExecutionError, msg:
+except ldtp.LdtpExecutionError, msg:
raise
Modified: trunk/gedit/gedit_chains.xml
==============================================================================
--- trunk/gedit/gedit_chains.xml (original)
+++ trunk/gedit/gedit_chains.xml Mon Feb 9 16:09:11 2009
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<ldtp>
<logfile>/dev/null</logfile>
+ <screenshotdir>/tmp/ldtp-screenshots</screenshotdir>
<group>
<testcaseid>SavedAsciiTestCase</testcaseid>
<script>
Modified: trunk/report.xsl
==============================================================================
--- trunk/report.xsl (original)
+++ trunk/report.xsl Mon Feb 9 16:09:11 2009
@@ -1,94 +1,121 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:template match="/">
-<html>
- <head>
- <title>
- GNOME Desktop Tests Report
- </title>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:template match="/">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
+ <head>
+ <title>
+ GNOME LDTP Tests Report
+ </title>
+ <!-- Launchpad style sheet -->
+ <style type="text/css" media="screen, print">@import url(https://edge.launchpad.net/+icing/rev7667/+style-slimmer.css);</style>
+ <!--[if lte IE 7]>
+ <style type="text/css">#lp-apps span {margin: 0 0.125%;}</style>
+ <![endif]-->
<style type="text/css">
-
- body { font:normal 68% verdana,arial,helvetica; color:#000000; }
-
- h1 { margin: 0px 0px 5px; font: 165% verdana,arial,helvetica }
- h2 { margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica }
- h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }
- h4 { margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica }
- h5 { margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica }
- h6 { margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica }
-
- table tr th{
- font-weight: bold;
- font: 80% verdana,arial,helvetica
- text-align:left;
- background:#a6caf0;
- }
- table tr td{
- background:#eeeee0;
- font: 80% verdana,arial,helvetica
- }
-
- hr.dashed {border: none 0;
- border-top: 1px dashed #000;
- border-bottom: 1px dashed #ccc;
- width: 95%;
- height: 2px;
- margin: 10px auto 0 0;
- text-align: left;
- }
- hr.clear {border: none 0;
- border-top: 1px solid #ccc;
- border-bottom: 1px solid #efefef;
- width: 80%;
- height: 2px;
- margin: 10px auto 0 0;
- text-align: left;
- }
- .passed { color:green; }
- .failed { font-weight:bold; color:red; }
- .warnings {color:orange;}
- .infos {color:green;}
- </style>
- </head>
- <body>
- <h1>GNOME Desktop Tests Report</h1>
- <hr class="clear"></hr>
- <xsl:for-each select="descendant::group">
- <h2>Group Name: <xsl:value-of select="@name"/></h2>
- <table class="details">
- <tr>
- <th>Test Name</th>
- <th>Script Name</th>
- <th>Status</th>
- <th>Time Elapsed (s)</th>
- <th>Error</th>
- </tr>
- <xsl:for-each select="child::script/child::test">
- <tr>
- <td style="padding: 3px;" align="left" width="40%"><xsl:value-of select="@name"/></td>
- <td><xsl:value-of select="ancestor::script[last()]/@name"/></td>
- <xsl:if test="child::pass/child::text() = 0">
- <td style="padding: 3px;" class="failed" align="right">Failed</td>
- </xsl:if>
- <xsl:if test="child::pass/child::text() = 1">
- <td style="padding: 3px;" class="passed" align="right">Passed</td>
- </xsl:if>
- <td style="padding: 3px;" align="right"><xsl:value-of select="substring-after(COMMENT, 'elapsed_time:')"/></td>
- <td>
- <table>
- <xsl:for-each select="child::CAUSE">
- <tr>
- <td><xsl:value-of select="text()"/></td>
- </tr>
- </xsl:for-each>
- </table>
- </td>
- </tr>
- </xsl:for-each>
- </table>
- <hr class="dashed"></hr>
- </xsl:for-each>
- </body>
-</html>
-</xsl:template>
+ fieldset.collapsed div, fieldset div.collapsed {display: none;}
+ </style>
+ <noscript>
+ <style type="text/css">
+ fieldset.collapsible div, fieldset div.collapsed {display: block;}
+ </style>
+ </noscript>
+ <script type="text/javascript" src="https://edge.launchpad.net/+icing/build/launchpad.js"/>
+ <script type="text/javascript">var cookie_scope = '; Path=/; Secure; Domain=.launchpad.net';</script>
+ <script type="text/javascript">
+ function onLoadFunction() {
+ sortables_init();
+ initInlineHelp();
+ }
+ registerLaunchpadFunction(onLoadFunction);
+ </script>
+ <link rel="shortcut icon" href="https://edge.launchpad.net/@@/launchpad.png"/>
+ </head>
+ <body id="document" class="tab-bugs onecolumn">
+ <div id="mainarea">
+ <div id="container">
+ <!--[if IE 7]> <![endif]-->
+ <div id="navigation-tabs">
+
+
+ </div>
+ <div>
+ <p>
+ <br/>
+ </p>
+ <h1>GNOME LDTP Tests Report</h1>
+ <p>
+ This are the results from a run of GNOME Desktop Tests. <br/>
+ If you find false positives, please, report bugs against <a href="https://launchpad.net/gnome-desktop-testing/+filebug">gnome-desktop-testing</a> project.
+ </p>
+ <table width="100%" class="sortable listing" id="trackers">
+ <thead>
+ <tr>
+ <th>Test Name</th>
+ <th>Script Name</th>
+ <th>Status</th>
+ <th>Time Elapsed (s)</th>
+ <th>Error</th>
+ <th>Screenshot</th>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="descendant::group">
+ <xsl:for-each select="child::script/child::test">
+ <tr>
+ <td>
+ <xsl:value-of select="@name"/>
+ </td>
+ <td>
+ <xsl:value-of select="ancestor::script[last()]/@name"/>
+ </td>
+ <xsl:if test="child::pass/child::text() = 0">
+ <td><font color="red">Failed</font></td>
+ </xsl:if>
+ <xsl:if test="child::pass/child::text() = 1">
+ <td><font color="green">Passed</font></td>
+ </xsl:if>
+ <td>
+ <xsl:value-of select="child::time/child::text()"/>
+ </td>
+ <td>
+ <xsl:if test="child::pass/child::text() = 0">
+ <xsl:value-of select="child::error/child::text()"/>
+ </xsl:if>
+ </td>
+ <td>
+ <xsl:if test="child::pass/child::text() = 0">
+ <xsl:apply-templates select="child::screenshot" mode="link"/>
+ </xsl:if>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ <p>
+ <!-- *** Last Paragraph Space *** -->
+ </p>
+ </div>
+ <div class="clear"/>
+ </div>
+ <!--id="container"-->
+ </div>
+ <!--id="mainarea"-->
+ <div id="help-pane" class="invisible">
+ <div id="help-body">
+ <iframe id="help-pane-content" class="invisible" src="javascript:void(0);"/>
+ </div>
+ <div id="help-footer">
+ <span id="help-close"/>
+ </div>
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+ <xsl:template match="screenshot" mode="link">
+ <a href="file:{text()}">
+ <xsl:value-of select="text()"/>
+ </a>
+ <xsl:text> </xsl:text>
+ </xsl:template>
</xsl:stylesheet>
Modified: trunk/seahorse/generate_pgp.py
==============================================================================
--- trunk/seahorse/generate_pgp.py (original)
+++ trunk/seahorse/generate_pgp.py Mon Feb 9 16:09:11 2009
@@ -1,13 +1,12 @@
-from ooldtp import *
-from ldtp import *
-from ldtputils import *
-from time import *
+import ldtp
+import ldtputils
+from time import time
-from gnometesting.gnome import *
+from desktoptesting.gnome import Seahorse
try:
- dataXml = LdtpDataFileParser(datafilename)
+ dataXml = ldtputils.LdtpDataFileParser(datafilename)
name = dataXml.gettagvalue("name")[0]
email = dataXml.gettagvalue("email")[0]
comment = dataXml.gettagvalue("comment")[0]
@@ -27,9 +26,9 @@
elapsed = stop_time - start_time
- log ('elapsed_time: ' + str(elapsed), 'comment')
+ ldtp.log (str(elapsed), 'time')
-except LdtpExecutionError, msg:
+except ldtp.LdtpExecutionError, msg:
raise
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]