AutorÃa | Ultima modificación | Ver Log |
@core @core_userFeature: Access to full profiles of usersIn order to allow visibility of full profilesAs an adminI need to set global permission or disable forceloginforprofilesBackground:Given the following "users" exist:| username | firstname | lastname | email || student1 | Student | 1 | student1@example.com || student2 | Student | 2 | student2@example.com || student3 | Student | 3 | student3@example.com || teacher1 | Teacher | 1 | teacher1@example.com |And the following "courses" exist:| fullname | shortname | format | groupmode || Course 1 | C1 | topics | 0 || Course 2 | C2 | topics | 1 |And the following "course enrolments" exist:| user | course | role || student1 | C1 | student || student2 | C1 | student || teacher1 | C1 | editingteacher || teacher1 | C2 | editingteacher || student1 | C2 | student || student3 | C2 | student |And the following config values are set as admin:| messaging | 1 |Scenario: Viewing full profiles with default settingsWhen I log in as "student1"# Another student's full profile is visibleAnd I am on "Course 1" course homepageAnd I navigate to course participantsAnd I follow "Student 2"Then I should see "Full profile"# Teacher's full profile is visibleAnd I am on "Course 1" course homepageAnd I navigate to course participantsAnd I follow "Teacher 1"And I follow "Full profile"And I should see "First access to site"# Own full profile is visibleAnd I am on "Course 1" course homepageAnd I navigate to course participantsAnd I click on "Student 1" "link" in the "#participants" "css_element"And I follow "Full profile"And I should see "First access to site"Scenario: Viewing full profiles with forceloginforprofiles offGiven the following config values are set as admin:| forceloginforprofiles | 0 |When I log in as "student1"And I am on "Course 1" course homepageAnd I navigate to course participantsAnd I follow "Student 2"And I follow "Full profile"Then I should see "First access to site"Scenario: Viewing full profiles with global permissionGiven the following "role capability" exists:| role | user || moodle/user:viewdetails | allow |When I log in as "student1"And I am on "Course 1" course homepageAnd I navigate to course participantsAnd I follow "Student 2"And I follow "Full profile"Then I should see "First access to site"Scenario: Viewing full profiles of students as a teacherWhen I log in as "teacher1"And I am on "Course 1" course homepageAnd I navigate to course participantsAnd I follow "Student 1"And I follow "Full profile"Then I should see "First access to site"Scenario: Viewing own full profileGiven I log in as "student1"When I follow "Profile" in the user menuThen I should see "First access to site"Scenario: View only shared groups in a course with separate groups forcedGiven the following "groups" exist:| name | course | idnumber || Group 1 | C2 | G1 || Group 2 | C2 | G2 |And the following "group members" exist:| user | group || student1 | G1 || student3 | G2 || teacher1 | G1 || teacher1 | G2 |When I log in as "student3"And I am on "Course 2" course homepageAnd I navigate to course participantsAnd I follow "Teacher 1"Then I should see "Group 2"And I should not see "Group 1"Scenario: View all groups in a course with visible groupsGiven the following "groups" exist:| name | course | idnumber || Group 1 | C1 | G1 || Group 2 | C1 | G2 |And the following "group members" exist:| user | group || student1 | G1 || student2 | G2 || teacher1 | G1 || teacher1 | G2 |When I log in as "student1"And I am on "Course 1" course homepageAnd I navigate to course participantsAnd I follow "Teacher 1"Then I should see "Group 1"And I should see "Group 2"@javascriptScenario: Viewing full profiles of someone with the course contact roleGiven I log in as "admin"And I navigate to "Appearance > Courses" in site administrationAnd 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 administrationAnd 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# Message search will not return a course contact unless the searcher shares a course with them,# or site-wide messaging is enabled ($CFG->messagingallusers).When I log in as "student1"And I open messagingAnd I search for "Student 3" in messagingThen I should see "Student 3"And I log outWhen I log in as "student2"And I open messagingAnd I search for "Student 3" in messagingThen I should see "No results"@javascriptScenario: 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 homepageAnd I navigate to "Settings" in current page administrationAnd 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 outAnd the following "message contacts" exist:| user | contact || student1 | student2 |When I log in as "student1"And I view the "Student 2" contact in the message areaAnd 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 outAnd I log in as "admin"And I am on the "Course 1" "groups" pageAnd 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 membersAnd I add "Student 2 (student2@example.com)" user to "Group 1" group membersAnd I log outAnd I log in as "student1"And I view the "Student 2" contact in the message areaThen I should see "First access to site"@javascriptScenario: Accessibility, users can not click on profile image when on user's profile page.Given I log in as "admin"And I am on "Course 1" course homepageWhen I navigate to course participantsThen "//img[contains(@class, 'userpicture')]" "xpath_element" should existAnd "//a/child::img[contains(@class, 'userpicture')]" "xpath_element" should existWhen I follow "Teacher 1"Then I should see "Teacher 1"And "//img[contains(@class, 'userpicture')]" "xpath_element" should existAnd "//a/child::img[contains(@class, 'userpicture')]" "xpath_element" should not existWhen I follow "Full profile"And I should see "Teacher 1"Then "//img[contains(@class, 'userpicture')]" "xpath_element" should existAnd "//a/child::img[contains(@class, 'userpicture')]" "xpath_element" should not exist