Sha256: fef9769f468e9a32b88f7e23985d225128aa260b7ecee35e7fc3d121d493209d

Contents?: true

Size: 720 Bytes

Versions: 4

Compression:

Stored size: 720 Bytes

Contents

module Pages
  class PropertySearch
    include Capybara::DSL

    # based on:
    # https://code.tutsplus.com/articles/ruby-page-objects-for-capybara-connoisseurs--cms-25204
    def search_rentals(min_price)
      # Capybara.ignore_hidden_elements = false
      # passing visible: false below would be like setting above
      select(min_price, from: 'search_for_rent_price_from', visible: false)
      click_button('Search')
    end

    def has_search_result_count?(expected_count)
      has_css?(".property-item", count: expected_count)
      # search_result_list.count.eql? expected_count
    end

    private

    def search_result_list
      # find(".property-item")
      all(".property-item")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pwb-1.3.0 spec/support/features/pages/property_search.rb
pwb-1.2.0 spec/support/features/pages/property_search.rb
pwb-1.1.1 spec/support/features/pages/property_search.rb
pwb-1.0.0 spec/support/features/pages/property_search.rb