Commit 2ceaba7c79c6eb1dd7cca33770174f0e8d4c4038

Authored by Rodrigo Souto
1 parent 657502e0

Fixed test: features/edit_article.feature

Some tests were breaking because since Selenium Driver 2, hidden
elements aren't available for interaction. However some elements started
to get unaccessible because some depend on hover on other elements and
the current version of Capybara doesn't support hover yet.

Avoid interaction with hidden elements is nice, but for the sake of
having the tests running while there isn't any touchable way of
displaying those elements through adequate methods, I'm overriding this
behaviour of Selenium Driver 2 with: Capybara.ignore_hidden_elements =
true.
features/edit_article.feature
... ... @@ -94,7 +94,7 @@ Feature: edit article
94 94 And I follow "Cancel"
95 95 Then I should be on /joaosilva/save-the-whales
96 96  
97   - @selenium-fixme
  97 + @selenium
98 98 Scenario: create an article inside a folder
99 99 Given I am on joaosilva's control panel
100 100 When I follow "Manage Content"
... ... @@ -110,7 +110,7 @@ Feature: edit article
110 110 Then I should see "My Article"
111 111 And I should be on /joaosilva/my-folder/my-article
112 112  
113   - @selenium-fixme
  113 + @selenium
114 114 Scenario: cancel button back to folder after giving up creating
115 115 Given I am on joaosilva's control panel
116 116 When I follow "Manage Content"
... ... @@ -160,7 +160,7 @@ Feature: edit article
160 160 Then I should be on /joaosilva/mi-neuvo-articulo
161 161 And I should see "Translations"
162 162  
163   - @selenium-fixme
  163 + @selenium
164 164 Scenario: not add a translation without a language
165 165 Given the following articles
166 166 | owner | name | language |
... ...
features/language_redirection.feature
... ... @@ -7,7 +7,7 @@ Feature: language redirection
7 7 | login | name |
8 8 | manuel | Manuel Silva |
9 9 And the following articles
10   - | owner | name | body | lang | translation_of |
  10 + | owner | name | body | language | translation_of |
11 11 | manuel | Meu Artigo | isso é um teste | pt | nil |
12 12 | manuel | My Article | this is a test | en | Meu Artigo |
13 13  
... ...
features/step_definitions/noosfero_steps.rb
... ... @@ -114,7 +114,7 @@ Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded f
114 114 parent = item.delete("parent")
115 115 owner = Profile[owner_identifier]
116 116 home = item.delete("homepage")
117   - language = item.delete("lang")
  117 + language = item.delete("language")
118 118 category = item.delete("category")
119 119 filename = item.delete("filename")
120 120 translation_of_id = nil
... ... @@ -129,24 +129,24 @@ Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded f
129 129 :profile => owner,
130 130 :language => language,
131 131 :translation_of_id => translation_of_id)
132   - if !filename.blank?
133   - item.merge!(:uploaded_data => fixture_file_upload("/files/#{filename}", 'binary/octet-stream'))
134   - end
135   - result = klass.new(item)
136   - if !parent.blank?
137   - result.parent = Article.find_by_name(parent)
138   - end
139   - if category
140   - cat = Category.find_by_slug category
141   - if cat
142   - result.add_category(cat)
143   - end
144   - end
145   - result.save!
146   - if home == 'true'
147   - owner.home_page = result
148   - owner.save!
  132 + if !filename.blank?
  133 + item.merge!(:uploaded_data => fixture_file_upload("/files/#{filename}", 'binary/octet-stream'))
  134 + end
  135 + result = klass.new(item)
  136 + if !parent.blank?
  137 + result.parent = Article.find_by_name(parent)
  138 + end
  139 + if category
  140 + cat = Category.find_by_slug category
  141 + if cat
  142 + result.add_category(cat)
149 143 end
  144 + end
  145 + result.save!
  146 + if home == 'true'
  147 + owner.home_page = result
  148 + owner.save!
  149 + end
150 150 end
151 151 end
152 152  
... ...
features/support/env.rb
... ... @@ -24,6 +24,7 @@ require 'capybara/session'
24 24 # prefer to use XPath just remove this line and adjust any selectors in your
25 25 # steps to use the XPath syntax.
26 26 Capybara.default_selector = :css
  27 +Capybara.ignore_hidden_elements = true
27 28  
28 29 # If you set this to false, any error raised from within your app will bubble
29 30 # up to your step definition and out to cucumber unless you catch it somewhere
... ...