From 9b4c97f490488e505bd52305e24035868041969f Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Tue, 5 Mar 2013 14:21:01 -0300 Subject: [PATCH] Fixed some selenium tests that were failing --- features/approve_article.feature | 12 ++++++------ features/chat.feature | 12 ++++++------ features/edit_article.feature | 2 +- features/gallery_navigation.feature | 3 ++- features/manage_inputs.feature | 2 +- features/manage_product_price_details.feature | 3 ++- features/step_definitions/custom_web_steps.rb | 2 +- features/support/selenium.rb | 2 ++ 8 files changed, 21 insertions(+), 17 deletions(-) diff --git a/features/approve_article.feature b/features/approve_article.feature index 129a4bb..90a117d 100644 --- a/features/approve_article.feature +++ b/features/approve_article.feature @@ -22,7 +22,7 @@ Feature: approve article @selenium-fixme Scenario: edit an article before approval Given I am logged in as "mariasilva" - And I am on Maria Silva's homepage + And I am on mariasilva's homepage When I follow "Spread" And I check "Sample Community" And I press "Spread this" @@ -32,14 +32,14 @@ Feature: approve article And I fill in "Text" with "This is an article edited" And I choose "Accept" And I press "Apply!" - And I go to Sample Community's sitemap + And I go to sample-community's sitemap And I follow "Sample Article" Then I should see "This is an article edited" @selenium Scenario: reject an article with explanation Given I am logged in as "mariasilva" - And I go to Maria Silva's cms + And I go to mariasilva's cms And I follow "Sample Article" And I follow "Spread" And I check "Sample Community" @@ -50,10 +50,10 @@ Feature: approve article And I choose "Reject" And I fill in "Rejection explanation" with "This is not an appropriate article for this community." And I press "Apply!" - When I go to Sample Community's sitemap + When I go to sample-community's sitemap Then I should not see "Sample Article" - @selenium-fixme + @selenium Scenario: reject an article that was removed Given I am logged in as "mariasilva" And I follow "Dub Wars" @@ -61,7 +61,7 @@ Feature: approve article And I check "Sample Community" And I press "Spread this" And I follow "Delete" - And I press "Yes, I want." + And I confirm the browser dialog When I am logged in as "joaosilva" And I go to sample-community's control panel And I follow "Process requests" diff --git a/features/chat.feature b/features/chat.feature index 469d381..c7fae96 100644 --- a/features/chat.feature +++ b/features/chat.feature @@ -92,13 +92,13 @@ Feature: chat And I am logged in as "tame" And I follow "Open chat" When I select window "noosfero_chat" - Then the "#chat-online" should not be visible - And the "#chat-busy" should not be visible - And the "#chat-disconnect" should not be visible + Then "Online" should not be visible within "#user-status" + And "Busy" should not be visible within "#user-status" + And "Sign out of chat" should not be visible within "#user-status" When I follow "Offline" - Then the "#chat-connect" should be visible - And the "#chat-busy" should be visible - And the "#chat-disconnect" should be visible + Then "Online" should be visible within "#user-status" + And "Busy" should be visible within "#user-status" + And "Sign out of chat" should be visible within "#user-status" @selenium Scenario: link to open chatroom of a community diff --git a/features/edit_article.feature b/features/edit_article.feature index 88a29b5..39f04d6 100644 --- a/features/edit_article.feature +++ b/features/edit_article.feature @@ -90,7 +90,7 @@ Feature: edit article Scenario: cancel button back to article when edit Given I am on joaosilva's sitemap When I follow "Save the whales" - And I follow "Edit" + And I follow "Edit" within "#article-actions" And I follow "Cancel" Then I should be on /joaosilva/save-the-whales diff --git a/features/gallery_navigation.feature b/features/gallery_navigation.feature index b61264c..7c10f2c 100644 --- a/features/gallery_navigation.feature +++ b/features/gallery_navigation.feature @@ -72,7 +72,8 @@ Feature: gallery_navigation Scenario: image title in window title Given I am logged in as "marciopunk" When I go to /marciopunk/other-gallery/rails.png?view=true + And the page title should be "rails.png" And I follow "Edit" And I fill in "Title" with "Rails is cool" And I press "Save" - Then I should see "Rails is cool" within "title" + Then the page title should be "Rails is cool" diff --git a/features/manage_inputs.feature b/features/manage_inputs.feature index 9c4d5ea..ade7ca6 100644 --- a/features/manage_inputs.feature +++ b/features/manage_inputs.feature @@ -215,7 +215,7 @@ Feature: manage inputs Then I should see "Rock" And I should not see "Add the inputs or raw material used by this product" When I follow "Remove" - And I confirm + And I confirm the browser dialog Then I should see "Add the inputs or raw material used by this product" @selenium diff --git a/features/manage_product_price_details.feature b/features/manage_product_price_details.feature index 5418ee4..3f0fc73 100644 --- a/features/manage_product_price_details.feature +++ b/features/manage_product_price_details.feature @@ -105,6 +105,7 @@ Feature: manage product price details And I select "Taxes" from "price_details__production_cost_id" within "#display-product-price-details" And I fill in "$" with "20.00" And I press "Save" + And I should be on Rede Moinho's page of product Abbey Road Then I should see "Inputs" within ".price-detail-name" And I should see "60.0" within ".price-detail-price" @@ -142,7 +143,7 @@ Feature: manage product price details And I follow "Describe here the cost of production" And I should see "Taxes" within "#manage-product-details-form" When I follow "Remove" within "#manage-product-details-form" - And I confirm + And I confirm the browser dialog And I press "Save" And I follow "Describe here the cost of production" Then I should not see "Taxes" within "#manage-product-details-form" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index e693537..737b5c9 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -41,6 +41,6 @@ When /^I leave the "([^\"]+)" field$/ do |selector| page.execute_script "jQuery('#{selector}').trigger('blur')" end -When /^I confirm$/ do +When /^I confirm the browser dialog$/ do page.driver.browser.switch_to.alert.accept end diff --git a/features/support/selenium.rb b/features/support/selenium.rb index 4620676..6467abe 100644 --- a/features/support/selenium.rb +++ b/features/support/selenium.rb @@ -20,6 +20,8 @@ Before('@ignore-hidden-elements') do Capybara.ignore_hidden_elements = true end +Capybara.default_wait_time = 30 + After do DatabaseCleaner.clean end -- libgit2 0.21.2