Testing Ext.button';s click事件不是Bryntum午睡测试的响应
我正在尝试填充Testing Ext.button';s click事件不是Bryntum午睡测试的响应,testing,extjs,click,sencha-cmd,siesta,Testing,Extjs,Click,Sencha Cmd,Siesta,我正在尝试填充文本字段,然后使用Bryntum Siesta测试运行单击事件。整个测试过程已成功,但只有“保存”按钮未响应此单击事件,并显示: Waited too long for: componentQuery "datatoolbar[id=datatoolbar-1100]" Failed assertion `waitForComponentQuery` Condition was not fullfilled during 10000ms 如何使用Bryntum Siesta运行
文本字段
,然后使用Bryntum Siesta测试运行单击事件。整个测试过程已成功,但只有“保存”按钮未响应此单击事件,并显示:
Waited too long for: componentQuery "datatoolbar[id=datatoolbar-1100]"
Failed assertion `waitForComponentQuery`
Condition was not fullfilled during 10000ms
如何使用Bryntum Siesta运行可视按钮的单击事件
Test.js
describe('Testing Update Process', function (t) {
t.it('Should to login with correct creds.', function (t) {
t.chain(
{waitForCQ: 'window[title=Login]'},
{click: '>> textfield[itemId=userName]'},
{type: 'user@name.com', target:'>> textfield[itemId=userName]'},
{click: '>> textfield[name=password]'},
{type: 'superSecretPass', target:'>> textfield[name=password]'},
{click: '>> button[text=Submit]', desc: 'Submit process is succeed!'}
)
})
t.it('Login window should be invisible', function (t) {
t.chain(
{waitForCQNotVisible: 'window[title=Login]', desc: 'Login window is hidden now!'}
)
})
t.it('Should open Folio grid', function (t) {
t.chain(
{waitForCQ: 'treelist[itemId=navigationTreeList]', desc: 'Wait for treelist'},
{click: '>> treelistitem[id=ext-treelistitem-6]', desc: 'Clicks Folio item'},
{waitForCQ: 'treelistitem[id=ext-treelistitem-7]', desc: 'Wait for treelist sub-item: Folios'},
{click: '>> treelistitem[id=ext-treelistitem-7]', desc: 'Clicks Folios'}
)
})
t.it('Should click on Edit button', function (t) {
t.chain(
{waitForCQ: 'gridview[id=gridview-1067]'},
{click: '>> button[id=button-1087]', desc: 'Clicks on Edit button'}
)
})
t.it('Should update Client Name', function (t) {
t.chain(
{click: '>> textfield[name=clientname]'},
{type: 'Siesta Testing for Update', target: '>> textfield[name=clientname]', desc: 'Types lorem ipsum data'}
)
})
//This last part is giving error and test becomes failure.
t.it('Should Save the last changes', function (t) {
t.chain(
{waitForCQ: 'datatoolbar[id=datatoolbar-1100]'},
{click: '>> button[id=button-1104]', desc: 'Clicks on Save, All Succeed :-)'}
)
})
})
下面是dataform和测试片段的屏幕截图。正如您在上面所注意到的,我使用了waitForCQ
作为datatoolbar
,它被Save按钮包装起来。我也尝试过自己调用click事件,但它也会产生错误:等待按钮[id=button-1104]出现,并且失败
按钮已经可见,包装的DOM元素是formdata(包括标签和文本字段)和datatoolbar(包括按钮)
如评论中所述,原因可能只是一个不稳定的查询(因为它使用自动生成的ID)
错误消息
等待时间过长:componentQuery“datatoolbar[id=datatoolbar-1100]”
指示Siesta正在运行指定的组件查询,但没有为其返回任何结果
不要使用自动生成的ID,而是尝试使用目标工具栏的更稳定、更具体的属性:datatoolbar[specificAttr=value]
正如注释中已经指出的,原因可能只是一个不稳定的查询(因为它使用自动生成的ID)
错误消息
等待时间过长:componentQuery“datatoolbar[id=datatoolbar-1100]”
指示Siesta正在运行指定的组件查询,但没有为其返回任何结果
不要使用自动生成的ID,而是尝试使用目标工具栏的更稳定、更具体的属性:datatoolbar[specificAttr=value]
您不应该在测试中依赖自动生成的ID,因为它们很容易更改。感谢指示@Alexander。我将以可靠的方式重构查询。您不应该在测试中依赖自动生成的ID,因为它们很容易更改。感谢@Alexander。亲爱的@SamuraiJack,不知怎么的,id属性仍然保持不变——button-1104,但正如您所提到的,我使用了另一个特定属性,现在它可以工作了。非常感谢。亲爱的@SamuraiJack,不知怎的,id属性仍然保持不变——button-1104,但正如您所提到的,我使用了另一个特定属性,现在它可以工作了。谢谢。