いくつかの UI テストを開発しています (Phantom.js 構成で実行)
たとえば、テスト自体は非常に単純です (以下のサンプル コードを参照してください)。
- ページをブラウズします - 予想されるタイトルが正しいことを確認します
ボタン/項目をクリックしてリストから項目を選択します。正確な項目が選択されていることを確認してください。
module.exports = { 'NodeCeller home page': function (test) { test .open('http://localhost:3000') .assert.title().is('Node Cellar', 'Node Cellar is now open') .done(); }, 'NodeCeller Start Browsing Click': function (test) { test .click('a[href="#wines"]') .assert.url('http://localhost:3000/#wines', 'Showing wines selection') .done(); }, 'NodeCellar Browse First Wine': function (test) { test .click('#content > div > ul > li > a') .assert.text('legend','Wine Details', 'Showing Wines Details') .done(); }, };
私の質問はこれです。同じ一連のテストをループで数回実行したいと思います。Dalek.JS のヘルプとサンプルをグーグルで検索しましたが、その方法に関するサンプルや記事は見つかりませんでした。
どんな助けでも大歓迎です