Commit e0a45ee75dfa4c412d295af7ef01a621c8a3f50c

Authored by Daniel Cunha
1 parent ef85b420

chat.feature

features/chat.feature
@@ -17,7 +17,8 @@ Feature: chat @@ -17,7 +17,8 @@ Feature: chat
17 Scenario: provide link to open chat 17 Scenario: provide link to open chat
18 Given feature "xmpp_chat" is enabled on environment 18 Given feature "xmpp_chat" is enabled on environment
19 And I am logged in as "tame" 19 And I am logged in as "tame"
20 - Then I should see "Open chat" link 20 + And I wait
  21 + Then I should see "Open chat" within "a#openchat"
21 22
22 @selenium 23 @selenium
23 Scenario: provide the chat online users content 24 Scenario: provide the chat online users content
@@ -30,18 +31,18 @@ Feature: chat @@ -30,18 +31,18 @@ Feature: chat
30 Given the profile "tame" has no blocks 31 Given the profile "tame" has no blocks
31 And feature "xmpp_chat" is enabled on environment 32 And feature "xmpp_chat" is enabled on environment
32 And I am logged in as "tame" 33 And I am logged in as "tame"
33 - And I go to Tame's profile  
34 - When I click "#chat-online-users-title" 34 + And I go to tame's profile
  35 + When I follow "chat-online-users-title"
35 Then I should see "Maria Silva" 36 Then I should see "Maria Silva"
36 And I should see "Jose Silva" 37 And I should see "Jose Silva"
37 38
38 Scenario: not provide link to chat when environment not support that 39 Scenario: not provide link to chat when environment not support that
39 Given I am logged in as "tame" 40 Given I am logged in as "tame"
40 - Then I should not see "Open chat" link 41 + Then I should not see "Open chat" within "a#openchat"
41 42
42 Scenario: not provide link to chat when the user is logged out 43 Scenario: not provide link to chat when the user is logged out
43 - Given I am on Tame's homepage  
44 - Then I should not see "Open chat" link 44 + Given I am on tame's homepage
  45 + Then I should not see "Open chat" within "a#openchat"
45 46
46 @selenium 47 @selenium
47 Scenario: not provide the chat online users list when environment not support that 48 Scenario: not provide the chat online users list when environment not support that
@@ -71,8 +72,8 @@ Feature: chat @@ -71,8 +72,8 @@ Feature: chat
71 Given the profile "tame" has no blocks 72 Given the profile "tame" has no blocks
72 And feature "xmpp_chat" is enabled on environment 73 And feature "xmpp_chat" is enabled on environment
73 And I am logged in as "tame" 74 And I am logged in as "tame"
74 - And I go to Tame's profile  
75 - When I click "#chat-online-users-title" 75 + And I go to tame's profile
  76 + When I follow "chat-online-users-title"
76 And I follow "Maria Silva" 77 And I follow "Maria Silva"
77 And I select window "noosfero_chat" 78 And I select window "noosfero_chat"
78 Then I should see "Chat - Colivre.net - Friends online (0)" 79 Then I should see "Chat - Colivre.net - Friends online (0)"
@@ -83,7 +84,7 @@ Feature: chat @@ -83,7 +84,7 @@ Feature: chat
83 And I am logged in as "tame" 84 And I am logged in as "tame"
84 When I follow "Open chat" 85 When I follow "Open chat"
85 And I select window "noosfero_chat" 86 And I select window "noosfero_chat"
86 - Then I should see "Offline" link 87 + Then I should see "Offline" within "a"
87 88
88 @selenium 89 @selenium
89 Scenario: view options to change my chat status through menu 90 Scenario: view options to change my chat status through menu
@@ -107,8 +108,8 @@ Feature: chat @@ -107,8 +108,8 @@ Feature: chat
107 And "Tame" is a member of "Autoramas" 108 And "Tame" is a member of "Autoramas"
108 And feature "xmpp_chat" is enabled on environment 109 And feature "xmpp_chat" is enabled on environment
109 And I am logged in as "tame" 110 And I am logged in as "tame"
110 - When I go to Autoramas's profile  
111 - Then I should see "Enter chat room" link 111 + When I go to autoramas's profile
  112 + Then I should see "Enter chat room"
112 113
113 @selenium 114 @selenium
114 Scenario: not see link to open chatroom of a community if not a member 115 Scenario: not see link to open chatroom of a community if not a member
@@ -117,8 +118,8 @@ Feature: chat @@ -117,8 +118,8 @@ Feature: chat
117 | autoramas | Autoramas | 118 | autoramas | Autoramas |
118 And feature "xmpp_chat" is enabled on environment 119 And feature "xmpp_chat" is enabled on environment
119 And I am logged in as "tame" 120 And I am logged in as "tame"
120 - When I go to Autoramas's profile  
121 - Then I should not see "Enter chat room" link 121 + When I go to autoramas's profile
  122 + Then I should not see "Enter chat room" within "a"
122 123
123 @selenium 124 @selenium
124 Scenario: not see link to open chatroom of a community if xmpp_chat disabled 125 Scenario: not see link to open chatroom of a community if xmpp_chat disabled
@@ -127,8 +128,8 @@ Feature: chat @@ -127,8 +128,8 @@ Feature: chat
127 | autoramas | Autoramas | 128 | autoramas | Autoramas |
128 And "Tame" is a member of "Autoramas" 129 And "Tame" is a member of "Autoramas"
129 And I am logged in as "tame" 130 And I am logged in as "tame"
130 - When I go to Autoramas's profile  
131 - Then I should not see "Enter chat room" link 131 + When I go to autoramas's profile
  132 + Then I should not see "Enter chat room" within "a"
132 133
133 @selenium 134 @selenium
134 Scenario: open chatroom of a community in a new window 135 Scenario: open chatroom of a community in a new window
@@ -138,7 +139,7 @@ Feature: chat @@ -138,7 +139,7 @@ Feature: chat
138 | autoramas | Autoramas | 139 | autoramas | Autoramas |
139 And "Tame" is a member of "Autoramas" 140 And "Tame" is a member of "Autoramas"
140 And I am logged in as "tame" 141 And I am logged in as "tame"
141 - When I go to Autoramas's profile 142 + When I go to autoramas's profile
142 And I follow "Enter chat room" 143 And I follow "Enter chat room"
143 And I select window "noosfero_chat" 144 And I select window "noosfero_chat"
144 Then I should see "Chat - Colivre.net - Friends online (0)" 145 Then I should see "Chat - Colivre.net - Friends online (0)"
features/step_definitions/chat_steps.rb 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +When /^I select window "([^\"]*)"$/ do |selector|
  2 + page.driver.browser.switch_to.window(selector)
  3 +end
features/support/paths.rb
@@ -49,10 +49,7 @@ module NavigationHelpers @@ -49,10 +49,7 @@ module NavigationHelpers
49 '/profile/%s/sitemap' % Profile.find_by_name($1).identifier 49 '/profile/%s/sitemap' % Profile.find_by_name($1).identifier
50 50
51 when /^(.*)'s profile$/ 51 when /^(.*)'s profile$/
52 - '/profile/%s' % Profile.find_by_name($1).identifier  
53 -  
54 - when /^the profile$/  
55 - '/profile/%s' % User.find_by_id(session[:user]).login 52 + '/profile/' + $1
56 53
57 when /^(.*)'s join page/ 54 when /^(.*)'s join page/
58 '/profile/%s/join' % Profile.find_by_name($1).identifier 55 '/profile/%s/join' % Profile.find_by_name($1).identifier