From 112285d42370028e28dec4eec75e7a2a68f87056 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 7 May 2013 21:16:10 +0200 Subject: fix visibility test --- tests/acceptance/features/create_new.feature | 7 ++++++- .../acceptance/features/step_definitions/create_new_steps.rb | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3