Skip to content

Commit

Permalink
Merge branch 'MDL-64676-master' of https://github.com/aanabit/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Apr 23, 2019
2 parents 1e36bcf + 06b0281 commit ac753bd
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 56 deletions.
17 changes: 12 additions & 5 deletions message/tests/behat/behat_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,18 @@ public function i_view_contact_in_messages($userfullname) {

$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",
)
);

Expand Down
1 change: 0 additions & 1 deletion user/tests/behat/delete_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
93 changes: 43 additions & 50 deletions user/tests/behat/view_full_profile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

0 comments on commit ac753bd

Please sign in to comment.