summaryrefslogtreecommitdiff
path: root/fake-service/features/step_definitions/tag_list.rb
diff options
context:
space:
mode:
Diffstat (limited to 'fake-service/features/step_definitions/tag_list.rb')
-rw-r--r--fake-service/features/step_definitions/tag_list.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/fake-service/features/step_definitions/tag_list.rb b/fake-service/features/step_definitions/tag_list.rb
new file mode 100644
index 00000000..678f5ce9
--- /dev/null
+++ b/fake-service/features/step_definitions/tag_list.rb
@@ -0,0 +1,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