1 |
efrain |
1 |
@tool @javascript @tool_lp @tool_lp_plan_workflow
|
|
|
2 |
Feature: Manage plan workflow
|
|
|
3 |
As a user
|
|
|
4 |
In order to change the status of plan
|
|
|
5 |
I need to be able to change the status of a plan
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| user1 | User | 1 | user1@example.com |
|
|
|
11 |
| user2 | User | 2 | user2@example.com |
|
|
|
12 |
| manager1 | Manager | 1 | manager@example.com |
|
|
|
13 |
And the following "roles" exist:
|
|
|
14 |
| shortname | name | archetype |
|
|
|
15 |
| usermanageowndraftplan | User manage own draft plan role | user |
|
|
|
16 |
| usermanageownplan | User manage own plan role | user |
|
|
|
17 |
| manageplan | Manager all plans role | manager |
|
|
|
18 |
And the following "role capabilities" exist:
|
|
|
19 |
| role | moodle/competency:planmanageowndraft | moodle/competency:planmanageown |
|
|
|
20 |
| usermanageowndraftplan | allow | |
|
|
|
21 |
| usermanageownplan | allow | allow |
|
|
|
22 |
| manageplan | allow | allow |
|
|
|
23 |
And the following "role capability" exists:
|
|
|
24 |
| role | manageplan |
|
|
|
25 |
| moodle/competency:planmanage | allow |
|
|
|
26 |
| moodle/competency:planview | allow |
|
|
|
27 |
| moodle/competency:planreview | allow |
|
|
|
28 |
| moodle/competency:planrequestreview | allow |
|
|
|
29 |
And the following "role assigns" exist:
|
|
|
30 |
| user | role | contextlevel | reference |
|
|
|
31 |
| user1 | usermanageowndraftplan | System | |
|
|
|
32 |
| user2 | usermanageownplan | System | |
|
|
|
33 |
| manager1 | manageplan | System | |
|
|
|
34 |
And the following lp "frameworks" exist:
|
|
|
35 |
| shortname | idnumber |
|
|
|
36 |
| Test-Framework | ID-FW1 |
|
|
|
37 |
And the following lp "competencies" exist:
|
|
|
38 |
| shortname | framework |
|
|
|
39 |
| Test-Comp1 | ID-FW1 |
|
|
|
40 |
| Test-Comp2 | ID-FW1 |
|
|
|
41 |
And the following lp "plans" exist:
|
|
|
42 |
| name | user | description |
|
|
|
43 |
| Test-Plan1 | user1 | Description of plan for user 1 |
|
|
|
44 |
| Test-Plan2 | user2 | Description of plan for user 2 |
|
|
|
45 |
And the following lp "plancompetencies" exist:
|
|
|
46 |
| plan | competency |
|
|
|
47 |
| Test-Plan1 | Test-Comp1 |
|
|
|
48 |
| Test-Plan1 | Test-Comp2 |
|
|
|
49 |
| Test-Plan2 | Test-Comp1 |
|
|
|
50 |
| Test-Plan2 | Test-Comp2 |
|
|
|
51 |
And the following "blocks" exist:
|
|
|
52 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
53 |
| lp | System | 1 | my-index | content |
|
|
|
54 |
|
|
|
55 |
Scenario: User can manages his own plan draft
|
|
|
56 |
Given I log in as "user1"
|
|
|
57 |
And I follow "Profile" in the user menu
|
|
|
58 |
When I follow "Learning plans"
|
|
|
59 |
Then I should see "List of learning plans"
|
|
|
60 |
And I should see "Test-Plan1"
|
|
|
61 |
And I should not see "Test-Plan2"
|
|
|
62 |
And I click on "Request review" of edit menu in the "Test-Plan1" row
|
|
|
63 |
And I should see "Waiting for review"
|
|
|
64 |
And I click on "Cancel review" of edit menu in the "Test-Plan1" row
|
|
|
65 |
And I should see "Draft"
|
|
|
66 |
And I log out
|
|
|
67 |
|
|
|
68 |
Scenario: User can manages his own plan
|
|
|
69 |
Given I log in as "user2"
|
|
|
70 |
And I follow "Profile" in the user menu
|
|
|
71 |
When I follow "Learning plans"
|
|
|
72 |
Then I should see "List of learning plans"
|
|
|
73 |
And I should see "Test-Plan2"
|
|
|
74 |
And I should not see "Test-Plan1"
|
|
|
75 |
And I click on "Request review" of edit menu in the "Test-Plan2" row
|
|
|
76 |
And I should see "Waiting for review"
|
|
|
77 |
And I click on "Start review" of edit menu in the "Test-Plan2" row
|
|
|
78 |
And I should see "In review"
|
|
|
79 |
And I click on "Finish review" of edit menu in the "Test-Plan2" row
|
|
|
80 |
And I should see "Draft"
|
|
|
81 |
And I click on "Make active" of edit menu in the "Test-Plan2" row
|
|
|
82 |
And I should see "Active"
|
|
|
83 |
And I click on "Complete this learning plan" of edit menu in the "Test-Plan2" row
|
|
|
84 |
And I click on "Complete this learning plan" "button" in the "Confirm" "dialogue"
|
|
|
85 |
And I should see "Complete"
|
|
|
86 |
And I click on "Reopen this learning plan" of edit menu in the "Test-Plan2" row
|
|
|
87 |
And I click on "Reopen this learning plan" "button" in the "Confirm" "dialogue"
|
|
|
88 |
And I should see "Active"
|
|
|
89 |
And I log out
|
|
|
90 |
|
|
|
91 |
Scenario: Manager can see learning plan with status waiting for review
|
|
|
92 |
Given the following lp "plans" exist:
|
|
|
93 |
| name | user | description | status |
|
|
|
94 |
| Test-Plan3 | user2 | Description of plan 3 for user 1 | waiting for review |
|
|
|
95 |
| Test-Plan4 | user1 | Description of plan 3 for user 1 | draft |
|
|
|
96 |
When I log in as "manager1"
|
|
|
97 |
Then I should see "Test-Plan3"
|
|
|
98 |
And I should not see "Test-Plan4"
|
|
|
99 |
And I log out
|
|
|
100 |
|
|
|
101 |
Scenario: Manager can start review of learning plan with status waiting for review
|
|
|
102 |
Given the following lp "plans" exist:
|
|
|
103 |
| name | user | description | status |
|
|
|
104 |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | waiting for review |
|
|
|
105 |
And I log in as "manager1"
|
|
|
106 |
And I follow "Test-Plan3"
|
|
|
107 |
And I should see "User 1"
|
|
|
108 |
And I should see "Test-Plan3"
|
|
|
109 |
When I follow "Start review"
|
|
|
110 |
Then I should see "In review"
|
|
|
111 |
And I log out
|
|
|
112 |
|
|
|
113 |
Scenario: Manager can reject a learning plan with status in review
|
|
|
114 |
Given the following lp "plans" exist:
|
|
|
115 |
| name | user | description | status | reviewer |
|
|
|
116 |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | in review | manager1 |
|
|
|
117 |
And I log in as "manager1"
|
|
|
118 |
And I follow "Test-Plan3"
|
|
|
119 |
And I should see "User 1"
|
|
|
120 |
And I should see "Test-Plan3"
|
|
|
121 |
And I should see "In review"
|
|
|
122 |
When I follow "Finish review"
|
|
|
123 |
Then I should see "Draft"
|
|
|
124 |
And I log out
|
|
|
125 |
|
|
|
126 |
Scenario: Manager can accept a learning plan with status in review
|
|
|
127 |
Given the following lp "plans" exist:
|
|
|
128 |
| name | user | description | status | reviewer |
|
|
|
129 |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | in review | manager1 |
|
|
|
130 |
And I log in as "manager1"
|
|
|
131 |
And I follow "Test-Plan3"
|
|
|
132 |
And I should see "User 1"
|
|
|
133 |
And I should see "Test-Plan3"
|
|
|
134 |
And I should see "In review"
|
|
|
135 |
When I follow "Make active"
|
|
|
136 |
Then I should see "Active"
|
|
|
137 |
And I log out
|
|
|
138 |
|
|
|
139 |
Scenario: Manager send back to draft an active learning plan
|
|
|
140 |
Given the following lp "plans" exist:
|
|
|
141 |
| name | user | description | status | reviewer |
|
|
|
142 |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
|
|
|
143 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
|
|
|
144 |
And I am on the "user1" "user > profile" page logged in as "manager1"
|
|
|
145 |
And I follow "Learning plans"
|
|
|
146 |
And I should see "List of learning plans"
|
|
|
147 |
When I click on "Send back to draft" of edit menu in the "Test-Plan3" row
|
|
|
148 |
And I follow "Test-Plan4"
|
|
|
149 |
And I follow "Send back to draft"
|
|
|
150 |
And I follow "Learning plans"
|
|
|
151 |
Then I should see "Draft"
|
|
|
152 |
And I should not see "Active"
|
|
|
153 |
And I log out
|
|
|
154 |
|
|
|
155 |
Scenario: Manager change an active learning plan to completed
|
|
|
156 |
Given the following lp "plans" exist:
|
|
|
157 |
| name | user | description | status | reviewer |
|
|
|
158 |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
|
|
|
159 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
|
|
|
160 |
And I am on the "user1" "user > profile" page logged in as "manager1"
|
|
|
161 |
And I follow "Learning plans"
|
|
|
162 |
And I should see "List of learning plans"
|
|
|
163 |
When I click on "Complete this learning plan" of edit menu in the "Test-Plan3" row
|
|
|
164 |
And I click on "Complete this learning plan" "button" in the "Confirm" "dialogue"
|
|
|
165 |
And I wait until the page is ready
|
|
|
166 |
And I follow "Test-Plan4"
|
|
|
167 |
And I follow "Complete this learning plan"
|
|
|
168 |
And I click on "Complete this learning plan" "button" in the "Confirm" "dialogue"
|
|
|
169 |
And I follow "Learning plans"
|
|
|
170 |
Then I should see "Complete"
|
|
|
171 |
And I should not see "Active"
|
|
|
172 |
And I log out
|
|
|
173 |
|
|
|
174 |
Scenario: Manager reopen a complete learning plan
|
|
|
175 |
Given the following lp "plans" exist:
|
|
|
176 |
| name | user | description | status | reviewer |
|
|
|
177 |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | complete | manager1 |
|
|
|
178 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | complete | manager1 |
|
|
|
179 |
And I am on the "user1" "user > profile" page logged in as "manager1"
|
|
|
180 |
And I follow "Learning plans"
|
|
|
181 |
And I should see "List of learning plans"
|
|
|
182 |
When I click on "Reopen this learning plan" of edit menu in the "Test-Plan3" row
|
|
|
183 |
And I click on "Reopen this learning plan" "button" in the "Confirm" "dialogue"
|
|
|
184 |
And I follow "Test-Plan4"
|
|
|
185 |
And I follow "Reopen this learning plan"
|
|
|
186 |
And I click on "Reopen this learning plan" "button" in the "Confirm" "dialogue"
|
|
|
187 |
And I follow "Learning plans"
|
|
|
188 |
Then I should see "Active"
|
|
|
189 |
And I should not see "Complete"
|
|
|
190 |
And I log out
|