Commit 2ceaba7c79c6eb1dd7cca33770174f0e8d4c4038
1 parent
657502e0
Exists in
master
and in
28 other branches
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.
Showing
4 changed files
with
23 additions
and
22 deletions
Show diff stats
features/edit_article.feature
@@ -94,7 +94,7 @@ Feature: edit article | @@ -94,7 +94,7 @@ Feature: edit article | ||
94 | And I follow "Cancel" | 94 | And I follow "Cancel" |
95 | Then I should be on /joaosilva/save-the-whales | 95 | Then I should be on /joaosilva/save-the-whales |
96 | 96 | ||
97 | - @selenium-fixme | 97 | + @selenium |
98 | Scenario: create an article inside a folder | 98 | Scenario: create an article inside a folder |
99 | Given I am on joaosilva's control panel | 99 | Given I am on joaosilva's control panel |
100 | When I follow "Manage Content" | 100 | When I follow "Manage Content" |
@@ -110,7 +110,7 @@ Feature: edit article | @@ -110,7 +110,7 @@ Feature: edit article | ||
110 | Then I should see "My Article" | 110 | Then I should see "My Article" |
111 | And I should be on /joaosilva/my-folder/my-article | 111 | And I should be on /joaosilva/my-folder/my-article |
112 | 112 | ||
113 | - @selenium-fixme | 113 | + @selenium |
114 | Scenario: cancel button back to folder after giving up creating | 114 | Scenario: cancel button back to folder after giving up creating |
115 | Given I am on joaosilva's control panel | 115 | Given I am on joaosilva's control panel |
116 | When I follow "Manage Content" | 116 | When I follow "Manage Content" |
@@ -160,7 +160,7 @@ Feature: edit article | @@ -160,7 +160,7 @@ Feature: edit article | ||
160 | Then I should be on /joaosilva/mi-neuvo-articulo | 160 | Then I should be on /joaosilva/mi-neuvo-articulo |
161 | And I should see "Translations" | 161 | And I should see "Translations" |
162 | 162 | ||
163 | - @selenium-fixme | 163 | + @selenium |
164 | Scenario: not add a translation without a language | 164 | Scenario: not add a translation without a language |
165 | Given the following articles | 165 | Given the following articles |
166 | | owner | name | language | | 166 | | owner | name | language | |
features/language_redirection.feature
@@ -7,7 +7,7 @@ Feature: language redirection | @@ -7,7 +7,7 @@ Feature: language redirection | ||
7 | | login | name | | 7 | | login | name | |
8 | | manuel | Manuel Silva | | 8 | | manuel | Manuel Silva | |
9 | And the following articles | 9 | And the following articles |
10 | - | owner | name | body | lang | translation_of | | 10 | + | owner | name | body | language | translation_of | |
11 | | manuel | Meu Artigo | isso é um teste | pt | nil | | 11 | | manuel | Meu Artigo | isso é um teste | pt | nil | |
12 | | manuel | My Article | this is a test | en | Meu Artigo | | 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,7 +114,7 @@ Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded f | ||
114 | parent = item.delete("parent") | 114 | parent = item.delete("parent") |
115 | owner = Profile[owner_identifier] | 115 | owner = Profile[owner_identifier] |
116 | home = item.delete("homepage") | 116 | home = item.delete("homepage") |
117 | - language = item.delete("lang") | 117 | + language = item.delete("language") |
118 | category = item.delete("category") | 118 | category = item.delete("category") |
119 | filename = item.delete("filename") | 119 | filename = item.delete("filename") |
120 | translation_of_id = nil | 120 | translation_of_id = nil |
@@ -129,24 +129,24 @@ Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded f | @@ -129,24 +129,24 @@ Given /^the following (articles|events|blogs|folders|forums|galleries|uploaded f | ||
129 | :profile => owner, | 129 | :profile => owner, |
130 | :language => language, | 130 | :language => language, |
131 | :translation_of_id => translation_of_id) | 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 | end | 143 | end |
144 | + end | ||
145 | + result.save! | ||
146 | + if home == 'true' | ||
147 | + owner.home_page = result | ||
148 | + owner.save! | ||
149 | + end | ||
150 | end | 150 | end |
151 | end | 151 | end |
152 | 152 |
features/support/env.rb
@@ -24,6 +24,7 @@ require 'capybara/session' | @@ -24,6 +24,7 @@ require 'capybara/session' | ||
24 | # prefer to use XPath just remove this line and adjust any selectors in your | 24 | # prefer to use XPath just remove this line and adjust any selectors in your |
25 | # steps to use the XPath syntax. | 25 | # steps to use the XPath syntax. |
26 | Capybara.default_selector = :css | 26 | Capybara.default_selector = :css |
27 | +Capybara.ignore_hidden_elements = true | ||
27 | 28 | ||
28 | # If you set this to false, any error raised from within your app will bubble | 29 | # If you set this to false, any error raised from within your app will bubble |
29 | # up to your step definition and out to cucumber unless you catch it somewhere | 30 | # up to your step definition and out to cucumber unless you catch it somewhere |