Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
@tool @tool_policyFeature: Manage policiesIn order to manage policiesAs a managerI need to be able to create and edit site policiesBackground:Given the following config values are set as admin:| sitepolicyhandler | tool_policy |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 | |Scenario: Create new policy and save as draftWhen I log in as "manager"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I follow "New policy"And I set the following fields to these values:| Name | Policy1 || Version | v1 || Summary | Policy summary || Full policy | Full text |And the field "Type" matches value "Site policy"And the field "User consent" matches value "All users"And the field "status" matches value "0"And "Draft" "field" should existAnd "Active" "field" should existAnd "Minor change" "field" should not existAnd I should not see "Minor change"And "Save as draft" "button" should not existAnd I press "Save"Then the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Draft | v1 | N/A |And I log outScenario: Create new policy and save as activeWhen I log in as "manager"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I follow "New policy"And I set the following fields to these values:| Name | Policy1 || Version | v1 || Summary | Policy summary || Full policy | Full text || Active | 1 |And I press "Save"Then the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Active | v1 | 0 of 4 (0%) |And I log outScenario: Edit active policy and save as minor changeGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | active |And I log in as "manager"And I press "Next"And I set the field "I agree to the Policy1" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Edit" "link" in the "Policy1" "table_row"And "Draft" "field" should not existAnd "Active" "field" should not existAnd "Minor change" "field" should existAnd "Save as draft" "button" should existAnd I set the field "Version" to "v1 amended"And I set the field "Minor change" to "1"And I press "Save"Then the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Active | v1 amended | 1 of 4 (25%) |And I log outScenario: Edit active policy and save as draftGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | active |And I log in as "manager"And I press "Next"And I set the field "I agree to the Policy1" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Edit" "link" in the "Policy1" "table_row"And I set the field "Version" to "v2"And I press "Save as draft"Then the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Active | v1 | 1 of 4 (25%) || Policy1 Site policy, All users, Compulsory | Draft | v2 | N/A |And I log outScenario: Edit active policy and save as new active versionGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | active |And I log in as "manager"And I press "Next"And I set the field "I agree to the Policy1" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Edit" "link" in the "Policy1" "table_row"And I set the field "Name" to "Policy2"And I set the field "Version" to "v2"And I press "Save"Then the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy2 Site policy, All users, Compulsory | Active | v2 | 0 of 4 (0%) |And I should not see "Policy1"And I should not see "v1"And I click on "View previous versions" "link" in the "Policy2" "table_row"And I should see "Policy2 previous versions"And I should not see "v2"Then the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Inactive | v1 | 1 of 4 (25%) |And I log outScenario: Edit draft policy and save as draftGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | draft |And I log in as "manager"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Edit" "link" in the "Policy1" "table_row"And I set the field "Version" to "v2"And "Draft" "field" should existAnd "Active" "field" should existAnd "Minor change" "field" should not existAnd I should not see "Minor change"And "Save as draft" "button" should not existAnd I press "Save"Then the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Draft | v2 | N/A |And I should not see "v1"And "View previous versions" "link" should not existAnd I log outScenario: Edit draft policy and save as activeGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | draft |And I log in as "manager"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Edit" "link" in the "Policy1" "table_row"And I set the field "Version" to "v2"And I set the field "Active" to "1"And I press "Save"Then the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Active | v2 | 0 of 4 (0%) |And I should not see "v1"And "View previous versions" "link" should not existAnd I log outScenario: Activate draft policyGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | draft |And I log in as "manager"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Set status to \"Active\"" "link" in the "Policy1" "table_row"Then I should see "All users will be required to agree to this new policy version to be able to use the site."And I press "Continue"And the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Active | v1 | 0 of 4 (0%) |And "View previous versions" "link" should not existAnd I log outScenario: Edit archived policy and save as draftGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | active |And I log in as "manager"And I press "Next"And I set the field "I agree to the Policy1" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Set status to \"Inactive\"" "link" in the "Policy1" "table_row"Then I should see "You are about to inactivate policy"And I press "Continue"And the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Inactive | v1 | 1 of 4 (25%) |And I click on "Create a new draft" "link" in the "Policy1" "table_row"And I set the field "Version" to "v2"And I set the field "Name" to "Policy2"And the field "status" matches value "0"And "Draft" "field" should existAnd "Active" "field" should existAnd "Minor change" "field" should not existAnd I should not see "Minor change"And "Save as draft" "button" should not existAnd I press "Save"And the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy2 Site policy, All users, Compulsory | Draft | v2 | N/A |And I should not see "v1"And I should not see "Policy1"And I click on "View previous versions" "link" in the "Policy2" "table_row"And I should see "Policy2 previous versions"And the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Inactive | v1 | 1 of 4 (25%) |And I should not see "v2"And I log outScenario: Edit archived policy and save as activeGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | active |And I log in as "manager"And I press "Next"And I set the field "I agree to the Policy1" to "1"And I press "Next"And I navigate to "Users > Privacy and policies > Manage policies" in site administrationAnd I click on "Set status to \"Inactive\"" "link" in the "Policy1" "table_row"And I press "Continue"And I click on "Create a new draft" "link" in the "Policy1" "table_row"And I set the field "Version" to "v2"And I set the field "Name" to "Policy2"And I set the field "Active" to "1"And I press "Save"And the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy2 Site policy, All users, Compulsory | Active | v2 | 0 of 4 (0%) |And I should not see "v1"And I should not see "Policy1"And I click on "View previous versions" "link" in the "Policy2" "table_row"And I should see "Policy2 previous versions"And the following should exist in the "tool-policy-managedocs-wrapper" table:| Name | Policy status | Version | Agreements || Policy1 Site policy, All users, Compulsory | Inactive | v1 | 1 of 4 (25%) |And I should not see "v2"And I log outScenario: Current user can go back to previous page in List of active policies pageGiven the following policies exist:| Name | Revision | Content | Summary | Status || Policy1 | v1 | full text2 | short text2 | active |And I log in as "user1"And I press "Next"And I set the field "I agree to the Policy1" to "1"And I press "Next"And I follow "Preferences" in the user menuAnd I should see "Preferences"And I should see "Policies"# User should see a redirect back to previous page link.And I click on "Policies" "link"And I should see "List of active policies"And I should see "Go back to previous page"When I click on "Go back to previous page" "link"Then I should see "Preferences"