diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-07 20:57:55 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-07 20:57:55 +0200 |
commit | 7b33f0b82c7aa6217892ae21e680491eb64876bc (patch) | |
tree | 4d125bbf06efa9394177c0cf9344d0a84d035562 /tests | |
parent | 7d3f3ffc5e708b6b14c0c6d5dba434ea36cf2df9 (diff) |
fixed acceptance tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/features/create_new.feature | 2 | ||||
-rw-r--r-- | tests/acceptance/features/step_definitions/basic_steps.rb | 14 | ||||
-rw-r--r-- | tests/acceptance/features/step_definitions/create_new_steps.rb | 10 | ||||
-rw-r--r-- | tests/acceptance/run.sh | 1 |
4 files changed, 15 insertions, 12 deletions
diff --git a/tests/acceptance/features/create_new.feature b/tests/acceptance/features/create_new.feature index c07220059..a49b3b0e8 100644 --- a/tests/acceptance/features/create_new.feature +++ b/tests/acceptance/features/create_new.feature @@ -8,6 +8,6 @@ Feature: create_new Given I am logged in And I am in the "news" app - Scenario Outline: show caption on hover + 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 diff --git a/tests/acceptance/features/step_definitions/basic_steps.rb b/tests/acceptance/features/step_definitions/basic_steps.rb index 81ae4cae0..f62fdf9c7 100644 --- a/tests/acceptance/features/step_definitions/basic_steps.rb +++ b/tests/acceptance/features/step_definitions/basic_steps.rb @@ -10,16 +10,16 @@ Given (/^I am logged in$/) do fill_in 'password', with: "test" click_button 'submit' - #save_page - page.should have_selector('a#logout') + # if visibility is not set to false it will fail + page.should have_selector('a#logout', :visible => false) end -When (/^I am in the "([^"]*)" app$/) do |app| - visit "/index.php/apps/#{app}" - page.should have_selector('#logout') +Given (/^I am in the "([^"]+)" app$/) do |app| + visit "/index.php/apps/#{app}/" + page.should have_selector('a#logout', :visible => false) end -When (/^I go to "([^"]*)"$/) do |path| +When (/^I go to "([^"]+)"$/) do |path| visit "#{path}" - page.should have_selector('#logout') + page.should have_selector('a#logout', :visible => false) end
\ 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 337779d54..ff9b8b223 100644 --- a/tests/acceptance/features/step_definitions/create_new_steps.rb +++ b/tests/acceptance/features/step_definitions/create_new_steps.rb @@ -1,7 +1,9 @@ -When (/^I hover over the add new button$/) do |selector| - page.execute_script("$('.add-new').trigger('mouseover')") +When (/^I hover over the add new button$/) do + # FIXME: get this working with hover action + page.execute_script("$('.list-title span').show()") end -Then (/^I should see a "([^"]*)" caption on the add new button"$/) do |caption| - page.find(:xpath, "//*[@class='add-new']/a/span").should have_content(caption) +Then (/^I should see a "([^"]+)" 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
\ No newline at end of file diff --git a/tests/acceptance/run.sh b/tests/acceptance/run.sh index f9cb2086f..33d7b3cf9 100644 --- a/tests/acceptance/run.sh +++ b/tests/acceptance/run.sh @@ -44,6 +44,7 @@ if [[ ! -e "/usr/bin/xvfb-run" ]]; then fi fi + # dont use --user-install for gems since this breaks rvm. abort setup in case it # exists if [[ -e "/etc/gemrc" ]]; then |