siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
103 lines (84 loc) • 3.72 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
*/
Class('Ariadne.ExtJSComponentQueryFinder.Identifier.PropertyValue', {
isa : Ariadne.QueryFinder.Identifier,
does : [
Ariadne.ExtJSComponentQueryFinder.Role.ExtJSComponentHelper,
Ariadne.ExtJSDomQueryFinder.Role.ExtJSHelper
],
has : {
// an array of attribute names, which can be used for matching
properties : function () {
return [
'name', // form fields
'text', // menu items, buttons
'dataIndex', // Column component
'iconCls', // button/menuitem
'type', // Panel header tools
'title', // identifying panels, tab panels headers
// 'cls', // Cmp, TODO discuss
'inputType',
'boxLabel',
'fieldLabel'
]
}
},
methods : {
initialize : function (cfg) {
this.properties = this.mergeArrayAttributeFromClassHierarchy('properties', cfg)
},
ignoreProperty : function (target, property) {
return this.valueIsAutoGeneratedByComponent(target, target[ property ])
},
identify : function (target, root, maze) {
var Ext = this.finder.Ext
var properties = this.properties
var segments = []
var safeXtype = this.getExt4ProofXtype(target, Ext)
for (var i = 0; i < properties.length; i++) {
var property = properties[ i ]
var value = target[ property ]
if (
value && typeof value === 'string' && !(
this.ignoreProperty(target, property) ||
// ignore the "inputType" for sliders which is always a "text"
(property == 'inputType' && Ext.slider && Ext.slider.Multi && (target instanceof Ext.slider.Multi)) ||
(property == 'inputType' && Ext.form && Ext.form.field && Ext.form.field.ComboBox && (target instanceof Ext.form.field.ComboBox)) ||
// Some Ext Components have an empty title/text - ignore
(value == '&#160;')
)
) {
segments.push({
query : safeXtype.query + '[' + property + '=' + this.escapeCQSelector(value) + ']',
leading : safeXtype.leading
})
}
}
return segments
}
}
});
</pre>
</body>
</html>