测试extjs应用程序 [英] Testing extjs apps
问题描述
如果组件或组合部件(如网格中)有预先标记的ID,那么我如何测试extjs应用程序。
我可以为每个组件添加ID,但是如果我想念一个或多个组件,而且应用程序是大而复杂的?
/ p> ExtJS / Siesta中有一个函数或某个模块,它允许您定位应用程序中的组件/元素,而不依赖于每个组件的预定义ID。
首先,使用组件上的ID非常小心。我已经看到我们公平分享的问题。
其次,ExtJS提供了几种定位组件和元素的方法。不要混用两个。
对于组件:
- Ext.getCmp (id)
- Ext.ComponentQuery .query()
- up()
- down()
- < a href =http://docs.sencha.com/ext-js/4-1/#!/api/Ext.AbstractComponent-method-nextSibling =nofollow noreferrer> nextSibling()
- previousSibling()
- child()
- previousNode()
加各种 find ..
方法
对于元素: / p>
更多关于DOM查询 http://docs.sencha .com / core / manual / content / domquery.html
How can I test extjs application when there are pregerated ids for components or compoent parts like in a grid.
I can add ids to each component but what if I miss one or more, and the application is big and complex?
Is there a function or some module in ExtJS/Siesta which allows you to locate components/elements in the application without beign dependent on predefined ids for each component
First of all be very careful using IDs on the components. I have seen my fair share of problems with them.
Second, ExtJS provides several ways of targeting Components and Elements. Don't mix the two.
For Components:
- Ext.getCmp(id)
- Ext.ComponentQuery.query()
- up()
- down()
- nextSibling()
- previousSibling()
- child()
- previousNode()
plus various find..
methods
For Elements:
more on DOM Query http://docs.sencha.com/core/manual/content/domquery.html
这篇关于测试extjs应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!