UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

162 lines (121 loc) 5.56 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js">/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ <span id='Siesta-Project-Browser-SenchaTouch'>/** </span>@class Siesta.Project.Browser.SenchaTouch @extends Siesta.Project.Browser @mixin Siesta.Project.Browser.ExtJSCore A Class representing the browser project. This class provides a web-based UI and defines some additional configuration options. The default value of the `testClass` configuration option in this class is {@link Siesta.Test.SenchaTouch}, which inherits from {@link Siesta.Test.Browser} and contains various Sencha Touch-specific assertions. Use this project class when testing Sencha Touch applications. * **Note** Make sure, you&#39;ve checked the {@link #performSetup} configuration option. This file is for reference only, for a getting start guide and manual, please refer to &lt;a href=&quot;#!/guide/getting_started_browser&quot;&gt;Siesta getting started in browser environment&lt;/a&gt; guide. Synopsys ======== var project = new Siesta.Project.Browser.SenchaTouch(); project.configure({ title : &#39;Awesome Sencha Touch Application Test Suite&#39;, transparentEx : true, preload : [ &quot;http://cdn.sencha.io/ext-4.0.2a/ext-all-debug.js&quot;, &quot;../awesome-project-all.js&quot; ] }) project.plan( // simple string - url relative to project file &#39;sanity.t.js&#39;, // test file descriptor with own configuration options { url : &#39;basic.t.js&#39;, // replace `preload` option of project preload : [ &quot;http://cdn.sencha.io/ext-4.0.6/ext-all-debug.js&quot;, &quot;../awesome-project-all.js&quot; ] }, // groups (&quot;folders&quot;) of test files (possibly with own options) { group : &#39;Sanity&#39;, autoCheckGlobals : false, items : [ &#39;data/crud.t.js&#39;, ... ] }, ... ) */ Class(&#39;Siesta.Project.Browser.SenchaTouch&#39;, { isa: Siesta.Project.Browser, does : [ Siesta.Project.Browser.ExtJSCore ], has : { <span id='Siesta-Project-Browser-SenchaTouch-cfg-testClass'> /** </span> * @cfg {Class} testClass The test class which will be used for creating test instances, defaults to {@link Siesta.Test.SenchaTouch}. * You can subclass {@link Siesta.Test.SenchaTouch} and provide a new class. * * This option can be also specified in the test file descriptor. */ testClass : Siesta.Test.SenchaTouch, <span id='Siesta-Project-Browser-SenchaTouch-cfg-transparentEx'> /** </span> * @cfg {Boolean} transparentEx */ transparentEx : true, keepNLastResults : 0, <span id='Siesta-Project-Browser-SenchaTouch-cfg-performSetup'> /** </span> * @cfg {Boolean} performSetup When set to `true`, Siesta will perform a `Ext.setup()` call, so you can safely assume there&#39;s a viewport for example. * If, however your test code, performs `Ext.setup()` itself, you need to disable this option. * * If this option is not explicitly specified in the test descritor, but instead inherited, it will be automatically disabled if test has {@link #pageUrl} value. * * This option can be also specified in the test file descriptor. */ performSetup : true, forcedRunCore : &#39;sequential&#39;, isRunningOnMobile : true, contentManagerClass : Siesta.Content.Manager.Browser.ExtJSCore }, methods: { setup : function () { // TODO fix proper mobile detection, since Ext may be absent in &quot;no-ui&quot; project this.isRunningOnMobile = typeof Ext !== &#39;undefined&#39; &amp;&amp; Ext.getVersion &amp;&amp; Ext.getVersion(&#39;touch&#39;) if (!this.isRunningOnMobile) this.keepNLastResults = 2 this.SUPERARG(arguments) }, getNewTestConfiguration: function (desc, scopeProvider, contentManager, launchState) { var config = this.SUPERARG(arguments) var pageUrl = this.getDescriptorConfig(desc, &#39;pageUrl&#39;); if (!desc.hasOwnProperty(&#39;performSetup&#39;) &amp;&amp; pageUrl) { config.performSetup = false; } else { config.performSetup = this.getDescriptorConfig(desc, &#39;performSetup&#39;) } return config } } }) // backward compat Class(&#39;Siesta.Harness.Browser.SenchaTouch&#39;, { isa : Siesta.Project.Browser.SenchaTouch })</pre> </body> </html>