diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-07 21:16:10 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-07 21:16:10 +0200 |
commit | 112285d42370028e28dec4eec75e7a2a68f87056 (patch) | |
tree | 27c16be73ce505e6df1785a6c8729d3d4e63560f /tests/acceptance | |
parent | 7b33f0b82c7aa6217892ae21e680491eb64876bc (diff) |
fix visibility test
Diffstat (limited to 'tests/acceptance')
-rw-r--r-- | tests/acceptance/features/create_new.feature | 7 | ||||
-rw-r--r-- | tests/acceptance/features/step_definitions/create_new_steps.rb | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/acceptance/features/create_new.feature b/tests/acceptance/features/create_new.feature index a49b3b0e8..9f3a7be78 100644 --- a/tests/acceptance/features/create_new.feature +++ b/tests/acceptance/features/create_new.feature @@ -10,4 +10,9 @@ Feature: create_new Scenario: show caption on hover When I hover over the add new button - Then I should see a "Add Website" caption on the add new button
\ No newline at end of file + Then I should see an "Add Website" caption on the add new button + + Scenario: hide caption when not hover + Given I hover over the add new button + When I hover out of the add new button + Then I should not see an "Add Website" caption on the add new button
\ No newline at end of file diff --git a/tests/acceptance/features/step_definitions/create_new_steps.rb b/tests/acceptance/features/step_definitions/create_new_steps.rb index ff9b8b223..40540b4b8 100644 --- a/tests/acceptance/features/step_definitions/create_new_steps.rb +++ b/tests/acceptance/features/step_definitions/create_new_steps.rb @@ -3,7 +3,16 @@ When (/^I hover over the add new button$/) do page.execute_script("$('.list-title span').show()") end -Then (/^I should see a "([^"]+)" caption on the add new button$/) do |caption| +When (/^I hover out of the add new button$/) do + # FIXME: get this working with hover action + page.execute_script("$('.list-title span').hide()") +end + +Then (/^I should see an "([^"]+)" caption on the add new button$/) do |caption| button = page.find(:xpath, "//li[contains(@class,\"add-new\")]/a/span[1]") button.should have_content(caption) +end + +Then (/^I should not see an "([^"]+)" caption on the add new button$/) do |caption| + page.should have_no_selector(:xpath, "//li[contains(@class,\"add-new\")]/a/span[1]") end
\ No newline at end of file |