Skip to content

Commit

Permalink
Remove deprecated method Spree::TestingSupport::CapybaraExt.fill_in_q…
Browse files Browse the repository at this point in the history
…uantity and Spree::TestingSupport::CapybaraExt.wait_for_ajax

ref solidusio@f8fe5c6
and
solidusio@80abce4
  • Loading branch information
DanielePalombo authored and kennyadsl committed Jan 19, 2021
1 parent 32fc2af commit 27abcee
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions core/lib/spree/testing_support/capybara_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ def column_text(num)
find("td:nth-of-type(#{num})").text
end

def fill_in_quantity(table_column, selector, quantity)
Spree::Deprecation.warn <<-WARN.strip_heredoc
fill_in_quantity is deprecated. Instead use:
within(#{table_column.inspect}) do
fill_in #{selector.inspect}, with: #{quantity.inspect}
end
WARN
within(table_column) do
fill_in selector, with: quantity
end
end

def select2_search(value, options)
options = {
search: value, # by default search for the value
Expand Down Expand Up @@ -122,21 +110,6 @@ def find_label_by_text(text)
# find the original.
find('label:not(.select2-offscreen)', text: /#{Regexp.escape(text)}/i, match: :one)
end

def wait_for_ajax
Spree::Deprecation.warn <<-WARN.squish, caller
wait_for_ajax has been deprecated.
Please refer to the capybara documentation on how to properly wait for asyncronous behavior:
https://github.com/teamcapybara/capybara#asynchronous-javascript-ajax-and-friends
WARN

counter = 0
while page.evaluate_script("typeof($) === 'undefined' || $.active > 0")
counter += 1
sleep(0.1)
raise "AJAX request took longer than 5 seconds." if counter >= 50
end
end
end
end
end
Expand Down

0 comments on commit 27abcee

Please sign in to comment.