Commit 7aa42ede6046e3730393cebf58188c7e12be2f85

Authored by Braulio Bhavamitra
1 parent 00c832e0

selenium: Speed up visibility checks

This improves selenium and plugins tasks by more than 10 minutes
See https://blog.codeship.com/faster-rails-tests/
features/admin_categories.feature
... ... @@ -45,7 +45,7 @@ Feature: manage categories
45 45 And I should see "Steak"
46 46 When I follow "Hide"
47 47 Then I should not see "Vegetarian"
48   - And "Steak" should not be visible within "div"
  48 + And I should not see "Steak"
49 49  
50 50 @selenium
51 51 Scenario: the show link is available just for categories with category tree
... ...
features/comment.feature
... ... @@ -96,4 +96,4 @@ Feature: comment
96 96 Scenario: hide post a comment button when clicked
97 97 Given I am on /booking/article-to-comment
98 98 And I follow "Post a comment"
99   - Then "Post a comment" should not be visible within "#article"
  99 + Then "Post comment" should not be visible within "#article"
... ...
features/step_definitions/custom_web_steps.rb
1 1 Then /^"([^"]*)" should not be visible within "([^"]*)"$/ do |text, selector|
2   - if page.has_content?(text)
3   - page.should have_no_css(selector, :text => text, :visible => false)
4   - end
  2 + page.should have_no_css selector, text: text, visible: false
5 3 end
6 4  
7 5 Then /^"([^"]*)" should be visible within "([^"]*)"$/ do |text, selector|
8   - if page.has_content?(text)
9   - page.should have_css(selector, :text => text, :visible => false)
10   - end
  6 + page.should have_css selector, text: text, visible: false
11 7 end
12 8  
13 9 Then /^I should see "([^"]*)" link$/ do |text|
... ...