siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
87 lines (72 loc) • 2.97 kB
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('Siesta.Recorder.UI.Editor.ActionName', {
extend : 'Ext.form.field.ComboBox',
alias : 'widget.typeeditor',
displayField : 'id',
valueField : 'id',
queryMode : 'local',
matchFieldWidth : false,
forceSelection : true,
typeAhead : true,
selectOnFocus : true,
store : {
fields : [ 'id', 'type' ]
},
// 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 : 'group', type : 'group' },
{ id : 'click', type : 'mouseinput' },
{ id : 'dblclick', type : 'mouseinput' },
{ id : 'contextmenu', type : 'mouseinput' },
{ id : 'drag', type : 'mouseinput' },
{ id : 'fn', type : 'fn' },
{ id : 'moveCursorTo', type : 'mouseinput' },
{ id : 'moveCursorBy', type : 'mouseinput' },
{ id : 'mousedown', type : 'mouseinput' },
{ id : 'mouseup', type : 'mouseinput' },
{ id : 'type', type : 'keyinput' },
{ id : 'screenshot', type : 'screenshot' },
{ id : 'setUrl', type : 'navigate' }
],
applyChanges : function (actionRecord) {
var value = this.getValue();
actionRecord.setAction(value)
actionRecord.set('leaf', value !== 'group');
},
populate : function (test) {
var waitActions = [];
for (var o in test) {
if (o.match(/waitFor.+/) && typeof test[ o ] === 'function') {
waitActions.push({ id : o, type : 'wait' });
}
}
var actions = this.actions.concat(waitActions).sort(function(a, b) { return a.id < b.id ? -1 : 1; });
this.store.loadData(actions);
}
});
</pre>
</body>
</html>