How to use textField.text method in Appium Xcuitest Driver

Best JavaScript code snippet using appium-xcuitest-driver

TextFieldUtils.js

Source:TextFieldUtils.js Github

copy

Full Screen

1//////////////////////////////////////////////////////////////////////////////////////2//3//  Copyright (c) 2014-present, Egret Technology.4//  All rights reserved.5//  Redistribution and use in source and binary forms, with or without6//  modification, are permitted provided that the following conditions are met:7//8//     * Redistributions of source code must retain the above copyright9//       notice, this list of conditions and the following disclaimer.10//     * Redistributions in binary form must reproduce the above copyright11//       notice, this list of conditions and the following disclaimer in the12//       documentation and/or other materials provided with the distribution.13//     * Neither the name of the Egret nor the14//       names of its contributors may be used to endorse or promote products15//       derived from this software without specific prior written permission.16//17//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS18//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES19//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.20//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,21//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT22//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,23//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF24//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING25//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,26//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27//28//////////////////////////////////////////////////////////////////////////////////////29var __reflect = (this && this.__reflect) || function (p, c, t) {30    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;31};32var egret;33(function (egret) {34    /**35     * @private36     * @version Egret 2.437     * @platform Web,Native38     */39    var TextFieldUtils = (function () {40        function TextFieldUtils() {41        }42        /**43         * 获取第一个绘制的行数44         * @param textfield 文本45         * @returns {number} 行数,从0开始46         * @private47         */48        TextFieldUtils.$getStartLine = function (textfield) {49            var values = textfield.$TextField;50            var textHeight = TextFieldUtils.$getTextHeight(textfield);51            var startLine = 0;52            var textFieldHeight = values[4 /* textFieldHeight */];53            if (!isNaN(textFieldHeight)) {54                if (textHeight < textFieldHeight) {55                }56                else if (textHeight > textFieldHeight) {57                    startLine = Math.max(values[28 /* scrollV */] - 1, 0);58                    startLine = Math.min(values[29 /* numLines */] - 1, startLine);59                }60                if (!values[30 /* multiline */]) {61                    startLine = Math.max(values[28 /* scrollV */] - 1, 0);62                    if (values[29 /* numLines */] > 0) {63                        startLine = Math.min(values[29 /* numLines */] - 1, startLine);64                    }65                }66            }67            return startLine;68        };69        /**70         * 获取水平比例71         * @param textfield 文本72         * @returns {number} 水平比例73         * @private74         */75        TextFieldUtils.$getHalign = function (textfield) {76            var lineArr = textfield.$getLinesArr();77            var halign = 0;78            if (textfield.$TextField[9 /* textAlign */] == egret.HorizontalAlign.CENTER) {79                halign = 0.5;80            }81            else if (textfield.$TextField[9 /* textAlign */] == egret.HorizontalAlign.RIGHT) {82                halign = 1;83            }84            if (textfield.$TextField[24 /* type */] == egret.TextFieldType.INPUT && !textfield.$TextField[30 /* multiline */] && lineArr.length > 1) {85                halign = 0;86            }87            return halign;88        };89        /**90         * @private91         *92         * @param textfield93         * @returns94         */95        TextFieldUtils.$getTextHeight = function (textfield) {96            var textHeight = (egret.TextFieldType.INPUT == textfield.$TextField[24 /* type */]97                && !textfield.$TextField[30 /* multiline */]) ? textfield.$TextField[0 /* fontSize */] : (textfield.$TextField[6 /* textHeight */] + (textfield.$TextField[29 /* numLines */] - 1) * textfield.$TextField[1 /* lineSpacing */]);98            return textHeight;99        };100        /**101         * 获取垂直比例102         * @param textfield 文本103         * @returns {number} 垂直比例104         * @private105         */106        TextFieldUtils.$getValign = function (textfield) {107            var textHeight = TextFieldUtils.$getTextHeight(textfield);108            //if (textfield.$TextField[sys.TextKeys.type] == egret.TextFieldType.INPUT) {109            //    if (textfield.$TextField[sys.TextKeys.multiline]) {110            //return 0;111            //}112            //return 0.5;113            //}114            var textFieldHeight = textfield.$TextField[4 /* textFieldHeight */];115            if (!isNaN(textFieldHeight)) {116                if (textHeight < textFieldHeight) {117                    var valign = 0;118                    if (textfield.$TextField[10 /* verticalAlign */] == egret.VerticalAlign.MIDDLE)119                        valign = 0.5;120                    else if (textfield.$TextField[10 /* verticalAlign */] == egret.VerticalAlign.BOTTOM)121                        valign = 1;122                    return valign;123                }124            }125            return 0;126        };127        /**128         * 根据x、y获取文本项129         * @param textfield 文本130         * @param x x坐标值131         * @param y y坐标值132         * @returns 文本单项133         * @private134         */135        TextFieldUtils.$getTextElement = function (textfield, x, y) {136            var hitTextEle = TextFieldUtils.$getHit(textfield, x, y);137            var lineArr = textfield.$getLinesArr();138            if (hitTextEle && lineArr[hitTextEle.lineIndex] && lineArr[hitTextEle.lineIndex].elements[hitTextEle.textElementIndex]) {139                return lineArr[hitTextEle.lineIndex].elements[hitTextEle.textElementIndex];140            }141            return null;142        };143        /**144         * 获取文本点击块145         * @param textfield 文本146         * @param x x坐标值147         * @param y y坐标值148         * @returns 文本点击块149         * @private150         */151        TextFieldUtils.$getHit = function (textfield, x, y) {152            var lineArr = textfield.$getLinesArr();153            if (textfield.$TextField[3 /* textFieldWidth */] == 0) {154                return null;155            }156            var line = 0;157            var textHeight = TextFieldUtils.$getTextHeight(textfield);158            var startY = 0;159            var textFieldHeight = textfield.$TextField[4 /* textFieldHeight */];160            if (!isNaN(textFieldHeight) && textFieldHeight > textHeight) {161                var valign = TextFieldUtils.$getValign(textfield);162                startY = valign * (textFieldHeight - textHeight);163                if (startY != 0) {164                    y -= startY;165                }166            }167            var startLine = TextFieldUtils.$getStartLine(textfield);168            var lineH = 0;169            for (var i = startLine; i < lineArr.length; i++) {170                var lineEle = lineArr[i];171                if (lineH + lineEle.height >= y) {172                    if (lineH < y) {173                        line = i + 1;174                    }175                    break;176                }177                else {178                    lineH += lineEle.height;179                }180                if (lineH + textfield.$TextField[1 /* lineSpacing */] > y) {181                    return null;182                }183                lineH += textfield.$TextField[1 /* lineSpacing */];184            }185            if (line == 0) {186                return null;187            }188            var lineElement = lineArr[line - 1];189            var textFieldWidth = textfield.$TextField[3 /* textFieldWidth */];190            if (isNaN(textFieldWidth)) {191                textFieldWidth = textfield.textWidth;192            }193            var halign = TextFieldUtils.$getHalign(textfield);194            x -= halign * (textFieldWidth - lineElement.width);195            var lineW = 0;196            for (var i = 0; i < lineElement.elements.length; i++) {197                var iwTE = lineElement.elements[i];198                if (lineW + iwTE.width <= x) {199                    lineW += iwTE.width;200                }201                else if (lineW < x) {202                    return { "lineIndex": line - 1, "textElementIndex": i };203                }204            }205            return null;206        };207        /**208         * 获取当前显示多少行209         * @param textfield 文本210         * @returns {number} 显示的行数211         * @private212         */213        TextFieldUtils.$getScrollNum = function (textfield) {214            var scrollNum = 1;215            if (textfield.$TextField[30 /* multiline */]) {216                var height = textfield.height;217                var size = textfield.size;218                var lineSpacing = textfield.lineSpacing;219                scrollNum = Math.floor(height / (size + lineSpacing));220                var leftH = height - (size + lineSpacing) * scrollNum;221                if (leftH > size / 2) {222                    scrollNum++;223                }224            }225            return scrollNum;226        };227        return TextFieldUtils;228    }());229    egret.TextFieldUtils = TextFieldUtils;230    __reflect(TextFieldUtils.prototype, "egret.TextFieldUtils");...

Full Screen

Full Screen

LzhhtGrid.js

Source:LzhhtGrid.js Github

copy

Full Screen

1/**2 *  3 * */4Ext.define("core.lzhht.view.LzhhtGrid", {5  extend: "Ext.grid.Panel",6  alias: "widget.lzhhtGrid",7  id: "lzhhtgrid",8  store: "core.lzhht.store.LzhhtStore",9  border: 0,10  selModel: {11    selType: "checkboxmodel"12  },13  multiSelect: true,14  frame: true,15  tbar: [16    {xtype: 'button', text: '添加', ref: 'add', iconCls: 'table_add'}, '|',17    {xtype: 'button', text: '修改', ref: 'edit', iconCls: 'table_edit'}, '|',18    {xtype: 'button', text: '删除', ref: 'del', iconCls: 'table_remove'},19    "->",20    '按名称查询:',21    {22      xtype: 'triggerfield',23      triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',24      listeners: {25        "change": function(_this, _new, _old, _opt) {26          var _store = _this.ownerCt.ownerCt.getStore();27          _store.clearFilter(false);28          _store.filter("name", _new);29        }30      },31      onTriggerClick: function() {32        var _store = this.ownerCt.ownerCt.getStore();33        _store.clearFilter(false);34        _store.filter("name", this.getValue());35      }36    },37    '按编号查询:',38    {39      xtype: 'triggerfield',40      triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',41      listeners: {42        "change": function(_this, _new, _old, _opt) {43          var _store = _this.ownerCt.ownerCt.getStore();44          _store.clearFilter(false);45          _store.filter("id", _new);46        }47      },48      onTriggerClick: function() {49        var _store = this.ownerCt.ownerCt.getStore();50        _store.clearFilter(false);51        _store.filter("id", this.getValue());52      }53    }54  ],55  bbar: {56    xtype: 'pagingtoolbar',57    store: 'core.lzhht.store.LzhhtStore',58    dock: 'bottom',59    displayInfo: true60  },61  enableKeyNav: true, //可以使用键盘控制上下62  columnLines: true, //展示竖线63  columns: [64    {xtype: 'rownumberer'},65    {text: "承包合同编码", dataIndex: "ycbhtbm", width: 100, field: {66        xtype: "textfield"67      }},68    {text: "流转合同编码", dataIndex: "lzhtbm", width: 100, field: {69        xtype: "textfield"70      }},71    {text: "承包方编码", dataIndex: "cbfbm", width: 70, field: {72        xtype: "textfield"73      }},74    {text: "受让方编码", dataIndex: "srfbm", width: 70, field: {75        xtype: "textfield"76      }},77    {text: "流转方式", dataIndex: "lzfs", width: 70, field: {78        xtype: "textfield"79      }},80    {text: "流转期限", dataIndex: "lzqx", width: 70, field: {81        xtype: "textfield"82      }},83    {text: "流转开始日期", dataIndex: "lzqxksrq", width: 70, field: {84        xtype: "textfield"85      }},86    {text: "流转结束日期", dataIndex: "lzqxjsrq", width: 70, field: {87        xtype: "textfield"88      }},89    {text: "流转面积", dataIndex: "lzmj", width: 70, field: {90        xtype: "textfield"91      }},92    {text: "流转地块数", dataIndex: "lzdks", width: 70, field: {93        xtype: "textfield"94      }},95    {text: "流转前土地用途", dataIndex: "lzqtdyt", width: 70, field: {96        xtype: "textfield"97      }},98    {text: "流转后土地用途", dataIndex: "lzhtdyt", width: 70, field: {99        xtype: "textfield"100      }},101    {text: "流转费用说明", dataIndex: "lzjgsm", width: 70, field: {102        xtype: "textfield"103      }},104    {text: "合同签订日期", dataIndex: "htqdrq", width: 70, field: {105        xtype: "textfield"106      }}107  ],108  initComponent: function() {109    this.callParent(arguments);110  }
...

Full Screen

Full Screen

DkGrid.js

Source:DkGrid.js Github

copy

Full Screen

1/**2 *  3 * */4Ext.define("core.dk.view.DkGrid", {5  extend: "Ext.grid.Panel",6  alias: "widget.dkgrid",7  id: "dkgrid",8  store: "core.dk.store.DkStore",9  border: 0,10  selModel: {11    selType: "checkboxmodel"12  },13  multiSelect: true,14  frame: true,15  tbar: [16    {xtype: 'button', text: '添加', ref: 'add', iconCls: 'table_add'}, '|',17    {xtype: 'button', text: '修改', ref: 'edit', iconCls: 'table_edit'}, '|',18    {xtype: 'button', text: '删除', ref: 'del', iconCls: 'table_remove'},19    "->",20    '按名称查询:',21    {22      xtype: 'triggerfield',23      triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',24      listeners: {25        "change": function(_this, _new, _old, _opt) {26          var _store = _this.ownerCt.ownerCt.getStore();27          _store.clearFilter(false);28          _store.filter("name", _new);29        }30      },31      onTriggerClick: function() {32        var _store = this.ownerCt.ownerCt.getStore();33        _store.clearFilter(false);34        _store.filter("name", this.getValue());35      }36    },37    '按编号查询:',38    {39      xtype: 'triggerfield',40      triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',41      listeners: {42        "change": function(_this, _new, _old, _opt) {43          var _store = _this.ownerCt.ownerCt.getStore();44          _store.clearFilter(false);45          _store.filter("id", _new);46        }47      },48      onTriggerClick: function() {49        var _store = this.ownerCt.ownerCt.getStore();50        _store.clearFilter(false);51        _store.filter("id", this.getValue());52      }53    }54  ],55  bbar: {56    xtype: 'pagingtoolbar',57    store: 'core.dk.store.DkStore',58    dock: 'bottom',59    displayInfo: true60  },61  enableKeyNav: true, //可以使用键盘控制上下62  columnLines: true, //展示竖线63  columns: [64    {xtype: 'rownumberer'},65    {text: "地块编码", dataIndex: "dkbm", width: 120, field: {66        xtype: "textfield"67      }},68    {text: "地块名称", dataIndex: "dkmc", field: {69        xtype: "textfield"70      }},71    {text: "所有权性质", dataIndex: "syqxz", field: {72        xtype: "textfield"73      }},74    {text: "地块类别", dataIndex: "dklb", field: {75        xtype: "textfield"76      }},77    {text: "土地利用类型", dataIndex: "tdlylx", field: {78        xtype: "textfield"79      }},80    {text: "地力等级", dataIndex: "dldj", width: 100, field: {81        xtype: "textfield"82      }},83    {text: "土地用途", dataIndex: "tdyt", width: 70, field: {84        xtype: "textfield"85      }},86    {text: "是否基本农田", dataIndex: "sfjbnt", width: 100, field: {87        xtype: "textfield"88      }},89    {text: "实测面积", dataIndex: "scmj", width: 70, field: {90        xtype: "textfield"91      }},92    {text: "地块东至", dataIndex: "dkdz", width: 70, field: {93        xtype: "textfield"94      }},95    {text: "地块西至", dataIndex: "dkxz", width: 70, field: {96        xtype: "textfield"97      }},98    {text: "地块南至", dataIndex: "dknz", width: 70, field: {99        xtype: "textfield"100      }},101    {text: "地块北至", dataIndex: "dkbz", width: 70, field: {102        xtype: "textfield"103      }},104    {text: "地块备注信息", dataIndex: "dkbzxx", width: 70, field: {105        xtype: "textfield"106      }},107    {text: "指界人姓名", dataIndex: "zjrxm", width: 70, field: {108        xtype: "textfield"109      }}110  ],111  initComponent: function() {112    this.callParent(arguments);113  }
...

Full Screen

Full Screen

NewBackList.js

Source:NewBackList.js Github

copy

Full Screen

1Ext.define('erp.view.as.port.NewBackList', {2	extend : 'Ext.Viewport',3	layout : 'anchor',4	hideBorders : true,5	initComponent : function() {6		var me = this;7		var store = new Ext.data.Store({8			fields : [ 'NEWFITTINGBACK_NO', 'BACK_DAY', 'STORE_ID',9						'STORE_NAME', 'SHENQING_OP', 'OBJECTIVE_STORE', 'APPLY_DATETIME',10						'APPLY_RESULT', 'APPLY_OP', 'INOUTNO', 'CLASS',11						'UPDATEMAN', 'UPDATEDATE' ],12				proxy : {13					type : 'ajax',14					url : basePath + 'as/port/getNewBackList.action',15					reader : {16						type : 'json',17						root : 'target',18						totalProperty: 'totalCount'19					}20				},21				autoLoad : true,22				pageSize: parseInt((Ext.isIE ? screen.height*0.73 : window.innerHeight)*0.7/23)23			});24		Ext.apply(me, {25			items : [ {26				xtype : 'grid',27				anchor : '100% 100%',28				columnLines : true,29				id : 'grid',30				plugins: [Ext.create('erp.view.core.grid.HeaderFilter', {31					remoteFilter: true32				})],33				columns : [ {34					text : '申请单号',35					cls : 'x-grid-header-1',36					dataIndex : 'NEWFITTINGBACK_NO',37					width : 180,38					filter: {39	    				xtype : 'textfield'40	    			}41				}, {42					text : '退回时间',43					cls : 'x-grid-header-1',44					dataIndex : 'BACK_DAY',45					width : 90,46					filter: {47	    				xtype : 'datefield'48	    			}49				}, {50					text : '网点编号',51					cls : 'x-grid-header-1',52					dataIndex : 'STORE_ID',53					width : 150,54					filter: {55	    				xtype : 'textfield'56	    			}57				}, {58					text : '网点名称',59					cls : 'x-grid-header-1',60					dataIndex : 'STORE_NAME',61					width : 80,62					filter: {63	    				xtype : 'textfield'64	    			}65				}, {66					text : '申请人',67					cls : 'x-grid-header-1',68					dataIndex: 'SHENQING_OP',69					width : 70,70					filter: {71	    				xtype : 'textfield'72	    			}73				}, {74					text : '目标公司',75					cls : 'x-grid-header-1',76					dataIndex : 'OBJECTIVE_STORE',77					width : 80,78					filter: {79	    				xtype : 'textfield'80	    			}81				}, {82					text : '审核时间',83					cls : 'x-grid-header-1',84					dataIndex : 'APPLY_DATETIME',85					width : 90,86					filter: {87	    				xtype : 'datefield'88	    			}89				}, {90					text : '审核意见',91					cls : 'x-grid-header-1',92					dataIndex : 'APPLY_RESULT',93					width : 90,94					filter: {95	    				xtype : 'textfield'96	    			}97				}, {98					text : '审核人',99					cls : 'x-grid-header-1',100					dataIndex : 'APPLY_OP',101					width : 70,102					filter: {103	    				xtype : 'textfield'104	    			}105				}, {106					text : '出入库单号',107					cls : 'x-grid-header-1',108					dataIndex : 'INOUTNO',109					width : 110,110					filter: {111	    				xtype : 'textfield'112	    			}113				}, {114					text : '单据类型',115					cls : 'x-grid-header-1',116					dataIndex : 'CLASS',117					width : 100,118					filter: {119	    				xtype : 'textfield'120	    			}121				}, {122					text : '处理人',123					cls : 'x-grid-header-1',124					dataIndex : 'UPDATEMAN',125					width : 70,126					filter: {127	    				xtype : 'textfield'128	    			}129				}, {130					text : '处理时间',131					cls : 'x-grid-header-1',132					dataIndex : 'UPDATEDATE',133					width : 90,134					filter: {135	    				xtype : 'datefield'136	    			}137				} ],138				store : store,139				dockedItems: [{140			        xtype: 'pagingtoolbar',141			        store: store,142			        dock: 'bottom',143			        displayInfo: true144			    }]145			} ]146		});147		me.callParent(arguments);148	}...

Full Screen

Full Screen

PreProductList.js

Source:PreProductList.js Github

copy

Full Screen

1Ext.define('erp.view.as.port.PreProductList', {2	extend : 'Ext.Viewport',3	layout : 'anchor',4	hideBorders : true,5	initComponent : function() {6		var me = this;7		var store = new Ext.data.Store({8			fields : [ 'APPLY_NO', 'STORE_ID', 'STORE_NAME', 'SHENQING_OP', 'OBJECTIVE_STORE',9						'APPLY_DAY', 'APPLY_DATETIME', 'APPLY_OP', 'INOUTNO', 'CLASS',10						'UPDATEMAN', 'UPDATEDATE' ],11				proxy : {12					type : 'ajax',13					url : basePath + 'as/port/getApplyList.action',14					reader : {15						type : 'json',16						root : 'target',17						totalProperty: 'totalCount'18					}19				},20				autoLoad : true,21				pageSize: parseInt((Ext.isIE ? screen.height*0.73 : window.innerHeight)*0.7/23)22			});23		Ext.apply(me, {24			items : [ {25				xtype : 'grid',26				anchor : '100% 100%',27				columnLines : true,28				id : 'grid',29				plugins: [Ext.create('erp.view.core.grid.HeaderFilter', {30					remoteFilter: true31				})],32				columns : [ {33					text : '申请单号',34					cls : 'x-grid-header-1',35					dataIndex : 'APPLY_NO',36					width : 180,37					filter: {38	    				xtype : 'textfield'39	    			}40				}, {41					text : '网点编号',42					cls : 'x-grid-header-1',43					dataIndex : 'STORE_ID',44					width : 150,45					filter: {46	    				xtype : 'textfield'47	    			}48				}, {49					text : '网点名称',50					cls : 'x-grid-header-1',51					dataIndex : 'STORE_NAME',52					width : 80,53					filter: {54	    				xtype : 'textfield'55	    			}56				}, {57					text : '申请人',58					cls : 'x-grid-header-1',59					dataIndex : 'SHENQING_OP',60					width : 80,61					filter: {62	    				xtype : 'textfield'63	    			}64				}, {65					text : '目标公司',66					cls : 'x-grid-header-1',67					dataIndex : 'OBJECTIVE_STORE',68					width : 80,69					filter: {70	    				xtype : 'textfield'71	    			}72				}, {73					text : '申请时间',74					cls : 'x-grid-header-1',75					dataIndex : 'APPLY_DAY',76					width : 90,77					filter: {78	    				xtype : 'datefield'79	    			}80				}, {81					text : '审核时间',82					cls : 'x-grid-header-1',83					dataIndex : 'APPLY_DATETIME',84					width : 90,85					filter: {86	    				xtype : 'datefield'87	    			}88				}, {89					text : '审核意见',90					cls : 'x-grid-header-1',91					dataIndex : 'APPLY_RESULT',92					width : 90,93					filter: {94	    				xtype : 'textfield'95	    			}96				}, {97					text : '审核人',98					cls : 'x-grid-header-1',99					dataIndex : 'APPLY_OP',100					width : 70,101					filter: {102	    				xtype : 'textfield'103	    			}104				}, {105					text : '出入库单号',106					cls : 'x-grid-header-1',107					dataIndex : 'INOUTNO',108					width : 110,109					filter: {110	    				xtype : 'textfield'111	    			}112				}, {113					text : '单据类型',114					cls : 'x-grid-header-1',115					dataIndex : 'CLASS',116					width : 100,117					filter: {118	    				xtype : 'textfield'119	    			}120				}, {121					text : '处理人',122					cls : 'x-grid-header-1',123					dataIndex : 'UPDATEMAN',124					width : 70,125					filter: {126	    				xtype : 'textfield'127	    			}128				}, {129					text : '处理时间',130					cls : 'x-grid-header-1',131					dataIndex : 'UPDATEDATE',132					width : 90,133					filter: {134	    				xtype : 'datefield'135	    			}136				} ],137				store : store,138				dockedItems: [{139			        xtype: 'pagingtoolbar',140			        store: store,141			        dock: 'bottom',142			        displayInfo: true143			    }]144			} ]145		});146		me.callParent(arguments);147	}...

Full Screen

Full Screen

CbfGrid.js

Source:CbfGrid.js Github

copy

Full Screen

1/**2 *  3 * */4Ext.define("core.cbf.view.CbfGrid", {5  extend: "Ext.grid.Panel",6  alias: "widget.cbfgrid",7  id: "cbfgridId",8  store: "core.cbf.store.CbfStore",9  border: 0,10  selModel: {11    selType: "checkboxmodel"12  },13  multiSelect: true,14  frame: true,15  tbar: [16    {xtype: 'button', text: '添加', ref: 'add', iconCls: 'table_add'}, '|',17    {xtype: 'button', text: '修改', ref: 'edit', iconCls: 'table_edit'}, '|',18    {xtype: 'button', text: '删除', ref: 'del', iconCls: 'table_remove'},19    "->",20    '按名称查询:',21    {22      xtype: 'triggerfield',23      triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',24      listeners: {25        "change": function(_this, _new, _old, _opt) {26          var _store = _this.ownerCt.ownerCt.getStore();27          _store.clearFilter(false);28          _store.filter("name", _new);29        }30      },31      onTriggerClick: function() {32        var _store = this.ownerCt.ownerCt.getStore();33        _store.clearFilter(false);34        _store.filter("name", this.getValue());35      }36    },37    '按编号查询:',38    {39      xtype: 'triggerfield',40      triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',41      listeners: {42        "change": function(_this, _new, _old, _opt) {43          var _store = _this.ownerCt.ownerCt.getStore();44          _store.clearFilter(false);45          _store.filter("id", _new);46        }47      },48      onTriggerClick: function() {49        var _store = this.ownerCt.ownerCt.getStore();50        _store.clearFilter(false);51        _store.filter("id", this.getValue());52      }53    }54  ],55  bbar: {56    xtype: 'pagingtoolbar',57    store: 'core.cbf.store.CbfStore',58    dock: 'bottom',59    displayInfo: true60  },61  enableKeyNav: true, //可以使用键盘控制上下62  columnLines: true, //展示竖线63  columns: [64    {xtype: 'rownumberer'},65    {text: "承包方编码", dataIndex: "cbfbm", width: 120, field: {66        xtype: "textfield"67      }},68    {text: "承包方类型", dataIndex: "cbflx", width: 80, field: {69        xtype: "textfield"70      }},71    {text: "承包方名称", dataIndex: "cbfmc", width: 80, field: {72        xtype: "textfield"73      }},74    {text: "承包方性别", dataIndex: "cbfxb", width: 80, field: {75        xtype: "textfield"76      }},77    {text: "承包方民族", dataIndex: "cbfmz", width: 80, field: {78        xtype: "textfield"79      }},80    {text: "承包方地址", dataIndex: "cbfdz", width: 150, field: {81        xtype: "textfield"82      }},83    {text: "联系电话", dataIndex: "lxdh", width: 80, field: {84        xtype: "textfield"85      }},86    {text: "承包方调查员", dataIndex: "cbfdcy", width: 80, field: {87        xtype: "textfield"88      }},89    {text: "公示记事人", dataIndex: "gsjsr", width: 70, field: {90        xtype: "textfield"91      }},92    {text: "公示审核人", dataIndex: "gsshr", width: 70, field: {93        xtype: "textfield"94      }},95    {text: "公示审核日期", dataIndex: "gsshrq", width: 80, field: {96        xtype: "textfield"97      }}98  ],99  initComponent: function() {100    this.callParent(arguments);101  }
...

Full Screen

Full Screen

RoomGrid.js

Source:RoomGrid.js Github

copy

Full Screen

1Ext.define("core.baseset.roomdefine.view.RoomGrid", {2    extend: "core.base.view.BaseGrid",3    alias: "widget.baseset.roomdefine.roomgrid",4    dataUrl: comm.get('baseUrl') + "/BaseRoominfo/list",5    model: "com.zd.school.build.define.model.BuildRoominfo",6    extParams: {7        filter: "[{'type':'string','comparison':'=','value':'ROOT','field':'areaId'},{'type':'string','comparison':'=','value':'0','field':'roomType'}]",8    },9    selModel: {10        type: "checkboxmodel",   11        headerWidth:40,    //设置这个值为50。 但columns中的defaults中设置宽度,会影响他12        mode:'single',  //multi,simple,single;默认为多选multi13    },14    panelTopBar:{15        xtype:'toolbar',16        items: [{17            xtype: 'tbtext',18            html: '区域房间',19            style: {20                fontSize: '16px',21                color: '#C44444',22                fontWeight:800,23                lineHeight:'30px'24            }25        }],26    }, 27    panelButtomBar:null,28    columns:  {        29        defaults:{30            titleAlign:"center"31        },32        items: [{33            text: "主键",34            dataIndex: "roomId",35            hidden: true36        }, {37            text: "房间编号",38            dataIndex: "roomCode",39            flex:1,        40            minWidth:100,41            field: {42                xtype: "textfield"43            }44        }, {45            text: "房间名称",46            dataIndex: "roomName",47            flex:1,48            minWidth:100,49            field: {50                xtype: "textfield"51            }52        }, {53            text: "房间类型", //字段中文名54            dataIndex: "roomType", //字段名55            columnType: "basecombobox", //列类型56            width:100,57            ddCode: "FJLX" //字典代码58        }, {59            text: "门牌号1",60            dataIndex: "extField01",61            width:80,62            field: {63                xtype: "textfield"64            }65        }, {66            text: "门牌号2",67            dataIndex: "extField02",68            width:80,69            field: {70                xtype: "textfield"71            }72        }, {73            text: "门牌号3",74            dataIndex: "extField03",75            width:80,76            field: {77                xtype: "textfield"78            }79        }, {80            text: "门牌号4",81            dataIndex: "extField04",82            width:80,83            field: {84                xtype: "textfield"85            }86        }, {87            text: "门牌号5",88            dataIndex: "extField05",89            width:80,90            field: {91                xtype: "textfield"92            }93        }, {94            text: "网络状态",95            dataIndex: "roomNet",96            width:80,97            renderer: function(value) {98                switch (value) {99                    case '0':100                        return '<font color=green>有</font>';101                        break;102                    default:103                        return '<font color=red>无</font>';104                        break;105                }106            }107        }]108    }109    ...

Full Screen

Full Screen

HeXiaoList.js

Source:HeXiaoList.js Github

copy

Full Screen

1Ext.define('erp.view.as.port.HeXiaoList', {2	extend : 'Ext.Viewport',3	layout : 'anchor',4	hideBorders : true,5	initComponent : function() {6		var me = this;7		var store = new Ext.data.Store({8			fields : [ 'APPLYHEXIAO_NO', 'BACK_DAY', 'STORE_ID',9						'STORE_NAME', 'OBJECTIVE_STORE', 'APPLY_DATETIME',10						'APPLY_RESULT', 'APPLY_OP', 'INOUTNO', 'CLASS',11						'UPDATEMAN', 'UPDATEDATE' ],12				proxy : {13					type : 'ajax',14					url : basePath + 'as/port/getHexiaoList.action',15					reader : {16						type : 'json',17						root : 'target',18						totalProperty: 'totalCount'19					}20				},21				autoLoad : true,22				pageSize: parseInt((Ext.isIE ? screen.height*0.73 : window.innerHeight)*0.7/23)23			});24		Ext.apply(me, {25			items : [ {26				xtype : 'grid',27				anchor : '100% 100%',28				columnLines : true,29				id : 'grid',30				plugins: [Ext.create('erp.view.core.grid.HeaderFilter', {31					remoteFilter: true32				})],33				columns : [ {34					text : '申请单号',35					cls : 'x-grid-header-1',36					dataIndex : 'APPLYHEXIAO_NO',37					width : 180,38					filter: {39	    				xtype : 'textfield'40	    			}41				}, {42					text : '退回时间',43					cls : 'x-grid-header-1',44					dataIndex : 'BACK_DAY',45					width : 90,46					filter: {47	    				xtype : 'datefield'48	    			}49				}, {50					text : '网点编号',51					cls : 'x-grid-header-1',52					dataIndex : 'STORE_ID',53					width : 150,54					filter: {55	    				xtype : 'textfield'56	    			}57				}, {58					text : '网点名称',59					cls : 'x-grid-header-1',60					dataIndex : 'STORE_NAME',61					width : 80,62					filter: {63	    				xtype : 'textfield'64	    			}65				}, {66					text : '目标公司',67					cls : 'x-grid-header-1',68					dataIndex : 'OBJECTIVE_STORE',69					width : 80,70					filter: {71	    				xtype : 'textfield'72	    			}73				}, {74					text : '审核时间',75					cls : 'x-grid-header-1',76					dataIndex : 'APPLY_DATETIME',77					width : 90,78					filter: {79	    				xtype : 'datefield'80	    			}81				}, {82					text : '审核意见',83					cls : 'x-grid-header-1',84					dataIndex : 'APPLY_RESULT',85					width : 90,86					filter: {87	    				xtype : 'textfield'88	    			}89				}, {90					text : '审核人',91					cls : 'x-grid-header-1',92					dataIndex : 'APPLY_OP',93					width : 70,94					filter: {95	    				xtype : 'textfield'96	    			}97				}, {98					text : '出入库单号',99					cls : 'x-grid-header-1',100					dataIndex : 'INOUTNO',101					width : 110,102					filter: {103	    				xtype : 'textfield'104	    			}105				}, {106					text : '单据类型',107					cls : 'x-grid-header-1',108					dataIndex : 'CLASS',109					width : 100,110					filter: {111	    				xtype : 'textfield'112	    			}113				}, {114					text : '处理人',115					cls : 'x-grid-header-1',116					dataIndex : 'UPDATEMAN',117					width : 70,118					filter: {119	    				xtype : 'textfield'120	    			}121				}, {122					text : '处理时间',123					cls : 'x-grid-header-1',124					dataIndex : 'UPDATEDATE',125					width : 90,126					filter: {127	    				xtype : 'datefield'128	    			}129				} ],130				store : store,131				dockedItems: [{132			        xtype: 'pagingtoolbar',133			        store: store,134			        dock: 'bottom',135			        displayInfo: true136			    }]137			} ]138		});139		me.callParent(arguments);140	}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wd = require('wd');2var assert = require('assert');3var chai = require('chai');4var chaiAsPromised = require('chai-as-promised');5chai.use(chaiAsPromised);6var expect = chai.expect;7chaiAsPromised.transferPromiseness = wd.transferPromiseness;8var desired = {9};10var driver = wd.promiseChainRemote('localhost', 4723);11    .init(desired)12    .elementByAccessibilityId('Clear')13    .click()14    .elementByAccessibilityId('2')15    .click()16    .elementByAccessibilityId('Plus')17    .click()18    .elementByAccessibilityId('2')19    .click()20    .elementByAccessibilityId('Equals')21    .click()22    .elementByAccessibilityId('Display')23    .text()24    .then(function(text) {25        console.log(text);26        expect(text).to.equal('4');27    })28    .fin(function() { return driver.quit(); })29    .done();30console.log('Test completed');31var wd = require('wd');32var assert = require('assert');33var chai = require('chai');34var chaiAsPromised = require('chai-as-promised');35chai.use(chaiAsPromised);36var expect = chai.expect;37chaiAsPromised.transferPromiseness = wd.transferPromiseness;38var desired = {39};

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriverio = require('webdriverio');2var options = {3    desiredCapabilities: {4    }5};6    .remote(options)7    .init()8    .click('~textField')9    .setValue('~textField', 'Hello World')10    .getText('~textField')11    .then(function(text) {12        console.log('Text is: ' + text);13    })14    .end();

Full Screen

Using AI Code Generation

copy

Full Screen

1const wd = require('wd');2(async () => {3  await driver.init({4  });5  await driver.setImplicitWaitTimeout(10000);6  const textField = await driver.elementByAccessibilityId('textField');7  const text = await textField.text();8  console.log('text:', text);9})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const wd = require('wd');2require('colors');3const config = {4  capabilities: {5  }6};7const driver = wd.promiseChainRemote(config);8driver.init(config.capabilities)9  .then(() => {10    return driver.elementByAccessibilityId('1');11  })12  .then((element) => {13    return element.click();14  })15  .then(() => {16    return driver.elementByAccessibilityId('2');17  })18  .then((element) => {19    return element.click();20  })21  .then(() => {22    return driver.elementByAccessibilityId('3');23  })24  .then((element) => {25    return element.click();26  })27  .then(() => {28    return driver.elementByAccessibilityId('4');29  })30  .then((element) => {31    return element.click();32  })33  .then(() => {34    return driver.elementByAccessibilityId('5');35  })36  .then((element) => {37    return element.click();38  })39  .then(() => {40    return driver.elementByAccessibilityId('6');41  })42  .then((element) => {43    return element.click();44  })45  .then(() => {46    return driver.elementByAccessibilityId('7');47  })48  .then((element) => {49    return element.click();50  })51  .then(() => {52    return driver.elementByAccessibilityId('8');53  })54  .then((element) => {55    return element.click();56  })57  .then(() => {58    return driver.elementByAccessibilityId('9');59  })60  .then((element) => {61    return element.click();62  })63  .then(() => {64    return driver.elementByAccessibilityId('0');65  })66  .then((element) => {67    return element.click();68  })69  .then(() => {70    return driver.elementByAccessibilityId('Add');71  })

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriver = require('selenium-webdriver');2var driver = new webdriver.Builder()3.forBrowser('safari')4.build();5driver.findElement(webdriver.By.className('gLFyf')).then(function(element) {6});7driver.quit();8var webdriver = require('selenium-webdriver');9var driver = new webdriver.Builder()10.forBrowser('safari')11.build();12driver.findElement(webdriver.By.className('gLFyf')).then(function(element) {13});14driver.quit();15var webdriver = require('selenium-webdriver');16var driver = new webdriver.Builder()17.forBrowser('safari')18.build();19driver.findElement(webdriver.By.className('gLFyf')).then(function(element) {20});21driver.quit();22var webdriver = require('selenium-webdriver');23var driver = new webdriver.Builder()24.forBrowser('safari')25.build();26driver.findElement(webdriver.By.className('gLFyf')).then(function(element) {27});28driver.quit();

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('Test to get text from a text field', function() {2    it('should get the text from the text field', function() {3        var textField = browser.element('input[type="text"]');4        var text = textField.getText();5        console.log(text);6    });7});8exports.config = {9    capabilities: [{10    }],11    mochaOpts: {12    }13};14var text = browser.getText('input[type="text"]');15var text = browser.element('input[type="text"]').getText();16var text = browser.element('input[type="text"]').getText();17var text = browser.element('

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Appium Xcuitest Driver automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Sign up Free
_

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful