4

Cucumber、capybara、capybara-webkit、selenium-webdriver、rspec、および jasmine を使用して、Rails 3.2.8 上で実行されるバックボーン アプリケーションをテストしようとしています。バックボーン テンプレートのテンプレート エンジンとして eco を使用しています。

私の問題は、@javascript タグを使用してシナリオを実行すると、capybara-webkit または selenium を使用して、表示されるページにすべてのモデル属性データが含まれていないことです。

シナリオは次のとおりです。

@javascript
Scenario : first scenario
     Given There is Model with "name" as name and "What is it about ?" as associated questions
     When I want to fill the questionnaire
     Then I should be on the SPA form
     And I should see "name"
     And I should see "What is it about?"

シナリオは「それは何ですか?」のステップで失敗し、ページには質問が表示されませんが、「名前」が表示されます。モデルがすべての属性で正しいことがわかります。またライブでも問題なく動作しております

テンプレートは次のようになります: 'show.jst.eco'

<p class="text-info"><%= @model.name %></p>

<form id="quidget-form" class="form-vertical">
  <% for question in @model.questions: %>
    <div class="issue_field">
      <label class="string optional control-label"><%= question.question.question_text %></label>
      <div class="control-group text">
        <textarea class="text answer" name="question-<%= question.question.id %>" id="question_<%= question.question.id %>" data-question="<%= question.question.question_text %>" rows="3">
        </textarea>
      </div>
    </div>
  <% end %>

  <div class="controls">
    <input type="submit" value="Additional Informations" id="quidget-step-one" class="btn btn-success">


テキストエリアは表示されますが、上の質問テキストのラベルは表示されません

何か案が ?より多くのステップでより複雑なロジックをテストできるように、このパスを確認したいと思います。

ありがとう

4

1 に答える 1