summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagappan <nagappan>2005-07-15 14:14:41 +0000
committernagappan <nagappan>2005-07-15 14:14:41 +0000
commita4006437548626a200d2d0f5e31ae56b26490bf6 (patch)
tree7ee702b0640e7ff72b76d44b73648d4401655d42
parent1e516f7415af96b32244c26f9ac690c2c895eead (diff)
Bug buddy test-scripts
-rw-r--r--bugbuddy/bug-buddy.map116
-rwxr-xr-xbugbuddy/bug-buddy.py176
-rw-r--r--bugbuddy/launch.py52
3 files changed, 344 insertions, 0 deletions
diff --git a/bugbuddy/bug-buddy.map b/bugbuddy/bug-buddy.map
new file mode 100644
index 0000000..493bf8f
--- /dev/null
+++ b/bugbuddy/bug-buddy.map
@@ -0,0 +1,116 @@
+[BugBuddy]
+BugBuddy={class=frame, app_name=bug-buddy}
+pnl0={class=panel, instance_index=0,parent=BugBuddy}
+pnl1={class=panel, instance_index=1,parent=BugBuddy}
+lblWelcometoBugBuddy={class=label, label=Welcome to Bug Buddy}
+pnl2={class=panel, instance_index=2,parent=BugBuddy}
+ptl0={class=page_tab_list, instance_index=0}
+ptb0={class=page_tab, instance_index=0}
+lbl2={class=label, instance_index=2,parent=BugBuddy}
+rdoTheapplicationdoesnotfunctioncorrectly={class=radio_button, label=The application does not function correctly}
+rdoThedocumentationiswrong={class=radio_button, label=The documentation is wrong}
+rdoThetranslationiswrong={class=radio_button, label=The translation is wrong}
+rdoRequestamissingfeature={class=radio_button, label=Request a missing feature}
+rdoDebugacrashedorrunningapplication={class=radio_button, label=Debug a crashed or running application (experts only)}
+ptb1={class=page_tab, instance_index=1}
+ptl1={class=page_tab_list, instance_index=1}
+ptb2={class=page_tab, instance_index=2}
+ptb3={class=page_tab, instance_index=3}
+lblDebug={class=label, label=Debug}
+pnl3={class=panel, instance_index=3,parent=BugBuddy}
+cbonothing={class=combo_box, label=nothing}
+mnucrashedapplication={class=menu_item, label=crashed application, parent=mnunothing}
+mnucorefile={class=menu_item, label=core file, parent=mnunothing}
+mnunothing={class=menu_item, label=nothing, parent=mnunothing}
+pnl4={class=panel, instance_index=4,parent=BugBuddy}
+btnStart={class=push_button, label=Start}
+pnl5={class=panel, instance_index=5,parent=BugBuddy}
+btnStop={class=push_button, label=Stop}
+lblBinaryfile={class=label, label=Binary file:}
+cboPath={class=combo_box, label=Path}
+txt0={class=text, instance_index=0,parent=cboPath}
+btnBrowse={class=push_button, label=Browse...}
+lblProcessID={class=label, label=Process ID:}
+txt1={class=text, instance_index=1,parent=BugBuddy}
+lblCorefile={class=label, label=Core file}
+cboPath={class=combo_box, label=Path}
+txt2={class=text, instance_index=2,parent=cboPath}
+btnBrowse={class=push_button, label=Browse...}
+txt3={class=text, instance_index=3,parent=BugBuddy}
+btnCopy={class=push_button, label=Copy}
+btnSave={class=push_button, label=Save}
+btnShowDebuggingDetails={class=push_button, label=Show Debugging Details}
+ptb4={class=page_tab, instance_index=4}
+lblPleaseselecttheproductorapplicationforthebugyouwishtoreport.={class=label, label=Please select the product or application for the bug you wish to report.}
+tblProducts={class=table, instance_index=0, parent=BugBuddy}
+rdoShowApplications={class=radio_button, label=Show Applications}
+rdoShowProducts={class=radio_button, label=Show Products}
+ptb5={class=page_tab, instance_index=5}
+lblPleasechooseacomponent,version,andseveritylevel.={class=label, label=Please choose a component, version, and severity level.}
+tblComponent={class=table, instance_index=1, parent=BugBuddy}
+lblVersion={class=label, label=Version:}
+cbo3={class=combo_box, instance_index=3,parent=BugBuddy}
+lblSeverity={class=label, label=Severity:}
+cbo4={class=combo_box, instance_index=4,parent=BugBuddy}
+ptb6={class=page_tab, instance_index=6}
+lblPleasetakeaminutetoseeifyourbugisoneofthemostfrequentlyreportedbugs.
+Ifthebugisalreadyreported,pleasedonotreportitagain.={class=label, label=Please take a minute to see if your bug is one of the most frequently reported bugs.
+If the bug is already reported, please do not report it again.}
+tbl2={class=table, instance_index=2,parent=BugBuddy}
+lblShowmostfrequentbugsin={class=label, label=Show most frequent bugs in:}
+cbo5={class=combo_box, instance_index=5,parent=BugBuddy}
+ptb7={class=page_tab, instance_index=7}
+lblPleasemakeyourbugreportinEnglish,ifpossible.={class=label, label=Please make your bug report in English, if possible.}
+pnlSummary={class=panel, label=Summary}
+txtSummary={class=text, instance_index=4}
+lblSummary={class=label, label=Summary}
+pnlDescription={class=panel, label=Description}
+txtDescription={class=text, instance_index=5}
+lblDescription={class=label, label=Description}
+pnlIncludeatextfile={class=panel, label=Include a text file}
+cboPath={class=combo_box, label=Path}
+txt6={class=text, instance_index=6,parent=cboPath}
+btnBrowse={class=push_button, label=Browse...}
+lblIncludeatextfile={class=label, label=Include a text file}
+ptb8={class=page_tab, instance_index=8}
+lblBugBuddyusesemailtosubmitthebugreports.
+PleasechoosehowyouwouldlikeBugBuddytosendemail.={class=label, label=Bug Buddy uses email to submit the bug reports.
+Please choose how you would like Bug Buddy to send email.}
+rdoUsesendmaildirectly={class=radio_button, label=Use sendmail directly}
+rdoJustsavetoafilesoIcansubmitabugreportmanually={class=radio_button, label=Just save to a file so I can submit a bug report manually}
+pnlSendmailSettings={class=panel, label=Sendmail Settings}
+pnl10={class=panel, instance_index=10,parent=pnlSendmailSettings}
+lblEmail={class=label, label=Email:}
+cbo7={class=combo_box, instance_index=7,parent=pnlSendmailSettings}
+txtEmail={class=text, instance_index=7}
+cboPath={class=combo_box, label=Path}
+txtPathofsendmail={class=text, instance_index=8}
+btnBrowse={class=push_button, label=Browse...}
+lblPathofsendmail={class=label, label=Path of sendmail:}
+cbo9={class=combo_box, instance_index=9,parent=pnlSendmailSettings}
+txtName={class=text, instance_index=9}
+lblName={class=label, label=Name:}
+lblSendmailSettings={class=label, label=Sendmail Settings}
+ptb9={class=page_tab, instance_index=9}
+pnl11={class=panel, instance_index=11,parent=BugBuddy}
+cbo10={class=combo_box, instance_index=10,parent=BugBuddy}
+txtTo={class=text, instance_index=10}
+cbo11={class=combo_box, instance_index=11,parent=BugBuddy}
+txtCC={class=text, instance_index=11}
+lblTo={class=label, label=To:}
+lblCc={class=label, label=Cc:}
+lblSavein={class=label, label=Save in:}
+cboPath={class=combo_box, label=Path}
+txt12={class=text, instance_index=12,parent=cboPath}
+btnBrowse={class=push_button, label=Browse...}
+txt13={class=text, instance_index=13,parent=BugBuddy}
+ptb10={class=page_tab, instance_index=10}
+lblAssbarnPhenomenon={class=label, label=Assbarn Phenomenon}
+chkSubmitanotherbug={class=check_box, label=Submit another bug}
+btnHelp={class=push_button, label=Help}
+btnAbout={class=push_button, label=About}
+btnCancel={class=push_button, label=Cancel}
+btnBack={class=push_button, label=Back}
+btnClose={class=push_button, label=Close}
+btnForward={class=push_button, label=Forward}
+btnSendReport={class=push_button, label=Send Report}
diff --git a/bugbuddy/bug-buddy.py b/bugbuddy/bug-buddy.py
new file mode 100755
index 0000000..4625ef1
--- /dev/null
+++ b/bugbuddy/bug-buddy.py
@@ -0,0 +1,176 @@
+#!/usr/bin/python
+#
+# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp
+#
+# Author:
+# A. Nagappan <anagappan@novell.com>
+#
+# Copyright 2004 Novell, Inc.
+#
+# This library 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 *
+import string, sys, os, commands, time, filecmp
+
+appmap_path = ''
+default_dir = os.getcwd ()
+bugbuddy_exe_path = 'bug-buddy'
+
+startlog ('bug-buddy.xml', 1)
+
+log ('Bug Buddy Test Report', 'begin')
+
+if len (sys.argv) == 1:
+ if os.access ('./bug-buddy.map', os.F_OK | os.R_OK) == 0:
+ log ('Appmap path missing', 'error')
+ log ('Bug Buddy Test Report', 'end')
+ stoplog ()
+ sys.exit(0);
+ else:
+ appmap_path = '.'
+else:
+ appmap_path = sys.argv[1]
+
+initappmap (appmap_path + '/bug-buddy.map')
+
+try:
+ # TO DO
+ # We need to check in this script
+ # If bug-buddy is already invoked by external application
+ # we should not invoke it once again
+ execfile ('launch.py')
+except LdtpExecutionError:
+ log ('Unable to launch Bug Buddy', 'Error')
+ log ('Bug Buddy Test Report', 'end')
+ stoplog ()
+ sys.exit (0)
+
+time.sleep (5)
+
+def set_summary (summary):
+ settextvalue ('BugBuddy', 'txtSummary', summary)
+
+def select_application ():
+ check ('BugBuddy', 'rdoTheapplicationdoesnotfunctioncorrectly')
+
+def select_translation ():
+ check ('BugBuddy', 'rdoTheTranslationiswrong')
+
+def select_documentation ():
+ check ('BugBuddy', 'rdoThedocumentationiswrong')
+
+def select_enhancement ():
+ check ('BugBuddy', 'rdoRequestamissingfeature')
+
+def select_expert ():
+ check ('BugBuddy', 'rdoDebugacrashedorrunningapplication')
+
+def select_products ():
+ check ('BugBuddy', 'rdoShowProducts')
+
+def select_applications ():
+ check ('BugBuddy', 'rdoShowApplications')
+
+def describe_bug ():
+ # TO DO
+ # Before setting new description, if some stack trace is available
+ # we need to get that text and then start adding new text
+ # Because settextvalue just overwrites existing text content :(
+ txtDesc = 'Description of Problem:\n' + 'Just testing description' + '\n\n'
+ txtSteps = 'Steps to reproduce the problem:\n' + 'Just testing reproducing steps' + '\n\n'
+ txtActual = 'Actual results:\n' + 'Just testing actual results' + '\n\n'
+ txtExpected = 'Expected results:\n' + 'Just expected results' + '\n\n'
+ txtHowOften = 'How often does this happen?\n' + 'Just testing how often does this happen' + '\n\n'
+ txtAdditionalInfo = 'Additional Information:\n' + 'Just testing additional information' + '\n\n'
+ settextvalue ('BugBuddy', 'txtDescription', txtDesc + txtSteps + txtActual +
+ txtExpected + txtHowOften + txtAdditionalInfo)
+
+try:
+ # TO DO
+ # For 0.1.7 release hardcoded selecting application, needs to be dynamic ;)
+ select_application ()
+
+ # Navigate to next screen
+ click ('BugBuddy', 'btnForward')
+ time.sleep (5)
+
+ # TO DO
+ # Selecting show products - For 0.1.7 release hardcoded selecting show products, needs to be dynamic ;)
+ select_products ()
+ # On my laptop it takes a long delay to load all the products
+ # So, I have given a long delay - Old DELL laptop ;)
+ time.sleep (15)
+
+ # TO DO
+ # Selecting beagle - For 0.1.7 release hardcoded selecting beagle, needs to be dynamic ;)
+ selectrow ('BugBuddy', 'tblProducts', 'beagle')
+
+ # Navigate to next screen
+ click ('BugBuddy', 'btnForward')
+ time.sleep (2)
+
+ # TO DO
+ # Selecting General - For 0.1.7 release hardcoded selecting general, needs to be dynamic ;)
+ selectrow ('BugBuddy', 'tblComponent', 'General')
+
+ # Navigate to next screen
+ click ('BugBuddy', 'btnForward')
+ time.sleep (2)
+ # Frequently reported bugs page. Just navigating this page also.
+ click ('BugBuddy', 'btnForward')
+
+ # TO DO
+ # Argument to this function should be passed from external script to this script
+ set_summary ('bug-buddy test-scripts using Linux Desktop Testing Project')
+
+ # TO DO
+ # Values in describe_bug functions are hard coded. Needs to be modified and
+ # this function should take all the required arguments plus need to fill
+ # optional arguments (If required ?)
+ describe_bug ()
+
+ # After describing the bug navigate to next page
+ click ('BugBuddy', 'btnForward')
+
+ # Select mail option. To send the bug report as mail
+ check ('BugBuddy', 'rdoUsesendmaildirectly')
+ # Name of the person who files the bug. Should be changed, if necessary ;)
+ settextvalue ('BugBuddy', 'txtName', 'Linux Desktop Testing Project')
+ # Email id of the person who files the bug. Should be changed, if necessary ;)
+ settextvalue ('BugBuddy', 'txtEmail', 'ldtp@gnomebangalore.org')
+ # Navigate to next screen
+ click ('BugBuddy', 'btnForward')
+
+ # Recipients
+ # Hardcoded to anagappan@novell.com for timebeing. This has to be changed.
+ # Till the time we are in testing phase, maybe some id like this can be there ;)
+ # But I'm annoid with spam mails :D
+ settextvalue ('BugBuddy', 'txtTo', 'anagappan@novell.com')
+ # Send the report
+ click ('BugBuddy', 'btnSendReport')
+ # Close bug buddy
+ click ('BugBuddy', 'btnClose')
+
+ # If everything goes well
+ log ('Bug Buddy Test Report', 'pass')
+except error, msg:
+ log ('Unable to use Bug Buddy', 'Error')
+ log (str (msg), 'Cause')
+ log ('Bug Buddy Test Report', 'fail')
+log ('Bug Buddy Test Report', 'end')
+stoplog ()
diff --git a/bugbuddy/launch.py b/bugbuddy/launch.py
new file mode 100644
index 0000000..1fb79fd
--- /dev/null
+++ b/bugbuddy/launch.py
@@ -0,0 +1,52 @@
+#
+# Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp
+#
+# Author:
+# A. Nagappan <anagappan@novell.com>
+#
+# Copyright 2004 Novell, Inc.
+#
+# This library 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.
+#
+
+# Launch an instance of Bug buddy
+
+log ('Launch Bug Buddy', 'teststart')
+
+status = os.fork ()
+if status == -1:
+ log ('Unable to fork', 'error')
+ log ('Launch Bug Buddy', 'testend')
+ raise LdtpExecutionError (0)
+if status == 0:
+ try:
+ log ('Bug Buddy is being loaded', 'info')
+ try:
+ status = commands.getstatusoutput (bugbuddy_exe_path)
+ except KeyboardInterrupt:
+ # interrupted
+ print ''
+ os._exit (os.EX_OK)
+ except OSError, msg:
+ log (str (msg), 'error')
+ log ('Launch Bug Buddy', 'testend')
+ raise LdtpExecutionError (0)
+
+# wait for 5 seconds, let the Bug Buddy application be loaded
+log ('wait for 5 seconds, let the Bug Buddy application be loaded', 'info')
+time.sleep (5)
+
+log ('Launch Bug Buddy', 'testend')