UNPKG

siesta-lite

Version:

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

1 lines 54.5 kB
Ext.data.JsonP.Siesta_Test_More({"tagname":"class","name":"Siesta.Test.More","autodetected":{},"files":[{"filename":"More.js","href":"More.html#Siesta-Test-More"}],"members":[{"name":"waitForTimeout","tagname":"cfg","owner":"Siesta.Test.More","id":"cfg-waitForTimeout","meta":{}},{"name":"chain","tagname":"method","owner":"Siesta.Test.More","id":"method-chain","meta":{}},{"name":"chainForArray","tagname":"method","owner":"Siesta.Test.More","id":"method-chainForArray","meta":{}},{"name":"expectGlobals","tagname":"method","owner":"Siesta.Test.More","id":"method-expectGlobals","meta":{}},{"name":"isApprox","tagname":"method","owner":"Siesta.Test.More","id":"method-isApprox","meta":{}},{"name":"isArray","tagname":"method","owner":"Siesta.Test.More","id":"method-isArray","meta":{}},{"name":"isBoolean","tagname":"method","owner":"Siesta.Test.More","id":"method-isBoolean","meta":{}},{"name":"isDate","tagname":"method","owner":"Siesta.Test.More","id":"method-isDate","meta":{}},{"name":"isDeeply","tagname":"method","owner":"Siesta.Test.More","id":"method-isDeeply","meta":{}},{"name":"isDeeplyStrict","tagname":"method","owner":"Siesta.Test.More","id":"method-isDeeplyStrict","meta":{}},{"name":"isFunction","tagname":"method","owner":"Siesta.Test.More","id":"method-isFunction","meta":{}},{"name":"isGreater","tagname":"method","owner":"Siesta.Test.More","id":"method-isGreater","meta":{}},{"name":"isGreaterOrEqual","tagname":"method","owner":"Siesta.Test.More","id":"method-isGreaterOrEqual","meta":{}},{"name":"isInstanceOf","tagname":"method","owner":"Siesta.Test.More","id":"method-isInstanceOf","meta":{}},{"name":"isLess","tagname":"method","owner":"Siesta.Test.More","id":"method-isLess","meta":{}},{"name":"isLessOrEqual","tagname":"method","owner":"Siesta.Test.More","id":"method-isLessOrEqual","meta":{}},{"name":"isNumber","tagname":"method","owner":"Siesta.Test.More","id":"method-isNumber","meta":{}},{"name":"isObject","tagname":"method","owner":"Siesta.Test.More","id":"method-isObject","meta":{}},{"name":"isRegExp","tagname":"method","owner":"Siesta.Test.More","id":"method-isRegExp","meta":{}},{"name":"isString","tagname":"method","owner":"Siesta.Test.More","id":"method-isString","meta":{}},{"name":"like","tagname":"method","owner":"Siesta.Test.More","id":"method-like","meta":{}},{"name":"livesOk","tagname":"method","owner":"Siesta.Test.More","id":"method-livesOk","meta":{}},{"name":"throwsOk","tagname":"method","owner":"Siesta.Test.More","id":"method-throwsOk","meta":{}},{"name":"unlike","tagname":"method","owner":"Siesta.Test.More","id":"method-unlike","meta":{}},{"name":"verifyGlobals","tagname":"method","owner":"Siesta.Test.More","id":"method-verifyGlobals","meta":{}},{"name":"waitFor","tagname":"method","owner":"Siesta.Test.More","id":"method-waitFor","meta":{}},{"name":"waitForFn","tagname":"method","owner":"Siesta.Test.More","id":"method-waitForFn","meta":{}},{"name":"waitForMs","tagname":"method","owner":"Siesta.Test.More","id":"method-waitForMs","meta":{}}],"alternateClassNames":[],"aliases":{},"id":"class-Siesta.Test.More","short_doc":"A mixin with additional generic assertion methods, which can work cross-platform between browsers and NodeJS. ...","component":false,"superclasses":[],"subclasses":[],"mixedInto":["Siesta.Test"],"mixins":[],"parentMixins":[],"requires":[],"uses":[],"html":"<div><pre class=\"hierarchy\"><h4>Mixed into</h4><div class='dependency'><a href='#!/api/Siesta.Test' rel='Siesta.Test' class='docClass'>Siesta.Test</a></div><h4>Files</h4><div class='dependency'><a href='source/More.html#Siesta-Test-More' target='_blank'>More.js</a></div></pre><div class='doc-contents'><p>A mixin with additional generic assertion methods, which can work cross-platform between browsers and NodeJS.\nIs being consumed by <a href=\"#!/api/Siesta.Test\" rel=\"Siesta.Test\" class=\"docClass\">Siesta.Test</a>, so all of them are available in all tests.</p>\n</div><div class='members'><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-cfg'>Config options</h3><div class='subsection'><div id='cfg-waitForTimeout' class='member first-child not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-cfg-waitForTimeout' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-cfg-waitForTimeout' class='name expandable'>waitForTimeout</a> : Number<span class=\"signature\"></span></div><div class='description'><div class='short'>Default timeout for waitFor (in milliseconds). ...</div><div class='long'><p>Default timeout for <code>waitFor</code> (in milliseconds). Default value is 10000.</p>\n<p>Defaults to: <code>10000</code></p></div></div></div></div></div><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-method'>Methods</h3><div class='subsection'><div id='method-chain' class='member first-child not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-chain' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-chain' class='name expandable'>chain</a>( <span class='pre'>step1, step2, stepN</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This method accepts a variable number of steps, either as individual arguments or as a single array containing them. ...</div><div class='long'><p>This method accepts a variable number of steps, either as individual arguments or as a single array containing them. Steps and arrays\nof steps are handled just fine, and any step-arrays passed will be flattened. Each step should be either a function or configuration\nobject for <a href=\"#!/api/Siesta.Test.Action\" rel=\"Siesta.Test.Action\" class=\"docClass\">test actions</a>. These functions / actions will be executed in order.</p>\n\n<p>1) For a function step, it will receive a callback as the 1st argument, to call when the step is completed.\nAs the 2nd and further arguments, the step function will receive the arguments passed to the previous callback.</p>\n\n<p>If a function step returns a promise, it should not call the callback, but instead Siesta will wait until the promise returned is\nresolved / rejected. This plays nicely with the <code>async/await</code> functions:</p>\n\n<pre><code>let someAsyncOperation =\n t =&gt; new Promise((resolve, reject) =&gt; {\n setTimeout(() =&gt; { resolve(\"someValue\") }, 300)\n })\n\nt.it('Doing async stuff', t =&gt; {\n t.chain(\n // function step, that returns a promise (sugared with async/await)\n async () =&gt; {\n return await someAsyncOperation(t)\n },\n // desugared version\n function (next, result) {\n return someAsyncOperation(t)\n }\n )\n})\n</code></pre>\n\n<p>The last step will receive a no-op callback, which can be ignored or still called. <strong>Note</strong>, that last step is assumed to\ncomplete synchronously! If you need to launch some asynchronous process in the last step, you may need to add another empty function step\nto the end of the chain.</p>\n\n<p>2) For <code><a href=\"#!/api/Siesta.Test.Action\" rel=\"Siesta.Test.Action\" class=\"docClass\">Siesta.Test.Action</a></code> objects, the callback will be called by the action class automatically,\nthere's no need to provide any callback manually. The configuration object should contain an \"action\" property, specifying the action class\nalong with other config options depending on the action class. For brevity, instead of using the \"action\" property, the configuration\nobject can contain the property corresponding to the action name itself, with the action's target (or even a test method with arguments).\nSee the following examples and also refer to the documentation of the action classes.</p>\n\n<p>If the configuration object will contain a <code>desc</code> property, a passing assertion with its value will be added to the test, after this step has completed.</p>\n\n<p>3) If a step is a sub test instance, created with getSubTest method, then the step will launch it.</p>\n\n<p>It's better to see how it works in action. For example, when using using only functions:</p>\n\n<pre><code>t.chain(\n // function receives a callback as 1st argument\n function (next) {\n // we pass that callback to the \"click\" method\n t.click(buttonEl, next)\n },\n function (next) {\n t.type(fieldEl, 'Something', next)\n },\n function (next) {\n t.is(fieldEl.value == 'Something', 'Correct value in the field')\n\n // call the callback with some arguments\n next('foo', 'bar')\n },\n // those arguments are now available as arguments of next step\n function (next, value1, value2) {\n t.is(value1, 'foo', 'The arguments for the callback are translated to the arguments of the step')\n t.is(value2, 'bar', 'The arguments for the callback are translated to the arguments of the step')\n }\n)\n</code></pre>\n\n<p>The same example, using action configuration objects for first 2 steps. For the list of available actions\nplease refer to the classes in the <code><a href=\"#!/api/Siesta.Test.Action\" rel=\"Siesta.Test.Action\" class=\"docClass\">Siesta.Test.Action</a></code> namespace.</p>\n\n<pre><code>t.chain(\n {\n action : 'click',\n target : buttonEl,\n desc : \"Clicked on the button\"\n },\n // or\n {\n click : buttonEl,\n desc : \"Clicked on the button\"\n },\n\n {\n action : 'type',\n target : fieldEl,\n text : 'Something',\n desc : \"Typed in the field\"\n },\n // or\n {\n type : 'Something',\n target : fieldEl,\n desc : \"Typed in the field\"\n },\n\n {\n waitFor : 'Selector',\n args : '.selector'\n }\n // or, using <a href=\"#!/api/Siesta.Test.Action.MethodCall\" rel=\"Siesta.Test.Action.MethodCall\" class=\"docClass\">Siesta.Test.Action.MethodCall</a> notation:\n {\n waitForSelector : '.selector'\n }\n\n function (next) {\n t.is(fieldEl.value == 'Something', 'Correct value in the field')\n\n next('foo', 'bar')\n },\n ...\n)\n</code></pre>\n\n<p>Please note, that by default, each step is expected to complete within the <a href=\"#!/api/Siesta.Project-cfg-defaultTimeout\" rel=\"Siesta.Project-cfg-defaultTimeout\" class=\"docClass\">Siesta.Project.defaultTimeout</a> time.\nYou can change this with the <code>timeout</code> property of the step configuration object, allowing some steps to last longer.\nSteps with sub-tests are expected to complete within <a href=\"#!/api/Siesta.Project-cfg-subTestTimeout\" rel=\"Siesta.Project-cfg-subTestTimeout\" class=\"docClass\">Siesta.Project.subTestTimeout</a>.</p>\n\n<p>In a special case, <code>action</code> property of the step configuration object can be a function. In this case you can also\nprovide a <code>timeout</code> property, otherwise this case is identical to using functions:</p>\n\n<pre><code>t.chain(\n {\n action : function (next) { ... },\n // allow 50s for the function to call \"next\" before step will be considered timed-out\n timeout : 50000\n },\n ...\n)\n</code></pre>\n\n<p> <strong>Tip</strong>:</p>\n\n<p> If a step is presented with a <code>null</code> or <code>undefined</code> value it will be ignored. Additionally, a step can be\n an array of steps - all arrays passed to t.chain will be flattened.</p>\n\n<p> These tips allows us to implement conditional steps processing, like this:</p>\n\n<pre><code>var el1IsInDom = t.$('.some-class1')[ 0 ]\nvar el2IsInDom = t.$('.some-class2')[ 0 ]\n\nt.chain(\n { click : '.some-other-el' },\n\n el1IsInDom ? [\n { click : el1IsInDom },\n\n el2IsInDom ? [\n { click : el1IsInDom }\n ] : null,\n ] : null,\n\n ...\n)\n</code></pre>\n\n<p> See also : <a href=\"#!/api/Siesta.Test.More-method-chainForArray\" rel=\"Siesta.Test.More-method-chainForArray\" class=\"docClass\">chainForArray</a>.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>step1</span> : Function/Object/Array<div class='sub-desc'><p>The function to execute or action configuration, or an array of steps</p>\n</div></li><li><span class='pre'>step2</span> : Function/Object<div class='sub-desc'><p>The function to execute or action configuration</p>\n</div></li><li><span class='pre'>stepN</span> : Function/Object<div class='sub-desc'><p>The function to execute or action configuration</p>\n</div></li></ul><h3 class='pa'>Fires</h3><ul><li>maxtimeoutchanged</li></ul></div></div></div><div id='method-chainForArray' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-chainForArray' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-chainForArray' class='name expandable'>chainForArray</a>( <span class='pre'>array, generator, [callback]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This is a wrapper around the chain method, which allows you to run the chain over the steps, generated from the eleme...</div><div class='long'><p>This is a wrapper around the <a href=\"#!/api/Siesta.Test.More-method-chain\" rel=\"Siesta.Test.More-method-chain\" class=\"docClass\">chain</a> method, which allows you to run the chain over the steps, generated from the elements\nof some array. For example, if in some step of outer chain, we need to click the elements with ids, given as the array, we can do:</p>\n\n<pre><code>function (next) {\n var ids = [ 'button-1', 'button-2', 'button-3' ]\n\n t.chainForArray(ids, function (elId) {\n return { click : '#' + elId }\n }, next)\n}\n</code></pre>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>array</span> : Array<div class='sub-desc'><p>An array with arbitrary elements</p>\n</div></li><li><span class='pre'>generator</span> : Function<div class='sub-desc'><p>A function, which will be called for every element of the <code>array</code>. It should return\na chain step, generated from that element. This function can return an array of steps as well. If generator will return <code>null</code> or\n<code>undefined</code> nothing will be added to the chain.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>el</span> : Function<div class='sub-desc'><p>An element of the <code>array</code></p>\n</div></li><li><span class='pre'>index</span> : Function<div class='sub-desc'><p>An index of the element</p>\n</div></li></ul></div></li><li><span class='pre'>callback</span> : Function (optional)<div class='sub-desc'><p>A function to call, once the chain is completed.</p>\n</div></li></ul><h3 class='pa'>Fires</h3><ul><li>maxtimeoutchanged</li></ul></div></div></div><div id='method-expectGlobals' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-expectGlobals' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-expectGlobals' class='name expandable'>expectGlobals</a>( <span class='pre'>name1, name2, nameN</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This method accepts a variable number of names of expected properties in the global scope. ...</div><div class='long'><p>This method accepts a variable number of names of expected properties in the global scope. When verifying the globals with <a href=\"#!/api/Siesta.Test.More-method-verifyGlobals\" rel=\"Siesta.Test.More-method-verifyGlobals\" class=\"docClass\">verifyGlobals</a>\nassertions, the expected gloabls will not be counted as failed assertions.</p>\n\n<p>This method has a synonym with singular name: <code>expectGlobal</code></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>name1</span> : String/RegExp<div class='sub-desc'><p>The name of global property or the regular expression to match several properties</p>\n</div></li><li><span class='pre'>name2</span> : String/RegExp<div class='sub-desc'><p>The name of global property or the regular expression to match several properties</p>\n</div></li><li><span class='pre'>nameN</span> : String/RegExp<div class='sub-desc'><p>The name of global property or the regular expression to match several properties</p>\n</div></li></ul></div></div></div><div id='method-isApprox' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isApprox' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isApprox' class='name expandable'>isApprox</a>( <span class='pre'>value1, value2, threshold, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion suppose to compare the numeric values. ...</div><div class='long'><p>This assertion suppose to compare the numeric values. It passes when the passed values are approximately the same (the difference\nis withing a threshold). A threshold can be provided explicitly (when assertion is called with 4 arguments),\nor it will be set to 5% from the 1st value (when calling assertion with 3 arguments).</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value1</span> : Number<div class='sub-desc'><p>The 1st value to compare</p>\n</div></li><li><span class='pre'>value2</span> : Number<div class='sub-desc'><p>The 2nd value to compare</p>\n</div></li><li><span class='pre'>threshold</span> : Number<div class='sub-desc'><p>The maximum allowed difference between values. This argument can be omitted.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isArray' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isArray' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isArray' class='name expandable'>isArray</a>( <span class='pre'>value, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, if supplied value is an Array ...</div><div class='long'><p>This assertion passes, if supplied value is an Array</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isBoolean' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isBoolean' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isBoolean' class='name expandable'>isBoolean</a>( <span class='pre'>value, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, if supplied value is a Boolean. ...</div><div class='long'><p>This assertion passes, if supplied value is a Boolean.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isDate' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isDate' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isDate' class='name expandable'>isDate</a>( <span class='pre'>value, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, if supplied value is a Date. ...</div><div class='long'><p>This assertion passes, if supplied value is a Date.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isDeeply' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isDeeply' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isDeeply' class='name expandable'>isDeeply</a>( <span class='pre'>obj1, obj2, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes when in-depth comparison of 1st and 2nd arguments (which are assumed to be JSON objects) shows ...</div><div class='long'><p>This assertion passes when in-depth comparison of 1st and 2nd arguments (which are assumed to be JSON objects) shows that they are equal.\nComparison is performed with '==' operator, so <code>[ 1 ]</code> and `[ \"1\" ] objects will be equal. The objects should not contain cyclic references.</p>\n\n<p>This method works correctly with the <em>placeholders</em> generated with method any.</p>\n\n<p>This method has a synonym: <code>is_deeply</code></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>obj1</span> : Object<div class='sub-desc'><p>The 1st object to compare</p>\n</div></li><li><span class='pre'>obj2</span> : Object<div class='sub-desc'><p>The 2nd object to compare</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isDeeplyStrict' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isDeeplyStrict' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isDeeplyStrict' class='name expandable'>isDeeplyStrict</a>( <span class='pre'>obj1, obj2, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes when in-depth comparison of 1st and 2nd arguments (which are assumed to be JSON objects) shows ...</div><div class='long'><p>This assertion passes when in-depth comparison of 1st and 2nd arguments (which are assumed to be JSON objects) shows that they are equal.\nComparison is performed with '===' operator, so <code>[ 1 ]</code> and `[ \"1\" ] objects will be different. The objects should not contain cyclic references.</p>\n\n<p>This method works correctly with the <em>placeholders</em> generated with method any.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>obj1</span> : Object<div class='sub-desc'><p>The 1st object to compare</p>\n</div></li><li><span class='pre'>obj2</span> : Object<div class='sub-desc'><p>The 2nd object to compare</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isFunction' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isFunction' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isFunction' class='name expandable'>isFunction</a>( <span class='pre'>value, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, if supplied value is a Function. ...</div><div class='long'><p>This assertion passes, if supplied value is a Function.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isGreater' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isGreater' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isGreater' class='name expandable'>isGreater</a>( <span class='pre'>value1, value2, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, when the comparison of 1st with 2nd, using &gt; operator will return true and fails otherwise. ...</div><div class='long'><p>This assertion passes, when the comparison of 1st with 2nd, using <code>&gt;</code> operator will return <code>true</code> and fails otherwise.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value1</span> : Number/Date<div class='sub-desc'><p>The 1st value to compare</p>\n</div></li><li><span class='pre'>value2</span> : Number/Date<div class='sub-desc'><p>The 2nd value to compare</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isGreaterOrEqual' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isGreaterOrEqual' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isGreaterOrEqual' class='name expandable'>isGreaterOrEqual</a>( <span class='pre'>value1, value2, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, when the comparison of 1st with 2nd, using &gt;= operator will return true and fails otherwise. ...</div><div class='long'><p>This assertion passes, when the comparison of 1st with 2nd, using <code>&gt;=</code> operator will return <code>true</code> and fails otherwise.</p>\n\n<p>It has a synonym - <code>isGE</code>.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value1</span> : Number/Date<div class='sub-desc'><p>The 1st value to compare</p>\n</div></li><li><span class='pre'>value2</span> : Number/Date<div class='sub-desc'><p>The 2nd value to compare</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isInstanceOf' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isInstanceOf' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isInstanceOf' class='name expandable'>isInstanceOf</a>( <span class='pre'>value, className, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, when the supplied value is the instance of the className. ...</div><div class='long'><p>This assertion passes, when the supplied <code>value</code> is the instance of the <code>className</code>. The check is performed with\n<code>instanceof</code> operator. The <code>className</code> parameter can be supplied as class constructor or as string, representing the class\nname. In the latter case the <code>class</code> will eval'ed to receive the class constructor.</p>\n\n<p>This method has synonyms: <code>isaOk</code>, <code>isa_ok</code></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check for 'isa' relationship</p>\n</div></li><li><span class='pre'>className</span> : Class/String<div class='sub-desc'><p>The class to check for 'isa' relationship with <code>value</code></p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isLess' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isLess' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isLess' class='name expandable'>isLess</a>( <span class='pre'>value1, value2, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, when the comparison of 1st with 2nd, using &lt; operator will return true and fails otherwise. ...</div><div class='long'><p>This assertion passes, when the comparison of 1st with 2nd, using <code>&lt;</code> operator will return <code>true</code> and fails otherwise.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value1</span> : Number/Date<div class='sub-desc'><p>The 1st value to compare</p>\n</div></li><li><span class='pre'>value2</span> : Number/Date<div class='sub-desc'><p>The 2nd value to compare</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isLessOrEqual' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isLessOrEqual' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isLessOrEqual' class='name expandable'>isLessOrEqual</a>( <span class='pre'>value1, value2, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, when the comparison of 1st with 2nd, using &lt;= operator will return true and fails otherwise. ...</div><div class='long'><p>This assertion passes, when the comparison of 1st with 2nd, using <code>&lt;=</code> operator will return <code>true</code> and fails otherwise.</p>\n\n<p>It has a synonym - <code>isLE</code>.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value1</span> : Number/Date<div class='sub-desc'><p>The 1st value to compare</p>\n</div></li><li><span class='pre'>value2</span> : Number/Date<div class='sub-desc'><p>The 2nd value to compare</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isNumber' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isNumber' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isNumber' class='name expandable'>isNumber</a>( <span class='pre'>value, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, if supplied value is a Number. ...</div><div class='long'><p>This assertion passes, if supplied value is a Number.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isObject' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isObject' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isObject' class='name expandable'>isObject</a>( <span class='pre'>value, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, if supplied value is an Object ...</div><div class='long'><p>This assertion passes, if supplied value is an Object</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isRegExp' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isRegExp' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isRegExp' class='name expandable'>isRegExp</a>( <span class='pre'>value, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, if supplied value is a RegExp. ...</div><div class='long'><p>This assertion passes, if supplied value is a RegExp.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-isString' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-isString' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-isString' class='name expandable'>isString</a>( <span class='pre'>value, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, if supplied value is a String. ...</div><div class='long'><p>This assertion passes, if supplied value is a String.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>value</span> : Mixed<div class='sub-desc'><p>The value to check.</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-like' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-like' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-like' class='name expandable'>like</a>( <span class='pre'>string, regex, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes when the passed string matches to a regular expression regex. ...</div><div class='long'><p>This assertion passes when the passed <code>string</code> matches to a regular expression <code>regex</code>. When <code>regex</code> is a string,\nassertion will check that it is a substring of <code>string</code></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>string</span> : String<div class='sub-desc'><p>The string to check for \"likeness\"</p>\n</div></li><li><span class='pre'>regex</span> : String/RegExp<div class='sub-desc'><p>The regex against which to test the string, can be also a plain string</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-livesOk' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-livesOk' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-livesOk' class='name expandable'>livesOk</a>( <span class='pre'>func, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes, when the supplied func function doesn't throw an exception during execution. ...</div><div class='long'><p>This assertion passes, when the supplied <code>func</code> function doesn't throw an exception during execution.</p>\n\n<p>See also <a href=\"#!/api/Siesta.Test-method-throwsOk\" rel=\"Siesta.Test-method-throwsOk\" class=\"docClass\">Siesta.Test.throwsOk</a> method.</p>\n\n<p>This method has two synonyms: <code>lives_ok</code> and <code>lives</code></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>func</span> : Function<div class='sub-desc'><p>The function which is not supposed to throw an exception</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-throwsOk' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-throwsOk' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-throwsOk' class='name expandable'>throwsOk</a>( <span class='pre'>func, expected, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This assertion passes if the func function throws an exception during executing, and the\nstringified exception passes...</div><div class='long'><p>This assertion passes if the <code>func</code> function throws an exception during executing, and the\nstringified exception passes the 'like' assertion (with 'expected' parameter).</p>\n\n<p>It has synonyms - <code>throws_ok</code> and <code>throws</code>.</p>\n\n<pre><code> t.throwsOk(function(){\n throw \"oopsie\";\n }, 'oopsie', 'Some description text');\n</code></pre>\n\n<p>See also <a href=\"#!/api/Siesta.Test-method-livesOk\" rel=\"Siesta.Test-method-livesOk\" class=\"docClass\">Siesta.Test.livesOk</a> method.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>func</span> : Function<div class='sub-desc'><p>The function which should throw an exception</p>\n</div></li><li><span class='pre'>expected</span> : String/RegExp<div class='sub-desc'><p>The regex against which to test the stringified exception, can be also a plain string</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-unlike' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-unlike' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-unlike' class='name expandable'>unlike</a>( <span class='pre'>string, regex, [desc]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This method is the opposite of 'like', it adds failed assertion, when the string matches the passed regex. ...</div><div class='long'><p>This method is the opposite of 'like', it adds failed assertion, when the string matches the passed regex.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>string</span> : String<div class='sub-desc'><p>The string to check for \"unlikeness\"</p>\n</div></li><li><span class='pre'>regex</span> : String/RegExp<div class='sub-desc'><p>The regex against which to test the string, can be also a plain string</p>\n</div></li><li><span class='pre'>desc</span> : String (optional)<div class='sub-desc'><p>The description of the assertion</p>\n</div></li></ul></div></div></div><div id='method-verifyGlobals' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-verifyGlobals' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-verifyGlobals' class='name expandable'>verifyGlobals</a>( <span class='pre'>name1, name2, nameN</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>This method accepts a variable number of names of expected properties in the global scope and then performs a globals...</div><div class='long'><p>This method accepts a variable number of names of expected properties in the global scope and then performs a globals check.</p>\n\n<p>It will scan all globals properties in the scope of test and compare them with the list of expected globals. Expected globals can be provided with:\n<a href=\"#!/api/Siesta.Test.More-method-expectGlobals\" rel=\"Siesta.Test.More-method-expectGlobals\" class=\"docClass\">expectGlobals</a> method or <a href=\"#!/api/Siesta.Project-cfg-expectedGlobals\" rel=\"Siesta.Project-cfg-expectedGlobals\" class=\"docClass\">expectedGlobals</a> configuration option of project.</p>\n\n<p>You can enable this assertion to automatically happen at the end of each test, using <a href=\"#!/api/Siesta.Project-cfg-autoCheckGlobals\" rel=\"Siesta.Project-cfg-autoCheckGlobals\" class=\"docClass\">autoCheckGlobals</a> option of the project.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>name1</span> : String/RegExp<div class='sub-desc'><p>The name of global property or the regular expression to match several properties</p>\n</div></li><li><span class='pre'>name2</span> : String/RegExp<div class='sub-desc'><p>The name of global property or the regular expression to match several properties</p>\n</div></li><li><span class='pre'>nameN</span> : String/RegExp<div class='sub-desc'><p>The name of global property or the regular expression to match several properties</p>\n</div></li></ul></div></div></div><div id='method-waitFor' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-waitFor' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-waitFor' class='name expandable'>waitFor</a>( <span class='pre'>condition, callback, scope, timeout, [interval]</span> ) : Promise<span class=\"signature\"></span></div><div class='description'><div class='short'>Waits for passed checker method to return true (or any non-false value, like for example DOM element or array), and c...</div><div class='long'><p>Waits for passed checker method to return true (or any non-false value, like for example DOM element or array), and calls the callback when this happens.\nAs an additional feature, the callback will receive the result from the checker method as the 1st argument.</p>\n\n<pre><code>t.waitFor(\n function () { return document.getElementById('someEl') },\n function (el) {\n // waited for element #someEl to appear\n // element will be available in the callback as 1st argument \"el\"\n }\n)\n</code></pre>\n\n<p>You can also call this method with a single Object having the following properties: <code>method</code>, <code>callback</code>, <code>scope</code>, <code>timeout</code>, <code>interval</code>, <code>description</code>:</p>\n\n<pre><code>t.waitFor({\n method : function () { return document.getElementById('someEl') },\n callback : function (el) {\n // waited for element #someEl to appear\n // element will be available in the callback as 1st argument \"el\"\n }\n})\n</code></pre>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>condition</span> : Function/Number/Object<div class='sub-desc'><p>Either a function which should return true (or any other \"truthy\" value) when a certain condition has been fulfilled,\nor a number of ms to wait before calling the callback. Can be also an object with the following properties:</p>\n<ul><li><span class='pre'>callback</span> : Function<div class='sub-desc'><p>A function to call when the condition has been met. Will receive a result from checker function.</p>\n</div></li><li><span class='pre'>method</span> : Function<div class='sub-desc'><p>A condition checker function.</p>\n</div></li><li><span class='pre'>scope</span> : Object<div class='sub-desc'><p>The scope for the callback.</p>\n</div></li><li><span class='pre'>timeout</span> : Number<div class='sub-desc'><p>The maximum amount of time (in milliseconds) to wait for the condition to be fulfilled.</p>\n</div></li><li><span class='pre'>interval</span> : Number<div class='sub-desc'><p>The polling interval (in milliseconds)</p>\n</div></li><li><span class='pre'>description</span> : String<div class='sub-desc'><p>The assertion description</p>\n</div></li></ul></div></li><li><span class='pre'>callback</span> : Function<div class='sub-desc'><p>A function to call when the condition has been met. Will receive a result from checker function.</p>\n</div></li><li><span class='pre'>scope</span> : Object<div class='sub-desc'><p>The scope for the callback</p>\n</div></li><li><span class='pre'>timeout</span> : Int<div class='sub-desc'><p>The maximum amount of time (in milliseconds) to wait for the condition to be fulfilled.\nDefaults to the <a href=\"#!/api/Siesta.Test.ExtJS-cfg-waitForTimeout\" rel=\"Siesta.Test.ExtJS-cfg-waitForTimeout\" class=\"docClass\">Siesta.Test.ExtJS.waitForTimeout</a> value. If condition is not fullfilled within this time, a failed assertion will be added to the test.</p>\n</div></li><li><span class='pre'>interval</span> : Int (optional)<div class='sub-desc'><p>The polling interval (in milliseconds)</p>\n<p>Defaults to: <code>100</code></p></div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'>Promise</span><div class='sub-desc'><p>A promise which will be resolved when wait completes (either successfully or by timeout). In case of successfull resolution\npromise will be resolved to the result from the checker function. Additionally it has a <code>force</code> property as noted below.</p>\n<ul><li><span class='pre'>force</span> : Function<div class='sub-desc'><p>A function, that will force this wait operation to immediately complete (and call the callback).\nNo call to checker will be performed and callback will not receive a result from it.</p>\n</div></li></ul></div></li></ul><h3 class='pa'>Fires</h3><ul><li>maxtimeoutchanged</li></ul></div></div></div><div id='method-waitForFn' class='member not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Test.More'>Siesta.Test.More</span><br/><a href='source/More.html#Siesta-Test-More-method-waitForFn' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Test.More-method-waitForFn' class='name expandable'>waitForFn</a>( <span class='pre'>fn, callback, scope, timeout, [interval]</span> ) : Object<span class=\"signature\"></span></div><div class='description'><div class='short'>Waits for the passed checker method to return true (or any non-false value, like for example DOM element or array), a...</div><div class='long'><p>Waits for the passed checker method to return true (or any non-false valu