Commit 4a10fc12891228c5a8c5093f4b58a296f70a6761
1 parent
2ceaba7c
Exists in
master
and in
29 other branches
Partially fixed test: features/profile_domain.feature
Showing
2 changed files
with
18 additions
and
4 deletions
Show diff stats
features/profile_domain.feature
... | ... | @@ -39,28 +39,33 @@ Feature: domain for profile |
39 | 39 | And I follow "Control panel" within "div#user" |
40 | 40 | Then I should see "Joao Silva" within "span.control-panel-title" |
41 | 41 | |
42 | + # Looking for page title is problematic on selenium since it considers the | |
43 | + # title to be invibible. Checkout some information about this: | |
44 | + # * https://github.com/jnicklas/capybara/issues/863 | |
45 | + # * https://github.com/jnicklas/capybara/pull/953 | |
42 | 46 | @selenium |
43 | 47 | Scenario: access user page |
44 | 48 | Given I am logged in as "joaosilva" |
45 | 49 | When I go to the homepage |
46 | 50 | And I follow "joaosilva" |
47 | 51 | Then I should be on joaosilva's profile |
48 | - And the page title should be "Joao Silva" | |
52 | + And I should see "Joao Silva" within any "h1" | |
53 | + #And the page title should be "Joao Silva" | |
49 | 54 | |
50 | - @selenium-fixme | |
51 | 55 | Scenario: access community by domain |
52 | 56 | Given I go to the search communities page |
53 | 57 | When I follow "Sample Community" within ".search-profile-item" |
54 | 58 | Then the page title should be "Sample Community" |
55 | 59 | |
56 | - @selenium-fixme | |
60 | + # This test is not working because the community domain isn't at all different | |
61 | + # from the environment (localhost / 127.0.0.1) | |
62 | + @fixme | |
57 | 63 | Scenario: Go to profile homepage after clicking on home button on not found page |
58 | 64 | Given I am on sample-community's homepage |
59 | 65 | When I go to /something-that-does-not-exist |
60 | 66 | And I follow "Go to the home page" |
61 | 67 | Then the page title should be "Sample Community - Colivre.net" |
62 | 68 | |
63 | - @selenium | |
64 | 69 | Scenario: Go to environment homepage after clicking on home button on not found page |
65 | 70 | Given I am on the homepage |
66 | 71 | When I go to /something-that-does-not-exist | ... | ... |
features/step_definitions/web_steps.rb
... | ... | @@ -114,6 +114,15 @@ Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| |
114 | 114 | end |
115 | 115 | end |
116 | 116 | |
117 | + | |
118 | +Then /^(?:|I )should see "([^"]*)" within any "([^"]*)"?$/ do |text, selector| | |
119 | + if page.respond_to? :should | |
120 | + page.should have_css(selector, :content => text) | |
121 | + else | |
122 | + assert page.has_css?(selector, :content => text) | |
123 | + end | |
124 | +end | |
125 | + | |
117 | 126 | Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| |
118 | 127 | regexp = Regexp.new(regexp) |
119 | 128 | with_scope(selector) do | ... | ... |