AutorÃa | Ultima modificación | Ver Log |
@block @block_peopleFeature: Using the block_people pluginIn order to display the block_people pluginAs adminI need to be able to configure the plugin block_peopleBackground:Given the following "courses" exist:| fullname | shortname || Course 1 | C1 |And the following "users" exist:| username | firstname | lastname || teacher1 | Teacher | 1 || noneditor1 | Non-editing teacher | 1 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || noneditor1 | C1 | teacher |Scenario: Show participants in the block with the roles "Teacher" and "Non-editing teacher"# The values are the position 3 (Teacher) and 4 (Non-editing Teacher) in the current list.# If the list will be sorted in another way in the future this could break the test.Given the following config values are set as admin:| config | value | plugin || roles | 3, 4 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen the user "Teacher 1" should be listed in the section with the role "Teacher"And the user "Non-editing teacher 1" should be listed in the section with the role "Non-editing teacher"# Javascript is needed for Scenarios with visibility checks.@javascriptScenario: Counter check: Do not show any rolesGiven the following config values are set as admin:| config | value | plugin || roles | 0 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen ".block_people div.teachers" "css_element" should not be visibleScenario: Show participants in the block with the roles "Teacher" and ""Non-editing teacher" with setting "Show multiple roles" enabledGiven the following config values are set as admin:| config | value | plugin || multipleroles | 1 | block_people || roles | 3, 4 | block_people |And the following "users" exist:| username | firstname | lastname || multiroleuser | Multirole | User |And the following "course enrolments" exist:| user | course | role || multiroleuser | C1 | editingteacher |And the following "system role assigns" exist:| user | course | role || multiroleuser | Course 1 | teacher |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen the user "Teacher 1" should be listed in the section with the role "Teacher"And the user "Multirole User" should be listed in the section with the role "Teacher"And the user "Non-editing teacher 1" should be listed in the section with the role "Non-editing teacher"And the user "Multirole User" should be listed in the section with the role "Non-editing teacher"Scenario: Enable "Show link to the participants page"Given the following config values are set as admin:| config | value | plugin || linkparticipantspage | 1 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen I should see "Show participants list" in the ".block_people .participants" "css_element"When I click on "Show participants list" "link"Then I should see "Participants" in the "region-main" "region"Scenario: Counter check: Disable "Show link to the participants page"Given the following config values are set as admin:| config | value | plugin || linkparticipantspage | 0 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen ".block_people .participants" "css_element" should not existScenario: Enable "Hiding the block"Given the following config values are set as admin:| config | value | plugin || hideblock | 1 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockWhen I open the action menu in "People" "block"Then I should see "Hide People block"When I click on "Hide People block" "link"When I turn editing mode offThen "People" "block" should not existWhen I turn editing mode onAnd I open the action menu in "People" "block"And I click on "Show People block" "link"Then "People" "block" should existScenario: Counter check: Disable "Hiding the block"Given the following config values are set as admin:| config | value | plugin || hideblock | 0 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockWhen I open the action menu in "People" "block"Then I should not see "Hide People block"Scenario: Reset visibility of hidden People blocksWhen I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockAnd I open the action menu in "People" "block"And I click on "Hide People block" "link"And I turn editing mode offThen "People" "block" should not existAnd I log outWhen I log in as "admin"And I navigate to "Plugins > Blocks > People" in site administrationAnd I set the field "Reset visibility" to "1"And I press "Save changes"And I log outAnd I log in as "teacher1"And I am on "Course 1" course homepageThen "People" "block" should exist@javascriptScenario: The message icon is shown for users who can be messaged by the userGiven the following config values are set as admin:| config | value | plugin || linkmessaging | 1 | block_people || roles | 3, 4 | block_people |And the following "users" exist:| username | firstname | lastname || student1 | Student | User |And the following "course enrolments" exist:| user | course | role || student1 | C1 | student |And I log in as "noneditor1"And I open messagingAnd I open messaging settings preferencesAnd I click on "//label[text()[contains(.,'My contacts and anyone in my courses')]]" "xpath_element"And I log outAnd I log in as "teacher1"And I open messagingAnd I open messaging settings preferencesAnd I click on "//label[text()[contains(.,'My contacts only')]]" "xpath_element"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockAnd I log outAnd I log in as "student1"And I am on "Course 1" course homepageThen "a[title='Send message to Non-editing teacher 1']" "css_element" should existAnd "a[title='Send message to Teacher 1']" "css_element" should not exist@javascriptScenario: Counter check: Do not show the message iconGiven the following config values are set as admin:| config | value | plugin || linkmessaging | 0 | block_people || roles | 3, 4 | block_people |And the following "users" exist:| username | firstname | lastname || student1 | Student | User |And the following "course enrolments" exist:| user | course | role || student1 | C1 | student |And I log in as "noneditor1"And I open messagingAnd I open messaging settings preferencesAnd I click on "//label[text()[contains(.,'My contacts and anyone in my courses')]]" "xpath_element"And I log outAnd I log in as "teacher1"And I open messagingAnd I open messaging settings preferencesAnd I click on "//label[text()[contains(.,'My contacts only')]]" "xpath_element"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockAnd I log outAnd I log in as "student1"And I am on "Course 1" course homepageThen "a[title='Send message to Non-editing teacher 1']" "css_element" should not existAnd "a[title='Send message to Teacher 1']" "css_element" should not existScenario: Enable "Show link to the teacher page on the avatar"Given the following config values are set as admin:| config | value | plugin || linkavatar | 1 | block_people || roles | 3, 4 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen the user "Teacher 1" should be listed in the section with the role "Teacher"And ".block_people .teachers .image a" "css_element" should existAnd I click on ".block_people .teachers .image a" "css_element"And I should see "User details"And I should see "Course details"Scenario: Counter check: Disable "Show link to the teacher page on the avatar"Given the following config values are set as admin:| config | value | plugin || linkavatar | 0 | block_people || roles | 3, 4 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen the user "Teacher 1" should be listed in the section with the role "Teacher"And ".block_people .teachers .image a" "css_element" should not existScenario: Enable "Show link to the teacher page on the teacher name"Given the following config values are set as admin:| config | value | plugin || linkname | 1 | block_people || roles | 3, 4 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen the user "Teacher 1" should be listed in the section with the role "Teacher"And ".block_people .teachers .name a" "css_element" should existAnd I click on ".block_people .teachers .name a" "css_element"And I should see "User details"And I should see "Course details"Scenario: Counter check: Disable "Show link to the teacher page on the teacher name"Given the following config values are set as admin:| config | value | plugin || linkname | 0 | block_people || roles | 3, 4 | block_people |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen the user "Teacher 1" should be listed in the section with the role "Teacher"And ".block_people .teachers .name a" "css_element" should not existScenario: Do not show suspended users in the blockGiven the following config values are set as admin:| config | value | plugin || roles | 3, 4 | block_people |And the following "users" exist:| username | firstname | lastname || teacher2 | Teacher | 2 |And the following "course enrolments" exist:| user | course | role | status || teacher2 | C1 | editingteacher | 1 |And I log in as "admin"And I navigate to "Users > Accounts > Browse list of users" in site administrationAnd I click on "Edit" "link" in the "Teacher 2" "table_row"And I set the field "Suspended account" to "1"And I press "Update profile"And I log outWhen I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "People" blockThen the user "Teacher 1" should be listed in the section with the role "Teacher"And the user "Teacher 2" should not be listed in the section with the role "Teacher"