2017-10-09 6 views
0

textfieldを入力してからをクリックしてください。をBryntum Siesta Testでクリックしてください。全体のテストプロセスが成功してきただけ「保存」ボタンは、このクリックイベントに応答せず、続けてこう述べています。Ext.buttonのクリックイベントがBryntum Siesta Testのレスポンスではありません

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を使用しました。を保存しました。ボタンをラップしています。また、私はclickイベントを自分で呼び出そうとしましたが、エラーも発生します:Wait for button[id=button-1104] to appearと失敗です。

ボタンはすでに可視でラップされています。DOM要素はフォームデータ(ラベルとテキストフィールドを含む)とdatatoolbar(ボタンを含む)です。

enter image description here

+2

。 – Alexander

+0

ありがとうございます@Alexanderを示してください。私は堅実な方法でクエリをリファクタリングします。 –

答えて

2

すでにコメントで述べたように(それが自動生成されたIDを使用しているため)、原因はおそらくちょうど不安定なクエリです。

エラーメッセージ Waited too long for: componentQuery "datatoolbar[id=datatoolbar-1100]" は、シエスタが指定されたコンポーネントクエリを実行していたが、結果が返されなかったことを示します。代わりに、自動生成されたIDの

、あなたがターゲットとしているツールバーのより安定した特定の属性を使用しよう:datatoolbar[specificAttr=value]彼らは簡単に変更することができますので、あなたは、あなたのテストで自動生成されたIDに頼るべきではありません

+0

親愛なる@SamuraiJack何とかそのidプロパティは同じままです - ボタン - 1104しかし、あなたが言及したように、私は別の特定のプロパティを使用し、今は動作します。どうもありがとう。 –

関連する問題