mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
Remove workaround in failing feature spec
Removed an old workaround that clicked a button multiple times. This was no longer working and causing the spec to fail.
This commit is contained in:
@@ -88,7 +88,7 @@ feature %q{
|
||||
quick_login_as_admin
|
||||
visit '/admin/orders'
|
||||
|
||||
click_edit
|
||||
click_icon :edit
|
||||
|
||||
targetted_select2_search @product.name, from: '#add_variant_id', dropdown_css: '.select2-drop'
|
||||
|
||||
@@ -111,7 +111,7 @@ feature %q{
|
||||
uncheck 'Only show complete orders'
|
||||
page.find('a.icon-search').click
|
||||
|
||||
click_edit
|
||||
click_icon :edit
|
||||
|
||||
select2_select d.name, from: 'order_distributor_id'
|
||||
select2_select oc.name, from: 'order_order_cycle_id'
|
||||
@@ -336,21 +336,4 @@ feature %q{
|
||||
expect(o.order_cycle).to eq order_cycle1
|
||||
end
|
||||
end
|
||||
|
||||
# Working around intermittent click failing
|
||||
# Possible causes of failure:
|
||||
# - the link moves
|
||||
# - the missing content (font icon only)
|
||||
# - the screen is not big enough
|
||||
# However, some operations before the click or a second click on failure work.
|
||||
#
|
||||
# A lot of people had similar problems:
|
||||
# https://github.com/teampoltergeist/poltergeist/issues/520
|
||||
# https://github.com/thoughtbot/capybara-webkit/issues/494
|
||||
def click_edit
|
||||
click_result = click_icon :edit
|
||||
unless click_result['status'] == 'success'
|
||||
click_icon :edit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user