【发布时间】:2014-07-15 11:09:16
【问题描述】:
我们的测试团队要求在我们的消息弹出框中的 HTML 元素上设置 ID 或类值。这是为了他们的自动化测试。
我可以通过传入一个 cls 值来为对话框面板传入一个类值,如下所示:
Ext.Msg.show({ title:'Reset Grid Layout', msg: 'Are you sure that you want to reset the grid layout?', cls:'Reset-Grid-Layout-Message', buttons: Ext.Msg.YESNO, fn: function (response) { if (response == 'yes') { } }, icon: Ext.window.MessageBox.QUESTION });
现在我们还需要在按钮上以及正在显示的文本上使用它。有没有办法在按钮上获得 cls 值?
我在想也许可以将按钮参数扩展成类似的东西:
buttons : [{name:'but1', cls:'asdf'}, {name:'but2', cls:'asdf2'}]
但谷歌并没有给我任何有用的东西。
【问题讨论】: