UNPKG

siesta-lite

Version:

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

87 lines (72 loc) 2.97 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 */ Ext.define(&#39;Siesta.Recorder.UI.Editor.ActionName&#39;, { extend : &#39;Ext.form.field.ComboBox&#39;, alias : &#39;widget.typeeditor&#39;, displayField : &#39;id&#39;, valueField : &#39;id&#39;, queryMode : &#39;local&#39;, matchFieldWidth : false, forceSelection : true, typeAhead : true, selectOnFocus : true, store : { fields : [ &#39;id&#39;, &#39;type&#39; ] }, // TODO move to test class autogenerate these (either during Siesta build or at Siesta runtime - via JsDuck?) // Not all commands can be edited either (like waitForStoresToLoad etc). actions : [ { id : &#39;group&#39;, type : &#39;group&#39; }, { id : &#39;click&#39;, type : &#39;mouseinput&#39; }, { id : &#39;dblclick&#39;, type : &#39;mouseinput&#39; }, { id : &#39;contextmenu&#39;, type : &#39;mouseinput&#39; }, { id : &#39;drag&#39;, type : &#39;mouseinput&#39; }, { id : &#39;fn&#39;, type : &#39;fn&#39; }, { id : &#39;moveCursorTo&#39;, type : &#39;mouseinput&#39; }, { id : &#39;moveCursorBy&#39;, type : &#39;mouseinput&#39; }, { id : &#39;mousedown&#39;, type : &#39;mouseinput&#39; }, { id : &#39;mouseup&#39;, type : &#39;mouseinput&#39; }, { id : &#39;type&#39;, type : &#39;keyinput&#39; }, { id : &#39;screenshot&#39;, type : &#39;screenshot&#39; }, { id : &#39;setUrl&#39;, type : &#39;navigate&#39; } ], applyChanges : function (actionRecord) { var value = this.getValue(); actionRecord.setAction(value) actionRecord.set(&#39;leaf&#39;, value !== &#39;group&#39;); }, populate : function (test) { var waitActions = []; for (var o in test) { if (o.match(/waitFor.+/) &amp;&amp; typeof test[ o ] === &#39;function&#39;) { waitActions.push({ id : o, type : &#39;wait&#39; }); } } var actions = this.actions.concat(waitActions).sort(function(a, b) { return a.id &lt; b.id ? -1 : 1; }); this.store.loadData(actions); } }); </pre> </body> </html>