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,11 +9,11 @@ Feature: domain for profile | ||
9 | | joaosilva | Joao Silva | | 9 | | joaosilva | Joao Silva | |
10 | And the following communities | 10 | And the following communities |
11 | | identifier | name | domain | | 11 | | identifier | name | domain | |
12 | - | sample-community | Sample Community | localhost | | 12 | + | sample-community | Sample Community | 127.0.0.1 | |
13 | And the following blocks | 13 | And the following blocks |
14 | | owner | type | | 14 | | owner | type | |
15 | | joaosilva | ProfileInfoBlock | | 15 | | joaosilva | ProfileInfoBlock | |
16 | - And the environment domain is "127.0.0.1" | 16 | + And the environment domain is "localhost" |
17 | And "Joao Silva" is environment admin | 17 | And "Joao Silva" is environment admin |
18 | And "Joao Silva" is admin of "Sample Community" | 18 | And "Joao Silva" is admin of "Sample Community" |
19 | 19 | ||
@@ -29,8 +29,7 @@ Feature: domain for profile | @@ -29,8 +29,7 @@ Feature: domain for profile | ||
29 | @selenium | 29 | @selenium |
30 | Scenario: access user control panel | 30 | Scenario: access user control panel |
31 | Given I am logged in as "joaosilva" | 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 | And I go to sample-community's homepage | 33 | And I go to sample-community's homepage |
35 | And I follow "Login" | 34 | And I follow "Login" |
36 | And I fill in "joaosilva" for "Username" | 35 | And I fill in "joaosilva" for "Username" |
@@ -39,18 +38,13 @@ Feature: domain for profile | @@ -39,18 +38,13 @@ Feature: domain for profile | ||
39 | And I follow "Control panel" within "div#user" | 38 | And I follow "Control panel" within "div#user" |
40 | Then I should see "Joao Silva" within "span.control-panel-title" | 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 | @selenium | 41 | @selenium |
47 | Scenario: access user page | 42 | Scenario: access user page |
48 | Given I am logged in as "joaosilva" | 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 | Then I should be on joaosilva's profile | 45 | Then I should be on joaosilva's profile |
52 | And I should see "Joao Silva" within any "h1" | 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 | Scenario: access community by domain | 49 | Scenario: access community by domain |
56 | Given I go to the search communities page | 50 | Given I go to the search communities page |
@@ -64,7 +58,7 @@ Feature: domain for profile | @@ -64,7 +58,7 @@ Feature: domain for profile | ||
64 | Given I am on sample-community's homepage | 58 | Given I am on sample-community's homepage |
65 | When I go to /something-that-does-not-exist | 59 | When I go to /something-that-does-not-exist |
66 | And I follow "Go to the home page" | 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 | Scenario: Go to environment homepage after clicking on home button on not found page | 63 | Scenario: Go to environment homepage after clicking on home button on not found page |
70 | Given I am on the homepage | 64 | Given I am on the homepage |
@@ -72,8 +66,3 @@ Feature: domain for profile | @@ -72,8 +66,3 @@ Feature: domain for profile | ||
72 | And I follow "Go to the home page" | 66 | And I follow "Go to the home page" |
73 | Then I should be on the homepage | 67 | Then I should be on the homepage |
74 | And the page title should be "Colivre.net" | 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,9 +118,9 @@ end | ||
118 | 118 | ||
119 | Then /^(?:|I )should see "([^"]*)" within any "([^"]*)"?$/ do |text, selector| | 119 | Then /^(?:|I )should see "([^"]*)" within any "([^"]*)"?$/ do |text, selector| |
120 | if page.respond_to? :should | 120 | if page.respond_to? :should |
121 | - page.should have_css(selector, :content => text) | 121 | + page.should have_css(selector, :text => text) |
122 | else | 122 | else |
123 | - assert page.has_css?(selector, :content => text) | 123 | + assert page.has_css?(selector, :text => text) |
124 | end | 124 | end |
125 | end | 125 | end |
126 | 126 |