diff --git a/features/chat.feature b/features/chat.feature index a7b00b7..469d381 100644 --- a/features/chat.feature +++ b/features/chat.feature @@ -17,7 +17,8 @@ Feature: chat Scenario: provide link to open chat Given feature "xmpp_chat" is enabled on environment And I am logged in as "tame" - Then I should see "Open chat" link + And I wait + Then I should see "Open chat" within "a#openchat" @selenium Scenario: provide the chat online users content @@ -30,18 +31,18 @@ Feature: chat Given the profile "tame" has no blocks And feature "xmpp_chat" is enabled on environment And I am logged in as "tame" - And I go to Tame's profile - When I click "#chat-online-users-title" + And I go to tame's profile + When I follow "chat-online-users-title" Then I should see "Maria Silva" And I should see "Jose Silva" Scenario: not provide link to chat when environment not support that Given I am logged in as "tame" - Then I should not see "Open chat" link + Then I should not see "Open chat" within "a#openchat" Scenario: not provide link to chat when the user is logged out - Given I am on Tame's homepage - Then I should not see "Open chat" link + Given I am on tame's homepage + Then I should not see "Open chat" within "a#openchat" @selenium Scenario: not provide the chat online users list when environment not support that @@ -71,8 +72,8 @@ Feature: chat Given the profile "tame" has no blocks And feature "xmpp_chat" is enabled on environment And I am logged in as "tame" - And I go to Tame's profile - When I click "#chat-online-users-title" + And I go to tame's profile + When I follow "chat-online-users-title" And I follow "Maria Silva" And I select window "noosfero_chat" Then I should see "Chat - Colivre.net - Friends online (0)" @@ -83,7 +84,7 @@ Feature: chat And I am logged in as "tame" When I follow "Open chat" And I select window "noosfero_chat" - Then I should see "Offline" link + Then I should see "Offline" within "a" @selenium Scenario: view options to change my chat status through menu @@ -107,8 +108,8 @@ Feature: chat And "Tame" is a member of "Autoramas" And feature "xmpp_chat" is enabled on environment And I am logged in as "tame" - When I go to Autoramas's profile - Then I should see "Enter chat room" link + When I go to autoramas's profile + Then I should see "Enter chat room" @selenium Scenario: not see link to open chatroom of a community if not a member @@ -117,8 +118,8 @@ Feature: chat | autoramas | Autoramas | And feature "xmpp_chat" is enabled on environment And I am logged in as "tame" - When I go to Autoramas's profile - Then I should not see "Enter chat room" link + When I go to autoramas's profile + Then I should not see "Enter chat room" within "a" @selenium Scenario: not see link to open chatroom of a community if xmpp_chat disabled @@ -127,8 +128,8 @@ Feature: chat | autoramas | Autoramas | And "Tame" is a member of "Autoramas" And I am logged in as "tame" - When I go to Autoramas's profile - Then I should not see "Enter chat room" link + When I go to autoramas's profile + Then I should not see "Enter chat room" within "a" @selenium Scenario: open chatroom of a community in a new window @@ -138,7 +139,7 @@ Feature: chat | autoramas | Autoramas | And "Tame" is a member of "Autoramas" And I am logged in as "tame" - When I go to Autoramas's profile + When I go to autoramas's profile And I follow "Enter chat room" And I select window "noosfero_chat" Then I should see "Chat - Colivre.net - Friends online (0)" diff --git a/features/step_definitions/chat_steps.rb b/features/step_definitions/chat_steps.rb new file mode 100644 index 0000000..90acae4 --- /dev/null +++ b/features/step_definitions/chat_steps.rb @@ -0,0 +1,3 @@ +When /^I select window "([^\"]*)"$/ do |selector| + page.driver.browser.switch_to.window(selector) +end diff --git a/features/support/paths.rb b/features/support/paths.rb index a534e46..a366858 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -49,10 +49,7 @@ module NavigationHelpers '/profile/%s/sitemap' % Profile.find_by_name($1).identifier when /^(.*)'s profile$/ - '/profile/%s' % Profile.find_by_name($1).identifier - - when /^the profile$/ - '/profile/%s' % User.find_by_id(session[:user]).login + '/profile/' + $1 when /^(.*)'s join page/ '/profile/%s/join' % Profile.find_by_name($1).identifier -- libgit2 0.21.2