Commit 8476dfd0fda61a25b8ad1338a3a656769d494a9d
1 parent
4a3b588b
Exists in
master
and in
22 other branches
profile-domain: fix selenium tests
Showing
2 changed files
with
8 additions
and
19 deletions
Show diff stats
features/profile_domain.feature
... | ... | @@ -9,11 +9,11 @@ Feature: domain for profile |
9 | 9 | | joaosilva | Joao Silva | |
10 | 10 | And the following communities |
11 | 11 | | identifier | name | domain | |
12 | - | sample-community | Sample Community | localhost | | |
12 | + | sample-community | Sample Community | 127.0.0.1 | | |
13 | 13 | And the following blocks |
14 | 14 | | owner | type | |
15 | 15 | | joaosilva | ProfileInfoBlock | |
16 | - And the environment domain is "127.0.0.1" | |
16 | + And the environment domain is "localhost" | |
17 | 17 | And "Joao Silva" is environment admin |
18 | 18 | And "Joao Silva" is admin of "Sample Community" |
19 | 19 | |
... | ... | @@ -29,8 +29,7 @@ Feature: domain for profile |
29 | 29 | @selenium |
30 | 30 | Scenario: access user control panel |
31 | 31 | Given I am logged in as "joaosilva" |
32 | - When I go to the homepage | |
33 | - And I follow "joaosilva" | |
32 | + When I follow "joaosilva" | |
34 | 33 | And I go to sample-community's homepage |
35 | 34 | And I follow "Login" |
36 | 35 | And I fill in "joaosilva" for "Username" |
... | ... | @@ -39,18 +38,13 @@ Feature: domain for profile |
39 | 38 | And I follow "Control panel" within "div#user" |
40 | 39 | Then I should see "Joao Silva" within "span.control-panel-title" |
41 | 40 | |
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 | |
46 | 41 | @selenium |
47 | 42 | Scenario: access user page |
48 | 43 | Given I am logged in as "joaosilva" |
49 | - When I go to the homepage | |
50 | - And I follow "joaosilva" | |
44 | + When I follow "joaosilva" | |
51 | 45 | Then I should be on joaosilva's profile |
52 | 46 | And I should see "Joao Silva" within any "h1" |
53 | - #And the page title should be "Joao Silva" | |
47 | + And the page title should be "Joao Silva" | |
54 | 48 | |
55 | 49 | Scenario: access community by domain |
56 | 50 | Given I go to the search communities page |
... | ... | @@ -64,7 +58,7 @@ Feature: domain for profile |
64 | 58 | Given I am on sample-community's homepage |
65 | 59 | When I go to /something-that-does-not-exist |
66 | 60 | And I follow "Go to the home page" |
67 | - Then the page title should be "Sample Community - Colivre.net" | |
61 | + Then the page title should be "Sample Community" | |
68 | 62 | |
69 | 63 | Scenario: Go to environment homepage after clicking on home button on not found page |
70 | 64 | Given I am on the homepage |
... | ... | @@ -72,8 +66,3 @@ Feature: domain for profile |
72 | 66 | And I follow "Go to the home page" |
73 | 67 | Then I should be on the homepage |
74 | 68 | And the page title should be "Colivre.net" |
75 | - | |
76 | - @selenium | |
77 | - Scenario: Compose link to administration with environment domain | |
78 | - Given I am logged in as "joaosilva" | |
79 | - Then I should see "Administration" linking to "http://127.0.0.1.*/admin" | ... | ... |
features/step_definitions/web_steps.rb
... | ... | @@ -118,9 +118,9 @@ end |
118 | 118 | |
119 | 119 | Then /^(?:|I )should see "([^"]*)" within any "([^"]*)"?$/ do |text, selector| |
120 | 120 | if page.respond_to? :should |
121 | - page.should have_css(selector, :content => text) | |
121 | + page.should have_css(selector, :text => text) | |
122 | 122 | else |
123 | - assert page.has_css?(selector, :content => text) | |
123 | + assert page.has_css?(selector, :text => text) | |
124 | 124 | end |
125 | 125 | end |
126 | 126 | ... | ... |