diff --git a/message/tests/behat/behat_message.php b/message/tests/behat/behat_message.php index 40c39f5f54d..bcd547621ee 100644 --- a/message/tests/behat/behat_message.php +++ b/message/tests/behat/behat_message.php @@ -69,11 +69,18 @@ class behat_message extends behat_base { $this->execute('behat_general::i_click_on_in_the', array( - "//button[@data-action='view-contact-profile'] - [contains(normalize-space(.), '" . $this->escape($userfullname) . "')]", - 'xpath_element', - ".messages-header", - "css_element", + "//a[@data-action='view-contact']", + "xpath_element", + "//*[@data-region='message-drawer']//div[@data-region='header-container']", + "xpath_element", + ) + ); + $this->execute('behat_general::i_click_on_in_the', + array( + $this->escape($userfullname), + "link", + "//*[@data-region='message-drawer']//*[@data-region='view-contact']", + "xpath_element", ) ); diff --git a/user/tests/behat/delete_users.feature b/user/tests/behat/delete_users.feature index 0eb3b97684a..d1ac6c1945e 100644 --- a/user/tests/behat/delete_users.feature +++ b/user/tests/behat/delete_users.feature @@ -22,7 +22,6 @@ Feature: Deleting users | user4 | C1 | student | And the following config values are set as admin: | messaging | 1 | - | messagingallusers | 1 | @javascript Scenario: Deleting one user at a time diff --git a/user/tests/behat/view_full_profile.feature b/user/tests/behat/view_full_profile.feature index 18d9bf02ebd..bec31702793 100644 --- a/user/tests/behat/view_full_profile.feature +++ b/user/tests/behat/view_full_profile.feature @@ -23,7 +23,6 @@ Feature: Access to full profiles of users | student3 | C2 | student | And the following config values are set as admin: | messaging | 1 | - | messagingallusers | 1 | Scenario: Viewing full profiles with default settings When I log in as "student1" @@ -72,53 +71,47 @@ Feature: Access to full profiles of users When I follow "Profile" in the user menu Then I should see "First access to site" -# TODO: These need to be re-written now that the messaging UI has changed -# because you can no longer use the messaging UI to view other user's profiles. -# -# @javascript -# Scenario: Viewing full profiles of someone with the course contact role -# Given I log in as "admin" -# And I navigate to "Appearance > Courses" in site administration -# And I set the following fields to these values: -# | Course creator | 1 | -# And I press "Save changes" -# And I navigate to "Users > Permissions > Assign system roles" in site administration -# And I follow "Course creator" -# And I click on "//div[@class='userselector']/descendant::option[contains(., 'Student 3')]" "xpath_element" -# And I press "Add" -# And I log out -# When I log in as "student1" -# And I view the "Student 3" contact in the message area -# And I click on ".profile-picture" "css_element" -# Then I should see "First access to site" + @javascript + Scenario: Viewing full profiles of someone with the course contact role + Given I log in as "admin" + And I navigate to "Appearance > Courses" in site administration + And I set the following fields to these values: + | Course creator | 1 | + And I press "Save changes" + And I navigate to "Users > Permissions > Assign system roles" in site administration + And I follow "Course creator" + And I click on "//div[@class='userselector']/descendant::option[contains(., 'Student 3')]" "xpath_element" + And I press "Add" + And I log out + When I log in as "student1" + And I view the "Student 3" contact in the message area + Then I should see "First access to site" -# @javascript -# Scenario: View full profiles of someone in the same group in a course with separate groups. -# Given I log in as "admin" -# And I am on "Course 1" course homepage -# And I navigate to "Edit settings" in current page administration -# And I set the following fields to these values: -# | Group mode | Separate groups | -# | Force group mode | Yes | -# And I press "Save and display" -# And I log out -# When I log in as "student1" -# And I view the "Student 2" contact in the message area -# And I click on ".profile-picture" "css_element" -# And I should not see "First access to site" -# And I should see "The details of this user are not available to you" -# And I log out -# And I log in as "admin" -# And I am on "Course 1" course homepage -# And I navigate to "Users > Groups" in current page administration -# And I press "Create group" -# And I set the following fields to these values: -# | Group name | Group 1 | -# And I press "Save changes" -# And I add "Student 1 (student1@example.com)" user to "Group 1" group members -# And I add "Student 2 (student2@example.com)" user to "Group 1" group members -# And I log out -# And I log in as "student1" -# And I view the "Student 2" contact in the message area -# And I click on ".profile-picture" "css_element" -# Then I should see "First access to site" + @javascript + Scenario: View full profiles of someone in the same group in a course with separate groups. + Given I log in as "admin" + And I am on "Course 1" course homepage + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Group mode | Separate groups | + | Force group mode | Yes | + And I press "Save and display" + And I log out + When I log in as "student1" + And I view the "Student 2" contact in the message area + And I should not see "First access to site" + And I should see "The details of this user are not available to you" + And I log out + And I log in as "admin" + And I am on "Course 1" course homepage + And I navigate to "Users > Groups" in current page administration + And I press "Create group" + And I set the following fields to these values: + | Group name | Group 1 | + And I press "Save changes" + And I add "Student 1 (student1@example.com)" user to "Group 1" group members + And I add "Student 2 (student2@example.com)" user to "Group 1" group members + And I log out + And I log in as "student1" + And I view the "Student 2" contact in the message area + Then I should see "First access to site"