Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
@tool @tool_policyFeature: Viewing acceptances reports and accepting on behalf of other usersIn order to manage user acceptancesAs a managerI need to be able to view acceptances and accept on behalf of other usersBackground:Given the following config values are set as admin:| sitepolicyhandler | tool_policy |# This is required for now to prevent the overflow region affecting the action menus.And I change window size to "large"And the following policies exist:| Name | Revision | Content | Summary | Status || This site policy | | full text2 | short text2 | active || This privacy policy | | full text3 | short text3 | draft |And the following "users" exist:| username | firstname | lastname | email || user1 | User | One | one@example.com || user2 | User | Two | two@example.com || manager | Max | Manager | man@example.com |And the following "role assigns" exist:| user | role | contextlevel | reference || manager | manager | System | |And the following "courses" exist:| fullname | shortname || Course1 | C1 |And the following "course enrolments" exist:| user | course | role || user1 | C1 | student || user2 | C1 | student |Scenario: View acceptances made by users on their own, single policyWhen I log in as "user1"Then I should see "This site policy"And I should not see "Course overview"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I press "Next"And I should see "Calendar"And I log outAnd I log in as "manager"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > User agreements" in site administrationAnd "Accepted" "text" should exist in the "User One" "table_row"And "Accepted" "text" should exist in the "Max Manager" "table_row"And "Pending" "text" should exist in the "User Two" "table_row"Scenario: Agree on behalf of another user as a manager, single policy, javascript offGiven the following "role capability" exists:| role | manager || tool/policy:acceptbehalf | allow |When I log in as "manager"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"And I click on "Accept This site policy" "link" in the "User One" "table_row"Then I should see "Accepting policy"And I should see "User One"And I should see "This site policy"And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."And I set the field "Remarks" to "Consent received from a parent"And I press "Give consent"And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"And "Max Manager" "link" should exist in the "User One" "table_row"And "Consent received from a parent" "text" should exist in the "User One" "table_row"And "Pending" "text" should exist in the "User Two" "table_row"@javascriptScenario: Agree on behalf of another user as a manager, single policy, javascript onGiven the following "role capability" exists:| role | manager || tool/policy:acceptbehalf | allow |When I log in as "manager"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I press "Next"And I should see "Calendar"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"And I click on "Accept This site policy" "link" in the "User One" "table_row"Then I should see "Give consent"And I should see "User One"And I should see "This site policy"And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."And I set the field "Remarks" to "Consent received from a parent"And I press "Give consent"And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"And "Max Manager" "link" should exist in the "User One" "table_row"And "Consent received from a parent" "text" should exist in the "User One" "table_row"And "Pending" "text" should exist in the "User Two" "table_row"Scenario: View acceptances made by users on their own, multiple policiesGiven I log in as "admin"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"And I press "Continue"And I log outWhen I log in as "user1"Then I should see "This site policy"And I press "Next"And I should see "This privacy policy"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I set the field "I agree to the This privacy policy" to "1"And I press "Next"And I should see "Calendar"And I log outAnd I log in as "manager"And I press "Next"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I set the field "I agree to the This privacy policy" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > User agreements" in site administrationAnd "Accepted" "text" should exist in the "User One" "table_row"And "Pending" "text" should not exist in the "User One" "table_row"And "Accepted" "text" should exist in the "Max Manager" "table_row"And "Pending" "text" should exist in the "User Two" "table_row"And "Accepted" "text" should not exist in the "User Two" "table_row"And I click on "Details" "link" in the "User One" "table_row"And "Accepted" "text" should exist in the "This site policy" "table_row"And "Accepted" "text" should exist in the "This privacy policy" "table_row"And I am on site homepageAnd I navigate to "Users > Privacy and policies > User agreements" in site administrationAnd I click on "Details" "link" in the "User Two" "table_row"And "Pending" "text" should exist in the "This site policy" "table_row"And "Pending" "text" should exist in the "This privacy policy" "table_row"Scenario: Agree on behalf of another user as a manager, multiple policies, javascript offGiven the following "role capability" exists:| role | manager || tool/policy:acceptbehalf | allow |And I log in as "admin"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"And I press "Continue"And I log outWhen I log in as "manager"And I press "Next"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I set the field "I agree to the This privacy policy" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > User agreements" in site administrationAnd I click on "Accept This site policy" "link" in the "User One" "table_row"Then I should see "Accepting policy"And I should see "User One"And I should see "This site policy"And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."And I set the field "Remarks" to "Consent received from a parent"And I press "Give consent"And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"And "Pending" "text" should exist in the "User One" "table_row"And I click on "Details" "link" in the "User One" "table_row"And "Accepted on user's behalf" "text" should exist in the "This site policy" "table_row"And "Max Manager" "link" should exist in the "This site policy" "table_row"And "Consent received from a parent" "text" should exist in the "This site policy" "table_row"And "Pending" "text" should exist in the "This privacy policy" "table_row"@javascriptScenario: Agree on behalf of another user as a manager, multiple policies, javascript onGiven the following "role capability" exists:| role | manager || tool/policy:acceptbehalf | allow |And I log in as "admin"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"And I press "Activate"And I log outWhen I log in as "manager"And I press "Next"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I set the field "I agree to the This privacy policy" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > User agreements" in site administrationAnd I click on "Accept This site policy" "link" in the "User One" "table_row"Then I should see "Give consent"And I should see "User One"And I should see "This site policy"And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."And I set the field "Remarks" to "Consent received from a parent"And I press "Give consent"And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"And "Pending" "text" should exist in the "User One" "table_row"And I click on "Details" "link" in the "User One" "table_row"And "Accepted on user's behalf" "text" should exist in the "This site policy" "table_row"And "Max Manager" "link" should exist in the "This site policy" "table_row"And "Consent received from a parent" "text" should exist in the "This site policy" "table_row"And "Pending" "text" should exist in the "This privacy policy" "table_row"Scenario: Policies and agreements profile link visible for current userGiven I log in as "user1"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I press "Next"When I follow "Profile" in the user menu# User can see his own agreements link in the profile.Then I should see "Policies and agreements"And I follow "Policies and agreements"And "Accepted" "text" should exist in the "This site policy" "table_row"# User can't see agreements link in other user profiles.And I am on "Course1" course homepageAnd I navigate to course participantsAnd I follow "User Two"And I should not see "Policies and agreements"Scenario: Policies and agreements profile link visible also for users who can access on behalf of othersGiven the following "role capability" exists:| role | manager || tool/policy:acceptbehalf | allow |And I log in as "manager"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I press "Next"# User can see agreements link in other user profiles because has the capability for accepting on behalf of them.When I am on "Course1" course homepageAnd I navigate to course participantsAnd I follow "User Two"Then I should see "Policies and agreements"Scenario: Agree on behalf of another user as an admin who is logged in as a managerGiven the following "role capability" exists:| role | manager || tool/policy:acceptbehalf | allow |When I log in as "manager"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I press "Next"And I log outAnd I am on the "manager" "user > profile" page logged in as "admin"And I follow "Log in as"And I press "Continue"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"And I click on "Accept This site policy" "link" in the "User One" "table_row"Then I should see "Accepting policy"And I should see "User One"And I should see "This site policy"And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."And I set the field "Remarks" to "Consent received from a parent"And I press "Give consent"And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"And "Max Manager" "link" should not exist in the "User One" "table_row"And "Admin User" "link" should exist in the "User One" "table_row"And "Consent received from a parent" "text" should exist in the "User One" "table_row"And "Pending" "text" should exist in the "User Two" "table_row"@javascriptScenario: Bulk agree on behalf of another users as a manager, multiple policies, javascript onGiven the following "role capability" exists:| role | manager || tool/policy:acceptbehalf | allow |And I log in as "admin"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"And I press "Activate"And I log outWhen I log in as "manager"And I press "Next"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I set the field "I agree to the This privacy policy" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > User agreements" in site administrationAnd I click on "Select" "checkbox" in the "User One" "table_row"And I press "Consent"And I should see "Accepting policy"And I should see "One"And I click on "Cancel" "button" in the "Accepting policy" "dialogue"And I should not see "Accepting policy"And I click on "Select" "checkbox" in the "User Two" "table_row"And I press "Consent"And I should see "Accepting policy"And I should see "User One, User Two"When I press "Give consent"Then "Accepted on user's behalf" "text" should exist in the "User One" "table_row"And "Accepted on user's behalf" "text" should exist in the "User Two" "table_row"Scenario: View acceptances made by users on their own after inactivating a policyGiven I log in as "user1"And I should see "This site policy"And I should not see "Course overview"And I press "Next"And I set the field "I agree to the This site policy" to "1"And I press "Next"And I should see "Calendar"And I log outAnd I log in as "admin"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"And I press "Continue"And I click on "Set status to \"Inactive\"" "link" in the "This privacy policy" "table_row"And I press "Continue"And I log outWhen I log in as "user1"Then I should see "Calendar"