Commit d4d5dea2759a011b02505a864b82f014ec793533

Authored by Rodrigo Souto
1 parent 5addb278

edit-environment-templates-feature: follow exact match to avoid random failures

features/edit_environment_templates.feature
@@ -18,25 +18,25 @@ Feature: edit environment templates @@ -18,25 +18,25 @@ Feature: edit environment templates
18 @selenium 18 @selenium
19 Scenario: Go to control panel of person template 19 Scenario: Go to control panel of person template
20 Given I follow "Profile templates" 20 Given I follow "Profile templates"
21 - And I follow "Person template" 21 + And I follow exact "Person template"
22 Then I should be on colivre.net_person_template's control panel 22 Then I should be on colivre.net_person_template's control panel
23 23
24 @selenium 24 @selenium
25 Scenario: Go to control panel of enterprise template 25 Scenario: Go to control panel of enterprise template
26 Given I follow "Profile templates" 26 Given I follow "Profile templates"
27 - And I follow "Enterprise template" 27 + And I follow exact "Enterprise template"
28 Then I should be on colivre.net_enterprise_template's control panel 28 Then I should be on colivre.net_enterprise_template's control panel
29 29
30 @selenium 30 @selenium
31 Scenario: Go to control panel of inactive enterprise template 31 Scenario: Go to control panel of inactive enterprise template
32 Given I follow "Profile templates" 32 Given I follow "Profile templates"
33 - And I follow "Inactive Enterprise template" 33 + And I follow exact "Inactive Enterprise template"
34 Then I should be on colivre.net_inactive_enterprise_template's control panel 34 Then I should be on colivre.net_inactive_enterprise_template's control panel
35 35
36 @selenium 36 @selenium
37 Scenario: Go to control panel of community template 37 Scenario: Go to control panel of community template
38 Given I follow "Profile templates" 38 Given I follow "Profile templates"
39 - When I follow "Community template" 39 + When I follow exact "Community template"
40 Then I should be on colivre.net_community_template's control panel 40 Then I should be on colivre.net_community_template's control panel
41 41
42 @selenium 42 @selenium
features/step_definitions/web_steps.rb
@@ -247,3 +247,9 @@ end @@ -247,3 +247,9 @@ end
247 Then /^there should be a div with class "([^"]*)"$/ do |klass| 247 Then /^there should be a div with class "([^"]*)"$/ do |klass|
248 should have_selector('div', :class => klass) 248 should have_selector('div', :class => klass)
249 end 249 end
  250 +
  251 +When /^(?:|I )follow exact "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector|
  252 + with_scope(selector) do
  253 + find("a", :text => /\A#{link}\z/).click
  254 + end
  255 +end