Vue未装入测试(黄瓜/水豚)

问题描述 投票:0回答:1

我正在测试包含黄瓜vue对象的RoR应用程序。一切都在浏览器中很好,但在测试中没有加载vue。我试图增加水豚的等待时间,但它没有用。请指点我。

我明白了:here is how the page looks in test

我想测试的代码是

#student_profiles.nomargin
  = render "header"
  .container-fluid.nopadding
    .student_count.aside-wrap.rounded-corners
      %text v-bind:students-count="studentsCount"
      %p.text Sie können aktuell aus <b>{{studentsCount.count}}</b> 
      Schülerinnen und Schülern aus bis zu 50 Ländern wählen.</p>
    .filters.aside-wrap
      %h4 Verfeinern Sie Ihre Auswahl durch Filtern: <filters :filters="filters" :filter-params="filterParams" :load-limit="loadLimit" :students="students" :counter="counter" :hobbies="hobbies" :update="update" :filter-loaded="filterLoaded"></filters>
      %br
      %text v-bind:students-count="studentsCount"
      %p.text Es werden <b>{{studentsCount.count_filter}}</b> von <b>{{studentsCount.count}}</b> angezeigt.</p>
      %br

我使用的步骤是:

@javascript
Scenario: Happy path to bla-bla
  Given I am on a mobile device
  Given I have '6' students shown in the app
  And I visit 'url'
  And I wait for the ajax request to finish
  Then I should see "6" within ".student_count"

对于步骤Given I have '6' students shown in the app我有以下步骤定义。

Given(/^I have '(\d+)' students shown in the app$/) do |student_count|
  student_count.to_i.times do
    student = FactoryBot.create(:ib_student)
    FactoryBot.create(:ib_student_profile, student: student, force_profile_visible: true)
  end
end
javascript ruby-on-rails ruby vuejs2 cucumber
1个回答
0
投票

对我有用的是将整个测试套件切换到Selenium headless-chrome而不是Poltergeist / Phantom JS。

© www.soinside.com 2019 - 2024. All rights reserved.