summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNagappan Alagappan <nagappan@gmail.com>2010-12-21 22:25:20 -0800
committerNagappan Alagappan <nagappan@gmail.com>2010-12-21 22:25:20 -0800
commit22ac67c0dd7874e91c593b64dbb1b311a9372d23 (patch)
tree368e8dd2eb6f6ab3a255e72b5f4e78d95d6e4f8c
parenteeee1ad358ddbb76900cbb951f7946e967213e26 (diff)
New doc addition
-rw-r--r--doc/pyldtp-doc.h734
1 files changed, 451 insertions, 283 deletions
diff --git a/doc/pyldtp-doc.h b/doc/pyldtp-doc.h
index 857c183..1086493 100644
--- a/doc/pyldtp-doc.h
+++ b/doc/pyldtp-doc.h
@@ -138,7 +138,7 @@
* </TR>
* <TR>
* <TD>
- * \subpage LTFX
+ * \subpage WNCK-WindowOp
* </TD>
* </TR>
* </TABLE>
@@ -312,9 +312,6 @@
* \subpage hasstate - Checks whether the object has a state
* \n
* \n
- * \subpage initappmap - Initialize application map
- * \n
- * \n
* \subpage keypress - Generate keyboard press event
* \n
* \n
@@ -324,25 +321,13 @@
* \subpage launchapp - Launch application
* \n
* \n
- * \subpage launchapp2 - Launch application
- * \n
- * \n
- * \subpage reinitldtp - Reinitialize LDTP
- * \n
- * \n
- * \subpage releasecontext - Release the context information
- * \n
- * \n
* \subpage remap - Force remap the window information
* \n
* \n
- * \subpage setcontext - Set the context information
- * \n
- * \n
* \subpage setlocale - Set locale to given locale
* \n
* \n
- * \subpage stopscriptengine - Stop LDTP script engine
+ * \subpage simulatemousemove - Simulate mouse move
* \n
* \n
* \subpage wait - Suspend the operation for specified duration
@@ -462,15 +447,9 @@
* \subpage setloglevel - Set the level of logging
* \n
* \n
- * \subpage startldtplog - Start LDTP engine logging to a file
- * \n
- * \n
* \subpage startlog - Start logging to a file
* \n
* \n
- * \subpage stopldtplog - Stop LDTP engine logging to a file
- * \n
- * \n
* \subpage stoplog - Stop logging to a file
*
*/
@@ -518,11 +497,19 @@
/** \page ProcessStatistics ProcessStatistics
* \section ProcessStatisticsSection About Process Statistics functions
*
- * To monitor the CPU and memory utilization you can use this class
+ * To monitor the CPU and memory utilization you can use these functions
+ *
+ * NOTE: You need to have libstatgrab >= 0.16 and python-statgrab >= 0.5 installed to use any of these APIs
*
* \section ProcessStatisticsAPI Process Statistics python API's
*
- * \subpage Classpstats - Python class to monitor CPU / Memory utilization
+ * \subpage startprocessmonitor - Start monitoring CPU / Memory utilization
+ *
+ * \subpage stopprocessmonitor - Stop monitoring CPU / Memory utilization
+ *
+ * \subpage getcpustat - Get CPU utilization of the given process
+ *
+ * \subpage getmemorystat - Get Memory utilization of the given process
*
*/
@@ -1064,6 +1051,12 @@
* open windows
* \n
* \n
+ * \subpage deregisterevent - De-Register user defined window event
+ * \n
+ * \n
+ * \subpage deregisterkbevent - De-Register user defined keyboard event
+ * \n
+ * \n
* \subpage getapplist - Get list of accessibility enabled applications
* \n
* \n
@@ -1112,6 +1105,12 @@
* when the specified window is created
* \n
* \n
+ * \subpage registerevent - Register user defined window event
+ * \n
+ * \n
+ * \subpage registerkbevent - Register user defined keyboard event
+ * \n
+ * \n
* \subpage removecallback - Remove the registered callback function using onwindowcreate
* \n
* \n
@@ -1126,15 +1125,14 @@
*
*/
-/** \page LTFX LTFX functions
- * \section LTFXSection About LTFX functions
+/** \page WNCK-WindowOp WNCK-WindowOp functions
+ * \section WnckWindowOpSection About Wnck based Window operation functions
*
* To operate on an window in which accessibility is not enabled we
- * use external application Linux Test For X (In short LTFX) -
- * http://sf.net/projects/ltfx
+ * use external application python wnck
* \n
*
- * \section LTFXAPI LTFX python API's
+ * \section WNCKAPI WNCK Window Op API's
*
* \subpage activatewin - Activate the window with the given title
* \n
@@ -1164,9 +1162,9 @@
* the given title
* \n
*
- * \section LTFXAssumptions Assumptions
+ * \section WNCKAssumptions Assumptions
*
- * LTFX functions assumes that the window to be operated is in
+ * WNCK functions assumes that the window to be operated is in
* focus. It directly generates the X key board events. It does not
* know whether the object exist or the operation is successfully
* done.
@@ -1185,29 +1183,6 @@
*/
/**
- * \page initappmap initappmap
- * \section Syntax
- *
- * initappmap ('\<application map name\>')
- *
- * \section Description
- *
- * Application map will be loaded
- *
- * Refer:
- * http://cgit.freedesktop.org/ldtp/ldtp/tree/src/client-handler.c
- * http://cgit.freedesktop.org/ldtp/ldtp/tree/src/appmap.c
- *
- * \section Example
- *
- * from ldtp import *
- *
- * initappmap ('nautilus.map')
- *
- * \author Nagappan Alagappan <nagappan@gmail.com>
- */
-
-/**
* \page guiexist guiexist
* \section Syntax
*
@@ -1631,31 +1606,6 @@
*/
/**
- * \page reinitldtp reinitldtp
- * \section Syntax
- *
- * reinitldtp ()
- *
- * \section Description
- *
- * When we work with applications like nautilus, if we open a new window, the new window will not be recognized, until we close and open the session. In case of Mozilla Firefox also we could notice the same behaviour. Like opening Preference window, opening printer dialog etc.
- *
- * \section ImplementationDetails
- *
- * Closes the existing accessibility connection with at-spi-registryd and opens a new connection.
- *
- * \retval 1 on success, LdtpExecutionError on failure
- *
- * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/src/client-handler.c
- *
- * \section Example
- *
- * reinitldtp ()
- *
- * \author Nagappan Alagappan <nagappan@gmail.com>
- */
-
-/**
* \page check check
* \section Syntax
*
@@ -2141,7 +2091,7 @@
/** \page hidelist hidelist
* \section Syntax
*
- * hidelist ('\<dlgName\>', '\<cmbName\>')
+ * hidelist ('\<dlgName\>', '\<cboName\>')
*
* \section Description
*
@@ -2181,7 +2131,7 @@
*
* In gnome-search-tool combo box 'Available options' to select the menu item 'Contains the text'
*
- * comboselect ('SearchForFiles', 'cmbAvailableoptions', 'Contains the text')
+ * comboselect ('SearchForFiles', 'cboAvailableoptions', 'Contains the text')
*
* \author Poornima <pnayak@novell.com>
*/
@@ -2442,7 +2392,7 @@
*
* In combo box:
*
- * \todo settextvalue ('\<dlgName\>', '\<cmbName\>', '\<argument\>')
+ * settextvalue('dlgFind', 'cboSearchfor', 'test')
*
* \author Poornima <pnayak@novell.com>
*/
@@ -2658,7 +2608,7 @@
/** \page showlist showlist
* \section Syntax
*
- * showlist ('\<dlgName\>', '\<cmbName\>')
+ * showlist ('\<dlgName\>', '\<cboName\>')
*
* \section Description
*
@@ -2700,7 +2650,7 @@
/** \page verifyhidelist verifyhidelist
* \section Syntax
*
- * verfyhidelist ('\<dlgName\>', '\<cmbName\>')
+ * verfyhidelist ('\<dlgName\>', '\<cboName\>')
*
* \section Description
*
@@ -2724,7 +2674,7 @@
/** \page verifyshowlist verifyshowlist
* \section Syntax
*
- * verifyshowlist ('\<dlgName\>', '\<cmbName\>')
+ * verifyshowlist ('\<dlgName\>', '\<cboName\>')
*
* \section Description
*
@@ -2748,7 +2698,7 @@
/** \page verifyselect verifyselect
* \section Syntax
*
- * verifyselect ('\<dlgName\>', '\<cmbName\>', '\<argument\>')
+ * verifyselect ('\<dlgName\>', '\<cboName\>', '\<argument\>')
*
* \section Description
*
@@ -2766,7 +2716,7 @@
*
* In gnome-search-tool combo box 'Available options' to select the menu item 'Contains the text'
*
- * verifyselect ('SearchForFiles', 'cmbAvailableoptions', 'Contains the text')
+ * verifyselect ('SearchForFiles', 'cboAvailableoptions', 'Contains the text')
*
* \author Poornima <pnayak@novell.com>
*/
@@ -3806,56 +3756,6 @@
* \author Nagappan Alagappan <nagappan@gmail.com>
*/
-/** \page setcontext setcontext
- * \section Syntax
- *
- * setcontext ('\<previous title name\>', '\<new title name\>')
- *
- * \section Description
- *
- * LDTP selects window (frame / dialog / alert / font chooser) based on the title name.
- *
- * \section ImplementationDetails
- *
- * set the context to new title name. Changes are done in is_matching function in gui.c
- *
- * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/src/client-handler.c
- *
- * \section Example
- *
- * In some applications the window title changes based on the operation we are doing. For example, when we browse any URL in Firefox browser, the title bar changes. Once title bar changed, then we can change the context using this function.
- *
- * setcontext ('Mozilla Firefox', 'NOVELL: Novell and Linux - Mozilla Firefox')
- *
- * \author Nagappan Alagappan <nagappan@gmail.com>
- */
-
-/** \page releasecontext releasecontext
- * \section Syntax
- *
- * releasecontext ()
- *
- * \section Description
- *
- * Release the last context set.
- *
- * \section ImplementationDetails
- *
- * Release the existing (last) context set using \ref setcontext function.
- *
- * \retval 1 on success, LdtpExecutionError on failure
- *
- * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/src/client-handler.c
- *
- * \section Example
- *
- * In some applications the window title changes based on the operation we are doing. For example, when we browse any URL in Firefox browser, the title bar changes. Once title bar changed, then we can change the context using this function.
- *
- * releasecontext ()
- *
- * \author Nagappan Alagappan <nagappan@gmail.com>
- */
-
/** \page selectevent selectevent
* \section Syntax
*
@@ -4329,9 +4229,9 @@
*
* \section Example
*
- * \todo
+ * selectindex ('x-nautilus-desktop', 'Icon View', 0)
*
- * \author
+ * \author Nagappan Alagappan <nagappan@gmail.com>
*/
/** \page verifyvisiblebuttoncount verifyvisiblebuttoncount
@@ -4805,7 +4705,7 @@
/** \page doubleclickrow doubleclickrow
* \section Syntax
*
- * doubleclickrow ('\<window name\>', '\<table name\>', '\<value of row in first column\>')
+ * doubleclickrow('\<window name\>', '\<table name\>', '\<value of row in first column\>')
*
* \section Description
*
@@ -4880,7 +4780,7 @@
*
* \section Example
*
- * \todo
+ * doubleclick(u'frm%s' % os.getenv('LOGNAME'), 'icoDesktop')
*
* \author Premkumar J <prem.jothimani@gmail.com>
*/
@@ -5085,7 +4985,7 @@
*
* With respect to gedit application, replace dialog
*
- * <pre>
+ * @code
*
* from ldtp import *
* import threading
@@ -5124,7 +5024,7 @@
*
* print 'test end'
*
- * </pre>
+ * @endcode
*
* \author Nagappan Alagappan <nagappan@gmail.com>
*/
@@ -5289,62 +5189,6 @@
*/
-/** \page startldtplog startldtplog
- * \section Syntax
- *
- * startldtplog ('\<log file name\>', [0 or 1])
- *
- * second argument is optional and 1 is default value
- *
- * 0 - Append ldtplog to an existing file
- *
- * 1 - Write ldtp log to a new file. If file already exist, then erase existing file content and start ldtp log
- *
- * \section Description
- *
- * Start ldtp logging on the specified file
- *
- * \section ImplementationDetails
- * Log file will be created if log file is not present in any case. If second argument is 1, then existing file content will be erased. If second argument is 0, then new logs will be append to existing log.
- *
- * \retval 1 on Success and 0 on error
- *
- * \section Example
- *
- * If we want to overwrite existing log file or create new log file:
- *
- * startldtplog ('evolution.xml', 1)
- *
- * If we want to append existing log file or create new log file:
- *
- * startldtplog ('evolution.xml', 0)
- *
- * or
- *
- * startldtplog ('evolution.xml')
- *
- * \author Nagappan Alagappan <nagappan@gmail.com>
- */
-
-/** \page stopldtplog stopldtplog
- * \section Syntax
- *
- * stopldtplog ()
- *
- * \section Description
- *
- * Stop ldtplogging
- *
- * \section ImplementationDetails
- * If a log file has been previously opened for logging, that file pointer will be closed. So that the new logging will not be appened to the log file.
- *
- * \section Example
- *
- * stopldtplog ()
- *
- * \author Nagappan Alagappan <nagappan@gmail.com>
- */
-
/** \page imagecapture imagecapture
* \section Syntax
*
@@ -5434,48 +5278,286 @@
* \author Shankar Ganesh <shagan.glare@gmail.com>
*/
-/** \page Classpstats Class pstats
+/** \page startprocessmonitor startprocessmonitor
* \section Syntax
*
- * \<Object\> = pstats(\<application name\>, \<time interval\>)
+ * startprocessmonitor(\<application name\>[, \<time interval\>])
*
- * \<Object\>.start()
- *
- * \<Object\>.stop()
- *
* \section Description
*
- * This process when run gathers the Memory usage and CPU utilization of all the processes of a particular application at specific time interval.
+ * Start monitoring the Memory usage and CPU utilization of all the processes of the given application at specific time interval and log them to the python logger.
*
- * \section ImplementationDetails
+ * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/python/ldtputils.py
+ *
+ * \section Example
*
- * When this functionality is to be used in a python test script you need to create a new object for pstats class.
+ * If I want the resource usage of all processes related to gedit to be logged every 2 seconds, the following statements need to be incorporated in the test script
*
- * The arguments passed while instantiating this class are Application name and Time interval.
+ * @code
+ *
+ * import logging
+ * import datetime
+ * import logging.handlers
+ * from ldtp import *
+ *
+ * class LdtpCustomLog(logging.Handler):
+ * """
+ * Custom LDTP log, inherit logging.Handler and implement
+ * required API
+ * """
+ * def __init__(self, name, logfilename):
+ * # Call base handler
+ * logging.Handler.__init__(self)
+ * self.name = name
+ * self.fp = open(os.path.expanduser(logfilename), 'w')
+ *
+ * def __del__(self):
+ * if self.fp:
+ * self.fp.close()
+ *
+ * def emit(self, record):
+ * # Get the message and add to the list
+ * # Later the list element can be poped out
+ * if re.match('MEMINFO', record.levelname, re.I):
+ * level = 'Memory'
+ * elif re.match('CPUINFO', record.levelname, re.I):
+ * level = 'CPU'
+ * else:
+ * level = ''
+ * message = re.split(' - ', record.getMessage(), 1)
+ * if self.fp:
+ * self.fp.write('%s,%s,%s,%s\n' % (datetime.datetime.now().isoformat(), level,
+ * message[1], self.name))
+ *
+ * # Add LdtpCustomLog handler
+ * logging.handlers.LdtpCustomLog = LdtpCustomLog
+ * # Create instance of LdtpCustomLog handler
+ * _custom_logger = logging.handlers.LdtpCustomLog('geditTesting', '~/tmp/actual.log')
+ * # Set default log level as LDTP_LOG_MEMINFO
+ * _custom_logger.setLevel(LDTP_LOG_MEMINFO)
+ *
+ * addloghandler(_custom_logger)
+ * startlog('~/tmp/test.log', False)
+ * startprocessmonitor('gedit')
+ * _custom_logger.name = 'launchapp'
+ * launchapp('gedit')
+ *
+ * if not waittillguiexist('*-gedit'):
+ * _custom_logger.name = 'launchfailed'
+ * raise AssertionError('Gedit window does not appear')
+ *
+ * _custom_logger.name = 'settext'
+ * settextvalue('*-gedit', 'txt1', 'ICOS 2010, Taiwan')
+ *
+ * wait(1)
+ *
+ * _custom_logger.name = 'gettext'
+ * print gettextvalue('*-gedit', 'txt1')
+ *
+ * wait(1)
+ *
+ * _custom_logger.name = 'newtab'
+ * selectmenuitem('*-gedit', 'mnuFile;mnuNew')
*
- * As soon as the \<Object\>.start() method is called in the test script, memory usage and CPU utilization of the application start getting logged into the ldtp log file.
+ * wait(1)
+ *
+ * click('*-gedit', 'btnOpen')
+ * _custom_logger.name = 'dialog'
+ *
+ * if not waittillguiexist('dlgOpenFiles'):
+ * raise AssertionError('Open Files window does not appear')
+ *
+ * settextvalue('dlgOpenFiles', 'txtLocation', '/tmp/test.py')
+ *
+ * click('dlgOpenFiles', 'btnOpen')
+ *
+ * if not waittillguinotexist('dlgOpenFiles'):
+ * raise AssertionError('Open Files window still exist !')
+ *
+ * selectmenuitem('*-gedit', 'mnuFile;mnuQuit')
+ *
+ * waittillguiexist('Question')
+ * click('Question', 'Close without Saving')
+ * waittillguinotexist('Question')
+ *
+ * waittillguinotexist('*-gedit')
+ * _custom_logger.name = 'exit'
+ *
+ * stopprocessmonitor('gedit')
+ * stoplog()
+ * removeloghandler(_custom_logger)
+ *
+ * @endcode
+ *
+ * \section Dependency
+ *
+ * This functionality depends on the pystatgrab (http://www.i-scream.org/pystatgrab/) package. Make sure you have it installed before using this memory and CPU utilization gathering function in your ldtp test scripts.
+ *
+ * \author Nagappan Alagappan <nagappan@gmail.com>
+ */
+
+/** \page stopprocessmonitor stopprocessmonitor
+ * \section Syntax
+ *
+ * stopprocessmonitor(\<application name\>)
*
- * When \<Object\>.stop is called the thread gathering the information stops.
+ * \section Description
+ *
+ * Stop the Memory usage and CPU utilization monitoring of all the processes of the given application.
*
* Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/python/ldtputils.py
*
* \section Example
*
- * If I want the resource usage of all processes related to evolution to be logged every 2 seconds, the following statements need to be incorporated in the test script
+ * If I want the resource usage of all processes related to gedit to be logged every 2 seconds, the following statements need to be incorporated in the test script
+ *
+ * @code
+ *
+ * import logging
+ * import datetime
+ * import logging.handlers
+ * from ldtp import *
+ *
+ * class LdtpCustomLog(logging.Handler):
+ * """
+ * Custom LDTP log, inherit logging.Handler and implement
+ * required API
+ * """
+ * def __init__(self, name, logfilename):
+ * # Call base handler
+ * logging.Handler.__init__(self)
+ * self.name = name
+ * self.fp = open(os.path.expanduser(logfilename), 'w')
+ *
+ * def __del__(self):
+ * if self.fp:
+ * self.fp.close()
+ *
+ * def emit(self, record):
+ * # Get the message and add to the list
+ * # Later the list element can be poped out
+ * if re.match('MEMINFO', record.levelname, re.I):
+ * level = 'Memory'
+ * elif re.match('CPUINFO', record.levelname, re.I):
+ * level = 'CPU'
+ * else:
+ * level = ''
+ * message = re.split(' - ', record.getMessage(), 1)
+ * if self.fp:
+ * self.fp.write('%s,%s,%s,%s\n' % (datetime.datetime.now().isoformat(), level,
+ * message[1], self.name))
+ *
+ * # Add LdtpCustomLog handler
+ * logging.handlers.LdtpCustomLog = LdtpCustomLog
+ * # Create instance of LdtpCustomLog handler
+ * _custom_logger = logging.handlers.LdtpCustomLog('geditTesting', '~/tmp/actual.log')
+ * # Set default log level as LDTP_LOG_MEMINFO
+ * _custom_logger.setLevel(LDTP_LOG_MEMINFO)
+ *
+ * addloghandler(_custom_logger)
+ * startlog('~/tmp/test.log', False)
+ * startprocessmonitor('gedit')
+ * _custom_logger.name = 'launchapp'
+ * launchapp('gedit')
+ *
+ * if not waittillguiexist('*-gedit'):
+ * _custom_logger.name = 'launchfailed'
+ * raise AssertionError('Gedit window does not appear')
+ *
+ * _custom_logger.name = 'settext'
+ * settextvalue('*-gedit', 'txt1', 'ICOS 2010, Taiwan')
+ *
+ * wait(1)
+ *
+ * _custom_logger.name = 'gettext'
+ * print gettextvalue('*-gedit', 'txt1')
+ *
+ * wait(1)
+ *
+ * _custom_logger.name = 'newtab'
+ * selectmenuitem('*-gedit', 'mnuFile;mnuNew')
+ *
+ * wait(1)
+ *
+ * click('*-gedit', 'btnOpen')
+ * _custom_logger.name = 'dialog'
+ *
+ * if not waittillguiexist('dlgOpenFiles'):
+ * raise AssertionError('Open Files window does not appear')
*
- * xstats = pstats ('evolution', 2)
+ * settextvalue('dlgOpenFiles', 'txtLocation', '/tmp/test.py')
*
- * xstats.start ()
+ * click('dlgOpenFiles', 'btnOpen')
*
- * \<Test Script\>
+ * if not waittillguinotexist('dlgOpenFiles'):
+ * raise AssertionError('Open Files window still exist !')
*
- * xstats.stop()
+ * selectmenuitem('*-gedit', 'mnuFile;mnuQuit')
+ *
+ * waittillguiexist('Question')
+ * click('Question', 'Close without Saving')
+ * waittillguinotexist('Question')
+ *
+ * waittillguinotexist('*-gedit')
+ * _custom_logger.name = 'exit'
+ *
+ * stopprocessmonitor('gedit')
+ * stoplog()
+ * removeloghandler(_custom_logger)
+ *
+ * @endcode
*
* \section Dependency
*
* This functionality depends on the pystatgrab (http://www.i-scream.org/pystatgrab/) package. Make sure you have it installed before using this memory and CPU utilization gathering function in your ldtp test scripts.
*
- * \author Subodh Soni <subodhsoni@gmail.com>
+ * \author Nagappan Alagappan <nagappan@gmail.com>
+ */
+
+/** \page getcpustat getcpustat
+ * \section Syntax
+ *
+ * getcpustat(\<'process name'\>)
+ *
+ * \section Description
+ *
+ * Get the current CPU utilization of the given application
+ *
+ * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/python/ldtputils.py
+ *
+ * \retval Returns list of float values in percentage (CPU utilization), of all the instance of given application
+ *
+ * \section Example
+ *
+ * from ldtp import *
+ *
+ * getcpustat('chromium-browser')
+ *
+ * \author Nagappan Alagappan <nagappan@gmail.com>
+ *
+ */
+
+/** \page getmemorystat getmemorystat
+ * \section Syntax
+ *
+ * getmemorystat(\<'process name'\>)
+ *
+ * \section Description
+ *
+ * Get the current memory utilization of the given application
+ *
+ * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/python/ldtputils.py
+ *
+ * \retval Returns list of int values in MB (Memory utilization), of all the instance of given application
+ *
+ * \section Example
+ *
+ * from ldtp import *
+ *
+ * getmemorystat('chromium-browser')
+ *
+ * \author Nagappan Alagappan <nagappan@gmail.com>
+ *
*/
/** \page wait wait
@@ -5539,40 +5621,6 @@
*
*/
-/** \page launchapp2 launchapp2
- * \section Syntax
- *
- * launchapp2 ('\<application binary name\>'[, '\<application under test\>' = None[, callAut = False]])
- *
- * Calls appundertest for the user.
- *
- * Implicit call to appundertest.
- * Because:
- * * This is usually what a user mean when he calls launchapp.
- * * A newbie user could call appunder very far away from launchapp, and we don't know
- * what could be the consequences of that.
- * * Less typing.
- *
- * \section Description
- *
- * Application name specified as an argument will be launched.
- *
- * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/python/ldtputils.py
- *
- * \section Example
- *
- * from ldtp import *
- *
- * launchapp2 ('file-roller')
- *
- * launchapp ('file-roller', callAut = True)
- *
- * launchapp2 ('gedit', 'gedit', callAut = True)
- *
- * \author Sandro Millien <msp@lloedy.com>
- *
- */
-
/** \page getactivewin getactivewin
* \section Syntax
*
@@ -6101,7 +6149,7 @@
*
* \section Description
*
- *
+ * Tries to grab focus of the object, then move the mouse to the center of object and does a left click
*
* \retval Returns 1 on success, LdtpExecutionError exception will be thrown on failure
*
@@ -6109,7 +6157,7 @@
*
* \section Example
*
- * \todo
+ * mouseleftclick('*-gedit', 'btnOpen')
*
* \author Prashanth Mohan <prashmohan@gmail.com>
*
@@ -6122,7 +6170,7 @@
*
* \section Description
*
- *
+ * Tries to grab focus of the object, then move the mouse to the center of object and does a right click
*
* \retval Returns 1 on success, LdtpExecutionError exception will be thrown on failure
*
@@ -6130,7 +6178,7 @@
*
* \section Example
*
- * \todo
+ * mouserightclick('*-gedit', 'txt1')
*
* \author Prashanth Mohan <prashmohan@gmail.com>
*
@@ -6143,7 +6191,7 @@
*
* \section Description
*
- *
+ * Tries to grab focus of the object, then move the mouse to the center of object
*
* \retval Returns 1 on success, LdtpExecutionError exception will be thrown on failure
*
@@ -6151,12 +6199,33 @@
*
* \section Example
*
- * \todo
+ * mousemove('*-gedit', 'btnOpen')
*
* \author Prashanth Mohan <prashmohan@gmail.com>
*
*/
+/** \page simulatemousemove simulatemousemove
+ * \section Syntax
+ *
+ * simulatemousemove(\<source_x\>, \<source_y\>, \<dest_x\>, \<dest_y\>[, delay = 0.0])
+ *
+ * \section Description
+ *
+ * Simulate the mouse move, as if the user is moving from source to destination
+ *
+ * \retval Returns 1 on success, LdtpExecutionError exception will be thrown on failure
+ *
+ * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/src/device.c
+ *
+ * \section Example
+ *
+ * mousemove(0, 0, 100, 100)
+ *
+ * \author Nagappan Alagappan <nagappan@gmail.com>
+ *
+ */
+
/** \page enterstring enterstring
* \section Syntax
*
@@ -6496,29 +6565,6 @@
*
*/
-/** \page stopscriptengine stopscriptengine
- * \section Syntax
- *
- * stopscriptengine ()
- *
- * \section Description
- *
- * Stops the LDTP engine, free all the resources. If we want to stop LDTP service, we can use this function to silently die.
- *
- * \retval None
- *
- * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/src/client-handler.c
- *
- * \section Example
- *
- * from ldtp import *
- *
- * stopscriptengine ()
- *
- * \author Nagappan Alagappan <nagappan@gmail.com>
- *
- */
-
/** \page hasstate hasstate
* \section Syntax
*
@@ -6565,7 +6611,7 @@
*
* \section Example
*
- * \todo
+ * press('*-gedit', 'btnFind')
*
* \author Rodney Dawes <dobey@novell.com>
*
@@ -6586,7 +6632,7 @@
*
* \section Example
*
- * \todo
+ * objectexist('*-gedit', 'btnFind')
*
* \author Rodney Dawes <dobey@novell.com>
*
@@ -6657,3 +6703,125 @@
* \author Nagappan Alagappan <nagappan@gmail.com>
*
*/
+
+/** \page registerevent registerevent
+ * \section Syntax
+ *
+ * registerevent(\<'event_name'\>, \<fn_name\>[, *args])
+ *
+ * \section Description
+ *
+ * Register user defined window event
+ *
+ * \retval 1 on success, 0 on failure
+ *
+ * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/python/ldtp.py
+ *
+ * \section Example
+ *
+ * @code
+ * from ldtp import *
+ * import threading
+ *
+ * callbackRunning = threading.Event()
+ * callbackRunning.clear()
+ * callbackState = threading.Event()
+ * callbackState.clear()
+ *
+ * def cb():
+ * callbackState.set()
+ * waittillguiexist('dlgReplace')
+ * click('dlgReplace', 'btnClose')
+ * callbackState.clear()
+ * callbackRunning.set()
+ * print 'callbackend'
+ *
+ * def cbwithvarargs(*args):
+ * for arg in args:
+ * print arg
+ * print 'callbackend'
+ *
+ * registerevent('window:create', cb)
+ * registerevent('window:destroy', cbwithvarargs, 'test', 'var', 'args')
+ *
+ * click('*gedit', 'btnReplace')
+ * click('*gedit', 'btnOpen')
+ *
+ * waittillguiexist('dlgOpenFiles')
+ * click('dlgOpenFiles', 'btnCancel')
+ *
+ * if callbackState.isSet():
+ * print 'Waiting for callback to complete'
+ * callbackRunning.wait()
+ * print 'callbackset'
+ *
+ * print 'test end'
+ * deregisterevent('window:create')
+ * deregisterevent('window:destroy')
+ *
+ * @endcode
+ *
+ * \author Nagappan Alagappan <nagappan@gmail.com>
+ *
+ */
+
+/** \page deregisterevent deregisterevent
+ * \section Syntax
+ *
+ * deregisterevent(\<'event_name'\>)
+ *
+ * \section Description
+ *
+ * Register user defined window event
+ *
+ * \retval 1 on success, 0 on failure
+ *
+ * Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/python/ldtp.py
+ *
+ * \section Example
+ *
+ * @code
+ * from ldtp import *
+ * import threading
+ *
+ * callbackRunning = threading.Event()
+ * callbackRunning.clear()
+ * callbackState = threading.Event()
+ * callbackState.clear()
+ *
+ * def cb():
+ * callbackState.set()
+ * waittillguiexist('dlgReplace')
+ * click('dlgReplace', 'btnClose')
+ * callbackState.clear()
+ * callbackRunning.set()
+ * print 'callbackend'
+ *
+ * def cbwithvarargs(*args):
+ * for arg in args:
+ * print arg
+ * print 'callbackend'
+ *
+ * registerevent('window:create', cb)
+ * registerevent('window:destroy', cbwithvarargs, 'test', 'var', 'args')
+ *
+ * click('*gedit', 'btnReplace')
+ * click('*gedit', 'btnOpen')
+ *
+ * waittillguiexist('dlgOpenFiles')
+ * click('dlgOpenFiles', 'btnCancel')
+ *
+ * if callbackState.isSet():
+ * print 'Waiting for callback to complete'
+ * callbackRunning.wait()
+ * print 'callbackset'
+ *
+ * print 'test end'
+ * deregisterevent('window:create')
+ * deregisterevent('window:destroy')
+ *
+ * @endcode
+ *
+ * \author Nagappan Alagappan <nagappan@gmail.com>
+ *
+ */