| 1 |
efrain |
1 |
@tool @tool_task
|
|
|
2 |
Feature: See running scheduled tasks
|
|
|
3 |
In order to configure scheduled tasks
|
|
|
4 |
As an admin
|
|
|
5 |
I need to see if tasks are running
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given I log in as "admin"
|
|
|
9 |
|
|
|
10 |
Scenario: If no task is running, I should see the corresponding message
|
|
|
11 |
Given I navigate to "Server > Tasks > Tasks running now" in site administration
|
|
|
12 |
Then I should see "Nothing to display"
|
|
|
13 |
|
|
|
14 |
Scenario: If tasks are running, I should see task details
|
|
|
15 |
Given the following "tool_task > scheduled tasks" exist:
|
|
|
16 |
| classname | seconds | hostname | pid |
|
|
|
17 |
| \core\task\automated_backup_task | 121 | c69335460f7f | 1914 |
|
|
|
18 |
And the following "tool_task > adhoc tasks" exist:
|
|
|
19 |
| classname | seconds | hostname | pid |
|
|
|
20 |
| \core\task\asynchronous_backup_task | 7201 | c69335460f7f | 1915 |
|
|
|
21 |
| \core\task\asynchronous_restore_task | 172800 | c69335460f7f | 1916 |
|
|
|
22 |
And I navigate to "Server > Tasks > Tasks running now" in site administration
|
|
|
23 |
|
|
|
24 |
# Check the scheduled task details.
|
|
|
25 |
Then I should see "Scheduled" in the "\core\task\automated_backup_task" "table_row"
|
|
|
26 |
And I should see "2 mins" in the "Automated backups" "table_row"
|
|
|
27 |
And I should see "c69335460f7f" in the "Automated backups" "table_row"
|
|
|
28 |
And I should see "1914" in the "Automated backups" "table_row"
|
|
|
29 |
|
|
|
30 |
# Check the "asynchronous_backup_task" adhoc task details.
|
|
|
31 |
And I should see "Ad hoc" in the "\core\task\asynchronous_backup_task" "table_row"
|
|
|
32 |
And I should see "2 hours" in the "core\task\asynchronous_backup_task" "table_row"
|
|
|
33 |
And I should see "c69335460f7f" in the "core\task\asynchronous_backup_task" "table_row"
|
|
|
34 |
And I should see "1915" in the "core\task\asynchronous_backup_task" "table_row"
|
|
|
35 |
|
|
|
36 |
# Check the "asynchronous_restore_task" adhoc task details.
|
|
|
37 |
And I should see "Ad hoc" in the "\core\task\asynchronous_restore_task" "table_row"
|
|
|
38 |
And I should see "2 days" in the "core\task\asynchronous_restore_task" "table_row"
|
|
|
39 |
And I should see "c69335460f7f" in the "core\task\asynchronous_restore_task" "table_row"
|
|
|
40 |
And I should see "1916" in the "core\task\asynchronous_restore_task" "table_row"
|
| 1441 |
ariadna |
41 |
|
|
|
42 |
@javascript
|
|
|
43 |
Scenario: If a task with a stored progress bar is running, I should be able to observe the progress.
|
|
|
44 |
Given the following config values are set as admin:
|
|
|
45 |
| progresspollinterval | 1 |
|
|
|
46 |
And the following "tool_task > scheduled tasks" exist:
|
|
|
47 |
| classname | seconds | hostname | pid |
|
|
|
48 |
| \core\task\delete_unconfirmed_users_task | 120 | c69335460f7f | 1917 |
|
|
|
49 |
And the following "stored progress bars" exist:
|
|
|
50 |
| idnumber | percent |
|
|
|
51 |
| core_task_delete_unconfirmed_users_task | 50.00 |
|
|
|
52 |
And I navigate to "Server > Tasks > Tasks running now" in site administration
|
|
|
53 |
And I should see "2 mins" in the "Delete unconfirmed users" "table_row"
|
|
|
54 |
And I should see "c69335460f7f" in the "Delete unconfirmed users" "table_row"
|
|
|
55 |
And I should see "1917" in the "Delete unconfirmed users" "table_row"
|
|
|
56 |
And I should see "50.0%" in the "Delete unconfirmed users" "table_row"
|
|
|
57 |
When I set the stored progress bar "core_task_delete_unconfirmed_users_task" to "75.00"
|
|
|
58 |
# Wait for the progress polling.
|
|
|
59 |
And I wait "1" seconds
|
|
|
60 |
Then I should not see "50.0%" in the "Delete unconfirmed users" "table_row"
|
|
|
61 |
And I should see "75.0%" in the "Delete unconfirmed users" "table_row"
|