MDL-58428 behat: Fix regression of MDL-49399.
[moodle.git] / admin / tool / task / tests / behat / manage_tasks.feature
CommitLineData
d1bb9ea9
RK
1@tool @tool_task @javascript
2Feature: Manage scheduled tasks
3 In order to configure scheduled tasks
4 As an admin
5 I need to be able to disable, enable, edit and reset to default scheduled tasks
6
7 Background:
8 Given I log in as "admin"
14bcc65e 9 And I navigate to "Server > Tasks > Scheduled tasks" in site administration
d1bb9ea9
RK
10
11 Scenario: Disable scheduled task
12 When I click on "Edit task schedule: Log table cleanup" "link" in the "Log table cleanup" "table_row"
13 Then I should see "Edit task schedule: Log table cleanup"
14 And I set the following fields to these values:
15 | disabled | 1 |
16 And I press "Save changes"
17 Then I should see "Changes saved"
18 And I should see "Task disabled" in the "Log table cleanup" "table_row"
19
20 Scenario: Enable scheduled task
21 When I click on "Edit task schedule: Log table cleanup" "link" in the "Log table cleanup" "table_row"
22 Then I should see "Edit task schedule: Log table cleanup"
23 And I set the following fields to these values:
24 | disabled | 0 |
25 And I press "Save changes"
26 Then I should see "Changes saved"
27 And I should not see "Task disabled" in the "Log table cleanup" "table_row"
28
29 Scenario: Edit scheduled task
30 When I click on "Edit task schedule: Log table cleanup" "link" in the "Log table cleanup" "table_row"
31 Then I should see "Edit task schedule: Log table cleanup"
32 And I set the following fields to these values:
33 | minute | */5 |
34 | hour | 1 |
35 | day | 2 |
36 | month | 3 |
37 | dayofweek | 4 |
38 And I press "Save changes"
39 Then I should see "Changes saved"
40 And the following should exist in the "admintable" table:
41 | Component | Minute | Hour | Day | Day of week | Month |
42 | Standard log | */5 | 1 | 2 | 4 | 3 |
43
44 Scenario: Reset scheduled task to default
45 When I click on "Edit task schedule: Log table cleanup" "link" in the "Log table cleanup" "table_row"
46 Then I should see "Edit task schedule: Log table cleanup"
47 And I set the following fields to these values:
48 | resettodefaults | 1 |
49 And I press "Save changes"
50 Then I should see "Changes saved"
51 And the following should not exist in the "admintable" table:
96e4202c
RT
52 | Name | Component | Minute | Hour | Day | Day of week | Month |
53 | Log table cleanup | Standard log | */5 | 1 | 2 | 4 | 3 |