From 06abdce180f80726b672cc61fe6cdd02b76c4b78 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Tue, 5 Jul 2011 15:33:34 -0700 Subject: [PATCH] Use explicit classes in the hover step definition --- features/comments.feature | 2 +- features/follows_tags.feature | 1 + features/posts.feature | 4 ++-- features/step_definitions/custom_web_steps.rb | 9 ++------- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/features/comments.feature b/features/comments.feature index 1cd419832..2c76af13a 100644 --- a/features/comments.feature +++ b/features/comments.feature @@ -46,7 +46,7 @@ Feature: commenting And I fill in "Comment" with "is that a poodle?" And I press "Comment" And I wait for the ajax to finish - When I hover over the comment + When I hover over the ".comment.posted" And I preemptively confirm the alert And I click to delete the first comment And I wait for the ajax to finish diff --git a/features/follows_tags.feature b/features/follows_tags.feature index 6271ffed2..c49edec96 100644 --- a/features/follows_tags.feature +++ b/features/follows_tags.feature @@ -36,6 +36,7 @@ Feature: posting Then I should see "I am da #boss" Scenario: can stop following a particular tag + When I hover over the ".button.tag_following" When I press "Stop Following #boss" And I go to the home page diff --git a/features/posts.feature b/features/posts.feature index 0973aa386..74b9f024e 100644 --- a/features/posts.feature +++ b/features/posts.feature @@ -63,7 +63,7 @@ Feature: posting And I sign in as "alice@alice.alice" And I am on "bob@bob.bob"'s page - And I hover over the post + And I hover over the ".stream_element" And I click to delete the first post And I wait for the ajax to finish And I go to "bob@bob.bob"'s page @@ -77,7 +77,7 @@ Feature: posting And I press "Share" And I wait for the ajax to finish And I follow "Your Aspects" - And I hover over the post + And I hover over the ".stream_element" And I preemptively confirm the alert And I click to delete the first post And I wait for the ajax to finish diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index cb8548963..5b23c1ed8 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -36,13 +36,8 @@ When /^I append "([^"]*)" to the publisher$/ do |stuff| end end -And /^I hover over the (\w*)$/ do |element| - if element == 'post' - name = 'stream_element' - elsif element == 'comment' - name = 'comment.posted' - end - page.execute_script("$(\".#{name}\").first().mouseover()") +And /^I hover over the "([^"]+)"$/ do |element| + page.execute_script("$(\"#{element}\").first().mouseover()") end When /^I click to delete the first post$/ do