UNPKG

siesta-lite

Version:

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

103 lines (84 loc) 3.72 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 */ Class(&#39;Ariadne.ExtJSComponentQueryFinder.Identifier.PropertyValue&#39;, { 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 [ &#39;name&#39;, // form fields &#39;text&#39;, // menu items, buttons &#39;dataIndex&#39;, // Column component &#39;iconCls&#39;, // button/menuitem &#39;type&#39;, // Panel header tools &#39;title&#39;, // identifying panels, tab panels headers // &#39;cls&#39;, // Cmp, TODO discuss &#39;inputType&#39;, &#39;boxLabel&#39;, &#39;fieldLabel&#39; ] } }, methods : { initialize : function (cfg) { this.properties = this.mergeArrayAttributeFromClassHierarchy(&#39;properties&#39;, 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 &lt; properties.length; i++) { var property = properties[ i ] var value = target[ property ] if ( value &amp;&amp; typeof value === &#39;string&#39; &amp;&amp; !( this.ignoreProperty(target, property) || // ignore the &quot;inputType&quot; for sliders which is always a &quot;text&quot; (property == &#39;inputType&#39; &amp;&amp; Ext.slider &amp;&amp; Ext.slider.Multi &amp;&amp; (target instanceof Ext.slider.Multi)) || (property == &#39;inputType&#39; &amp;&amp; Ext.form &amp;&amp; Ext.form.field &amp;&amp; Ext.form.field.ComboBox &amp;&amp; (target instanceof Ext.form.field.ComboBox)) || // Some Ext Components have an empty title/text - ignore (value == &#39;&amp;#160;&#39;) ) ) { segments.push({ query : safeXtype.query + &#39;[&#39; + property + &#39;=&#39; + this.escapeCQSelector(value) + &#39;]&#39;, leading : safeXtype.leading }) } } return segments } } }); </pre> </body> </html>