MDL-64676 core_message: Fix old behat tests affected by new messaging

This commit is contained in:
Amaia Anabitarte
2019-04-08 18:45:23 +02:00
parent 9d4f4f0051
commit 06b028103e
3 changed files with 55 additions and 56 deletions
+12 -5
View File
@@ -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",
)
);
-1
View File
@@ -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
+43 -50
View File
@@ -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 ([email protected])" user to "Group 1" group members
# And I add "Student 2 ([email protected])" 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"