1- @tool @tool_lifecycle @manual_trigger
2- Feature : Add an admin approve step with 'button' customisation
1+ @tool @tool_lifecycle @lifecyclestep @lifecyclestep_adminapprove
2+ Feature : Add an admin approve step without 'button' customisation
3+
34 Background :
45 Given the following "users" exist:
56 | username | firstname | lastname | email |
@@ -16,8 +17,8 @@ Feature: Add an admin approve step with 'button' customisation
1617 And I am on workflowdrafts page
1718 And I click on "Create new workflow" "link"
1819 And I set the following fields to these values:
19- | Title | My Workflow |
20- | Displayed workflow title | Teachers view on workflow |
20+ | Title | My Workflow |
21+ | Displayed workflow title | Teachers view on workflow |
2122 And I press "Save changes"
2223 And I select "Manual trigger" from the "tool_lifecycle-choose-trigger" singleselect
2324 And I set the following fields to these values:
@@ -26,63 +27,77 @@ Feature: Add an admin approve step with 'button' customisation
2627 | Action name | Backup course |
2728 | Capability | moodle /course :manageactivities |
2829 And I press "Save changes"
30+
2931 And I select "Admin approve step" from the "tool_lifecycle-choose-step" singleselect
30- And I set the field "Instance name" to "Admin approve step"
32+ And I set the field "Instance name" to "admin approve step"
3133 And I set the field "Label of the proceed button" to "Create backup"
32- And I set the field "Label of the rollback button" to "Cancel workflow"
34+ And I set the field "Label of the rollback button" to "Call off workflow"
3335 And I set the field "Label of the proceed selected button" to "Selected create backup"
34- And I set the field "Label of the rollback selected button" to "Selected cancel workflow"
36+ And I set the field "Label of the rollback selected button" to "Selected call off workflow"
3537 And I press "Save changes"
38+
3639 And I select "Create backup step" from the "tool_lifecycle-choose-step" singleselect
3740 And I set the field "Instance name" to "Create backup step"
3841 And I press "Save changes"
3942
40- When I am on workflowdrafts page
43+ And I am on workflowdrafts page
4144 And I press "Activate"
4245 And I log out
46+
4347 And I log in as "teacher1"
4448 And I am on lifecycle view
49+ Then I should see the tool "Backup course" in the "Course 1" row of the "tool_lifecycle_remaining" table
4550 When I click on the tool "Backup course" in the "Course 1" row of the "tool_lifecycle_remaining" table
4651 Then I should see "Workflow started successfully."
47- When I click on the tool "Backup course" in the "Course 2" row of the "tool_lifecycle_remaining" table
48- Then I should see "Workflow started successfully."
49-
5052 And I log out
53+
5154 And I log in as "admin"
5255 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
56+ And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
5357 And I wait "5" seconds
5458
5559 @javascript
56- Scenario : Check button texts on approval page
60+ Scenario : Check button texts on approval page (default)
5761
5862 When I am on approvals page
59- And I click on "Admin approve step" "link"
60- Then I should see "Create backup"
61- And I should see "Cancel workflow"
62- And I should see "Selected create backup"
63- And I should see "Selected cancel workflow"
63+ And I click on "admin approve step" "link"
64+ Then "Selected create backup" "button" should exist
65+ And "Selected call off workflow" "button" should exist
66+ And "Create backup" "button" should exist
67+ And "Call off workflow" "button" should exist
6468
6569 @javascript
66- Scenario : Proceed on approval page (customisation )
70+ Scenario : Proceed on approval page (default )
6771
6872 When I am on approvals page
69- And I click on "Admin approve step" "link"
70- And I click on the tool "Create backup" in the "Course 1" row of the "lifecyclestep_adminapprove-decisiontable" table
73+ And I click on "admin approve step" "link"
74+ Then I should see "Course 1"
75+ And I click on "checkall" "checkbox"
76+ And I click on "Create backup" "button"
7177
7278 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
7379 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
74- And I wait "5 " seconds
80+ And I wait "25 " seconds
7581
7682 And I am on coursebackups page
7783 Then I should see "Course 1"
78- And I should not see "Course 2"
7984
8085 @javascript
81- Scenario : Proceed all on approval page (customisation)
86+ Scenario : Proceed all on approval page (default)
87+
88+ When I log in as "teacher1"
89+ And I am on lifecycle view
90+ Then I should see the tool "Backup course" in the "Course 2" row of the "tool_lifecycle_remaining" table
91+ When I click on the tool "Backup course" in the "Course 2" row of the "tool_lifecycle_remaining" table
92+ Then I should see "Workflow started successfully."
93+ And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
94+ And I wait "5" seconds
95+ And I log out
8296
97+ And I log in as "admin"
8398 When I am on approvals page
84- And I click on "Admin approve step" "link"
85- And I check "checkall"
99+ And I click on "admin approve step" "link"
100+ And I click on "checkall" "checkbox "
86101 And I click on "Selected create backup" "button"
87102
88103 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
@@ -91,71 +106,84 @@ Feature: Add an admin approve step with 'button' customisation
91106
92107 And I am on coursebackups page
93108 Then I should see "Course 1"
94- And I should not see "Course 2"
109+ And I should see "Course 2"
95110
96111 @javascript
97- Scenario : Rollback on approval page (customisation )
112+ Scenario : Rollback on approval page (default )
98113
99114 When I am on approvals page
100- And I click on "Admin approve step" "link"
101- And I click on "Cancel workflow" "button"
115+ And I click on "admin approve step" "link"
116+ Then I should see "Course 1"
117+ And I click on "checkall" "checkbox"
118+ And I click on "Call off workflow" "button"
102119
103120 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
104121 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
105- And I wait "5 " seconds
122+ And I wait "25 " seconds
106123
107124 And I am on delayedworkflows page
108125 Then I should see "Course 1"
109- And I should not see "Course 2"
110126
111127 @javascript
112- Scenario : Rollback all on approval page (customisation )
128+ Scenario : Rollback all on approval page (default )
113129
114- When I am on approvals page
115- And I click on "Admin approve step" "link"
116- And I check "checkall"
117- And I click on "Selected cancel workflow" "button"
130+ When I log in as "teacher1"
131+ And I am on lifecycle view
132+ Then I should see the tool "Backup course" in the "Course 2" row of the "tool_lifecycle_remaining" table
133+ When I click on the tool "Backup course" in the "Course 2" row of the "tool_lifecycle_remaining" table
134+ Then I should see "Workflow started successfully."
135+ And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
136+ And I wait "5" seconds
137+ And I log out
138+
139+ When I log in as "admin"
140+ And I am on approvals page
141+ And I click on "admin approve step" "link"
142+ And I click on "checkall" "checkbox"
143+ And I click on "Selected call off workflow" "button"
118144
119145 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
120146 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
121147 And I wait "5" seconds
122148
123149 And I am on delayedworkflows page
124150 Then I should see "Course 1"
125- And I should not see "Course 2"
151+ And I should see "Course 2"
126152
127153 @javascript
128- Scenario : Proceed on active workflows page (customisation )
154+ Scenario : Proceed on active workflows page (default )
129155
130156 When I am on activeworkflows page
131157 Then I should see the row "My Workflow" in the "tool_lifecycle_manual_workflows" table
132158 When I click on the tool "View workflow steps" in the "My Workflow" row of the "tool_lifecycle_manual_workflows" table
133159 Then I should see "Courses: 1"
134160 When I click on "Courses: 1" "link"
161+ Then I should see "Call off workflow"
135162 And I should see "Create backup"
136- And I click on "Create backup" "button"
163+ When I click on "Create backup" "button"
137164
165+ And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
138166 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
139167 And I wait "5" seconds
140168
141169 And I am on coursebackups page
142170 Then I should see "Course 1"
143- And I should not see "Course 2"
144171
145172 @javascript
146- Scenario : Rollback on active workflows page (customisation )
173+ Scenario : Rollback on active workflows page (default )
147174
148175 When I am on activeworkflows page
149176 Then I should see the row "My Workflow" in the "tool_lifecycle_manual_workflows" table
150177 When I click on the tool "View workflow steps" in the "My Workflow" row of the "tool_lifecycle_manual_workflows" table
151178 Then I should see "Courses: 1"
152179 When I click on "Courses: 1" "link"
153- Then I should see "Cancel workflow"
180+ Then I should see "Call off workflow"
154181 And I should see "Create backup"
155- And I click on "Cancel workflow" "button"
182+ When I click on "Call off workflow" "button"
156183
157184 And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
158- And I wait "5" seconds
185+ And I run the scheduled task "tool_lifecycle\t ask\l ifecycle_task"
186+ And I wait "25" seconds
159187
160188 And I am on delayedworkflows page
161189 Then I should see "Course 1"
0 commit comments