Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@tool @tool_analytics
2
Feature: Restoring default models
3
  In order to get prediction models into their initial state
4
  As a manager
5
  I need to be able to restore deleted default models
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username 	| firstname	| lastname | email          	|
10
      | manager  	| Max      	| Manager  | man@example.com	|
11
    And the following "role assigns" exist:
12
      | user    	| role    	| contextlevel	| reference		|
13
      | manager 	| manager		| System      	|							|
14
 
15
  Scenario: Restore a single deleted default model
16
    Given I log in as "manager"
17
    And I navigate to "Analytics > Analytics models" in site administration
18
    # Delete 'Courses at risk of not starting' model.
19
    And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
20
    And I should see "Analytics models"
21
    And I should not see "Courses at risk of not starting"
22
    # Delete 'Students at risk of dropping out' model.
23
    And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
24
    And I should see "Analytics models"
25
    And I should not see "Students at risk of dropping out"
26
    # Go to the page for restoring deleted models.
27
    When I click on "Restore default models" "link"
28
    And I should see "Courses at risk of not starting"
29
    And I should see "Students at risk of dropping out"
30
    # Select and restore the 'Courses at risk of not starting' model.
31
    And I set the field with xpath "//tr[contains(normalize-space(.), 'Courses at risk of not starting')]//input[@type='checkbox']" to "1"
32
    And I click on "Restore selected" "button"
33
    Then I should see "Succesfully re-created 1 new model(s)."
34
    And I should see "Analytics models"
35
    And I should see "Courses at risk of not starting"
36
    And I should not see "Students at risk of dropping out"
37
 
38
  Scenario: Restore multiple deleted default models at once
39
    Given I log in as "manager"
40
    And I navigate to "Analytics > Analytics models" in site administration
41
    # Delete 'Courses at risk of not starting' model.
42
    And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
43
    And I should see "Analytics models"
44
    And I should not see "Courses at risk of not starting"
45
    # Delete 'Students at risk of dropping out' model.
46
    And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
47
    And I should see "Analytics models"
48
    And I should not see "Students at risk of dropping out"
49
    # Go to the page for restoring deleted models.
50
    When I click on "Restore default models" "link"
51
    And I should see "Courses at risk of not starting"
52
    And I should see "Students at risk of dropping out"
53
    # Select and restore both models.
54
    And I set the field with xpath "//tr[contains(normalize-space(.), 'Courses at risk of not starting')]//input[@type='checkbox']" to "1"
55
    And I set the field with xpath "//tr[contains(normalize-space(.), 'Students at risk of dropping out')]//input[@type='checkbox']" to "1"
56
    And I click on "Restore selected" "button"
57
    Then I should see "Succesfully re-created 2 new model(s)."
58
    And I should see "Analytics models"
59
    And I should see "Courses at risk of not starting"
60
    And I should see "Students at risk of dropping out"
61
 
62
  Scenario: Going to the restore page while no models can be restored
63
    Given I log in as "manager"
64
    And I navigate to "Analytics > Analytics models" in site administration
65
    And I should see "Analytics models"
66
    And I should see "Courses at risk of not starting"
67
    When I click on "Restore default models" "link"
68
    Then I should see "All default models provided by core and installed plugins have been created. No new models were found; there is nothing to restore."
69
    And I click on "Back" "link"
70
    And I should see "Analytics models"
71
 
72
  @javascript
73
  Scenario: User can select and restore all missing models
74
    Given I log in as "manager"
75
    And I navigate to "Analytics > Analytics models" in site administration
76
    # Delete 'Courses at risk of not starting' model.
77
    And I click on "Actions" "link" in the "Courses at risk of not starting" "table_row"
78
    And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
79
    And I click on "Delete" "button" in the "Delete" "dialogue"
80
    And I should see "Analytics models"
81
    And I should not see "Courses at risk of not starting"
82
    # Delete 'Students at risk of dropping out' model.
83
    And I click on "Actions" "link" in the "Students at risk of dropping out" "table_row"
84
    And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
85
    And I click on "Delete" "button" in the "Delete" "dialogue"
86
    And I should see "Analytics models"
87
    And I should not see "Courses at risk of not starting"
88
    And I should not see "Students at risk of dropping out"
89
    # Go to the page for restoring deleted models.
90
    And I click on "New model" "link"
91
    And I click on "Restore default models" "link"
92
    And I should see "Courses at risk of not starting"
93
    And I should see "Students at risk of dropping out"
94
    # Attempt to submit the form without selecting any model.
95
    And I click on "Restore selected" "button"
96
    And I should see "Please select models to be restored."
97
    # Select all models.
98
    When I click on "Select all" "link"
99
    And I click on "Restore selected" "button"
100
    Then I should see "Succesfully re-created 2 new model(s)."
101
    And I should see "Analytics models"
102
    And I should see "Courses at risk of not starting"
103
    And I should see "Students at risk of dropping out"