UNPKG

ti-appium

Version:

An Appium wrapper to test Titanium applications

3,729 lines (863 loc) 40.7 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Global</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2></h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Members</h3> <h4 class="name" id="getSimState"><span class="type-signature"></span>getSimState<span class="type-signature"></span></h4> <div class="description"> Get the boot status of an iOS simulator via its UDID </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line249">line 249</a> </li></ul></dd> </dl> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="appcRun"><span class="type-signature"></span>appcRun<span class="signature">(args, matcher)</span><span class="type-signature"></span></h4> <div class="description"> Build a specified application for a given platform. Also allows users to specify their own arguments </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Arguments to be run after calling appc</td> </tr> <tr> <td class="name"><code>matcher</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">A function that can be used to resolve</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line83">line 83</a> </li></ul></dd> </dl> <h4 class="name" id="appcSetup"><span class="type-signature"></span>appcSetup<span class="signature">(conf, args)</span><span class="type-signature"></span></h4> <div class="description"> Configure the environment with the required SDK and CLI for the Test run </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>conf</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">Object for Appc setup <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>username</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Appcelerator user to login with</td> </tr> <tr> <td class="name"><code>password</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Appcelerator password to authenticate</td> </tr> <tr> <td class="name"><code>organisation</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The org you want to log in to</td> </tr> <tr> <td class="name"><code>cli</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The Appcelerator CLI version to use</td> </tr> <tr> <td class="name"><code>sdk</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The SDK version or branch to build with</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">Arguments <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>force</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last">Whether or not to force re-install the SDK</td> </tr> <tr> <td class="name"><code>ti</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last">Whether or not to use the titanium CLI over appc</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line141">line 141</a> </li></ul></dd> </dl> <h4 class="name" id="banner"><span class="type-signature"></span>banner<span class="signature">(message)</span><span class="type-signature"></span></h4> <div class="description"> Creates a banner and a green info tag around a message. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">String to be enclosed by the banner</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line64">line 64</a> </li></ul></dd> </dl> <h4 class="name" id="buildApp"><span class="type-signature"></span>buildApp<span class="signature">(dir, platform, args)</span><span class="type-signature"></span></h4> <div class="description"> Build a specified application for a given platform. Also allows users to specify their own arguments. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>dir</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The path to the application root</td> </tr> <tr> <td class="name"><code>platform</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The mobile OS the app is being built for</td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last">Any additional arguments to be passed to the command</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line94">line 94</a> </li></ul></dd> </dl> <h4 class="name" id="createAppPath"><span class="type-signature"></span>createAppPath<span class="signature">(sdk)</span><span class="type-signature"></span></h4> <div class="description"> Generate a path to the built application based upon platform </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>sdk</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The version or branch of the SDK to validate</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line106">line 106</a> </li></ul></dd> </dl> <h4 class="name" id="debug"><span class="type-signature"></span>debug<span class="signature">(message)</span><span class="type-signature"></span></h4> <div class="description"> Outputs a message when the debug flag is used. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">String to be output</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line46">line 46</a> </li></ul></dd> </dl> <h4 class="name" id="error"><span class="type-signature"></span>error<span class="signature">(message)</span><span class="type-signature"></span></h4> <div class="description"> Outputs all of a string in red. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">String to be output</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line37">line 37</a> </li></ul></dd> </dl> <h4 class="name" id="finish"><span class="type-signature"></span>finish<span class="signature">(done, value)</span><span class="type-signature"></span></h4> <div class="description"> Writes a green done to the console and resolves the promise if passed. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>done</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Promise callback passed from the function</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">An object to be returned with resolve</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line73">line 73</a> </li></ul></dd> </dl> <h4 class="name" id="getCert"><span class="type-signature"></span>getCert<span class="signature">(type, search)</span><span class="type-signature"></span></h4> <div class="description"> Use ioslib to probe the machine for a particular iOS certificate, then return the certificate object. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The type of operation the cert is defined for</td> </tr> <tr> <td class="name"><code>search</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Part of the cert name, used to help locate it</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line251">line 251</a> </li></ul></dd> </dl> <h4 class="name" id="getProfile"><span class="type-signature"></span>getProfile<span class="signature">(type, search)</span><span class="type-signature"></span></h4> <div class="description"> Use ioslib to probe the machine for a particular iOS provisioning profile, then return the provisioning profile object. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The type of operation the pp is defined for</td> </tr> <tr> <td class="name"><code>search</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Part of the pp name, used to help locate it</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line262">line 262</a> </li></ul></dd> </dl> <h4 class="name" id="info"><span class="type-signature"></span>info<span class="signature">(message)</span><span class="type-signature"></span></h4> <div class="description"> Writes a message with a green info tag (note no new line is passed by default). </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">A string to be output after the info tag</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line7">line 7</a> </li></ul></dd> </dl> <h4 class="name" id="killEmulator"><span class="type-signature"></span>killEmulator<span class="signature">(deviceName)</span><span class="type-signature"></span></h4> <div class="description"> Kill all the Android emulators. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>deviceName</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The name of the Android device to kill</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line227">line 227</a> </li></ul></dd> </dl> <h4 class="name" id="killSimulator"><span class="type-signature"></span>killSimulator<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Kill all the iOS simulators using the killall command </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line236">line 236</a> </li></ul></dd> </dl> <h4 class="name" id="parseSDK"><span class="type-signature"></span>parseSDK<span class="signature">(dir, platform, appName)</span><span class="type-signature"></span></h4> <div class="description"> Takes in an SDK identifier and attempts to resolve it to the applicable SDK version. Can take a release version, pre-release version, or branch identifier and attempts to resolve it to an installable identifier. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>dir</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The path to the root of the application project</td> </tr> <tr> <td class="name"><code>platform</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The relevant mobile OS</td> </tr> <tr> <td class="name"><code>appName</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The name of the app to identify the app package</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line115">line 115</a> </li></ul></dd> </dl> <h4 class="name" id="skip"><span class="type-signature"></span>skip<span class="signature">(done, value)</span><span class="type-signature"></span></h4> <div class="description"> Writes a yellow skip to the console and resolves the promise if passed. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>done</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Promise callback passed from the function</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">An object to be returned with resolve</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line27">line 27</a> </li></ul></dd> </dl> <h4 class="name" id="startAppium"><span class="type-signature"></span>startAppium<span class="signature">(modRoot, args)</span><span class="type-signature"></span></h4> <div class="description"> Launch an Appium server for the mobile testing, as it cannot use the desktop session. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>modRoot</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The path to the root of the project being tested</td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">Arguments <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>hostname</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The address of the Appium server to connect to</td> </tr> <tr> <td class="name"><code>port</code></td> <td class="type"> <span class="param-type">Int</span> </td> <td class="description last">The port of the server that the Appium server is running on</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line178">line 178</a> </li></ul></dd> </dl> <h4 class="name" id="startClient"><span class="type-signature"></span>startClient<span class="signature">(capabilities)</span><span class="type-signature"></span></h4> <div class="description"> Starts a WD session on the device, using the given capability requirements as Appium configuration. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>capabilities</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">Desired capabilities for Appium to run with</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line191">line 191</a> </li></ul></dd> </dl> <h4 class="name" id="step"><span class="type-signature"></span>step<span class="signature">(message)</span><span class="type-signature"></span></h4> <div class="description"> Writes a message with a green info tag (note no new line is passed by default). </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">A string to be output after the info tag</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line17">line 17</a> </li></ul></dd> </dl> <h4 class="name" id="stopAppium"><span class="type-signature"></span>stopAppium<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Tells the Appium server to shut down </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line163">line 163</a> </li></ul></dd> </dl> <h4 class="name" id="stopClient"><span class="type-signature"></span>stopClient<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Stops the WD session, but first it closes and removes the app from the device in an attempt to save storage space. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line170">line 170</a> </li></ul></dd> </dl> <h4 class="name" id="test"><span class="type-signature"></span>test<span class="signature">(dir, modRoot, opts)</span><span class="type-signature"></span></h4> <div class="description"> Launch the Mocha test run on the collected files </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>dir</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The directory containing the test files</td> </tr> <tr> <td class="name"><code>modRoot</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The root of the project being run</td> </tr> <tr> <td class="name"><code>opts</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">Optional Arguments <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>timeout</code></td> <td class="type"> <span class="param-type">Int</span> </td> <td class="description last">Timeout threshold for Mocha tests</td> </tr> <tr> <td class="name"><code>slow</code></td> <td class="type"> <span class="param-type">Int</span> </td> <td class="description last">Slow threshold for Mocha tests</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line210">line 210</a> </li></ul></dd> </dl> <h4 class="name" id="warn"><span class="type-signature"></span>warn<span class="signature">(message)</span><span class="type-signature"></span></h4> <div class="description"> Outputs a message when the warn flag is used. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">String to be output</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line55">line 55</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="WebDriverCommands.html">WebDriverCommands</a></li></ul><h3>Classes</h3><ul><li><a href="Appc_Helper.html">Appc_Helper</a></li><li><a href="Appium_Helper.html">Appium_Helper</a></li><li><a href="Device_Helper.html">Device_Helper</a></li><li><a href="Mocha_Helper.html">Mocha_Helper</a></li><li><a href="Output_Helper.html">Output_Helper</a></li><li><a href="Webdriver_Helper.html">Webdriver_Helper</a></li></ul><h3>Global</h3><ul><li><a href="global.html#appcRun">appcRun</a></li><li><a href="global.html#appcSetup">appcSetup</a></li><li><a href="global.html#banner">banner</a></li><li><a href="global.html#buildApp">buildApp</a></li><li><a href="global.html#createAppPath">createAppPath</a></li><li><a href="global.html#debug">debug</a></li><li><a href="global.html#error">error</a></li><li><a href="global.html#finish">finish</a></li><li><a href="global.html#getCert">getCert</a></li><li><a href="global.html#getProfile">getProfile</a></li><li><a href="global.html#getSimState">getSimState</a></li><li><a href="global.html#info">info</a></li><li><a href="global.html#killEmulator">killEmulator</a></li><li><a href="global.html#killSimulator">killSimulator</a></li><li><a href="global.html#parseSDK">parseSDK</a></li><li><a href="global.html#skip">skip</a></li><li><a href="global.html#startAppium">startAppium</a></li><li><a href="global.html#startClient">startClient</a></li><li><a href="global.html#step">step</a></li><li><a href="global.html#stopAppium">stopAppium</a></li><li><a href="global.html#stopClient">stopClient</a></li><li><a href="global.html#test">test</a></li><li><a href="global.html#warn">warn</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Fri Aug 28 2020 10:09:07 GMT+0100 (British Summer Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>