summaryrefslogtreecommitdiff
path: root/py-fake-service/features/step_definitions/tag_list.rb
blob: 678f5ce9e59087d3eb84d430ff4c77e7df2c1687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
When(/^I select the tag '(.*)'$/) do |tag|
  wait_for_user_alert_to_disapear # in Chrome, the 'flash message is on top of the toggle
  first('.left-off-canvas-toggle').click
  page.execute_script("window.scrollBy(0, -200)")
  within('#tag-list') { find('li', text: /#{tag}/i).click }
end

def wait_for_user_alert_to_disapear
  begin
    while find('#user-alerts')
      sleep 0.1
    end
  rescue #if it couldn't find it, go ahead
  end
end