我試圖填充textfield
,然後運行單擊事件與Bryntum午睡測試。整個測試過程已經成功,但只有「保存」按鈕不響應這個點擊事件,並保持說:Ext.button的點擊事件不是響應與Bryantum Siesta測試
Waited too long for: componentQuery "datatoolbar[id=datatoolbar-1100]"
Failed assertion `waitForComponentQuery`
Condition was not fullfilled during 10000ms
如何運行單擊事件與Bryntum午睡可見的按鈕?
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: '[email protected]', 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 :-)'}
)
})
})
這裏是數據形和測試片段的屏幕截圖。正如你會注意到以上,我用waitForCQ
爲datatoolbar
被包裹保存按鈕。此外,我已經試過調用click事件byself但gaves錯誤,以及:Wait for button[id=button-1104] to appear
並且是失敗的。
按鈕是已經visiable幷包裹DOM元素是FORMDATA(包括標籤和文本框),並datatoolbar(包括按鈕)。
你不應該依賴於你的測試自動生成的ID,因爲他們可以很容易地改變。 – Alexander
感謝您指示@Alexander。我會以堅實的方式重構查詢。 –