Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | 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      	|							|
1441 ariadna 14
    And the following config values are set as admin:
15
      | enableanalytics | 1 |
16
    And a Python Machine Learning backend server is configured
17
    And I change the Python Machine Learning backend to use external server
1 efrain 18
 
19
  Scenario: Restore a single deleted default model
20
    Given I log in as "manager"
21
    And I navigate to "Analytics > Analytics models" in site administration
22
    # Delete 'Courses at risk of not starting' model.
23
    And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
24
    And I should see "Analytics models"
25
    And I should not see "Courses at risk of not starting"
26
    # Delete 'Students at risk of dropping out' model.
27
    And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
28
    And I should see "Analytics models"
29
    And I should not see "Students at risk of dropping out"
30
    # Go to the page for restoring deleted models.
31
    When I click on "Restore default models" "link"
32
    And I should see "Courses at risk of not starting"
33
    And I should see "Students at risk of dropping out"
34
    # Select and restore the 'Courses at risk of not starting' model.
35
    And I set the field with xpath "//tr[contains(normalize-space(.), 'Courses at risk of not starting')]//input[@type='checkbox']" to "1"
36
    And I click on "Restore selected" "button"
37
    Then I should see "Succesfully re-created 1 new model(s)."
38
    And I should see "Analytics models"
39
    And I should see "Courses at risk of not starting"
40
    And I should not see "Students at risk of dropping out"
41
 
42
  Scenario: Restore multiple deleted default models at once
43
    Given I log in as "manager"
44
    And I navigate to "Analytics > Analytics models" in site administration
45
    # Delete 'Courses at risk of not starting' model.
46
    And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
47
    And I should see "Analytics models"
48
    And I should not see "Courses at risk of not starting"
49
    # Delete 'Students at risk of dropping out' model.
50
    And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
51
    And I should see "Analytics models"
52
    And I should not see "Students at risk of dropping out"
53
    # Go to the page for restoring deleted models.
54
    When I click on "Restore default models" "link"
55
    And I should see "Courses at risk of not starting"
56
    And I should see "Students at risk of dropping out"
57
    # Select and restore both models.
58
    And I set the field with xpath "//tr[contains(normalize-space(.), 'Courses at risk of not starting')]//input[@type='checkbox']" to "1"
59
    And I set the field with xpath "//tr[contains(normalize-space(.), 'Students at risk of dropping out')]//input[@type='checkbox']" to "1"
60
    And I click on "Restore selected" "button"
61
    Then I should see "Succesfully re-created 2 new model(s)."
62
    And I should see "Analytics models"
63
    And I should see "Courses at risk of not starting"
64
    And I should see "Students at risk of dropping out"
65
 
66
  Scenario: Going to the restore page while no models can be restored
67
    Given I log in as "manager"
68
    And I navigate to "Analytics > Analytics models" in site administration
69
    And I should see "Analytics models"
70
    And I should see "Courses at risk of not starting"
71
    When I click on "Restore default models" "link"
72
    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."
73
    And I click on "Back" "link"
74
    And I should see "Analytics models"
75
 
76
  @javascript
77
  Scenario: User can select and restore all missing models
78
    Given I log in as "manager"
79
    And I navigate to "Analytics > Analytics models" in site administration
80
    # Delete 'Courses at risk of not starting' model.
81
    And I click on "Actions" "link" in the "Courses at risk of not starting" "table_row"
82
    And I click on "Delete" "link" in the "Courses at risk of not starting" "table_row"
83
    And I click on "Delete" "button" in the "Delete" "dialogue"
84
    And I should see "Analytics models"
85
    And I should not see "Courses at risk of not starting"
86
    # Delete 'Students at risk of dropping out' model.
87
    And I click on "Actions" "link" in the "Students at risk of dropping out" "table_row"
88
    And I click on "Delete" "link" in the "Students at risk of dropping out" "table_row"
89
    And I click on "Delete" "button" in the "Delete" "dialogue"
90
    And I should see "Analytics models"
91
    And I should not see "Courses at risk of not starting"
92
    And I should not see "Students at risk of dropping out"
93
    # Go to the page for restoring deleted models.
94
    And I click on "New model" "link"
95
    And I click on "Restore default models" "link"
96
    And I should see "Courses at risk of not starting"
97
    And I should see "Students at risk of dropping out"
98
    # Attempt to submit the form without selecting any model.
99
    And I click on "Restore selected" "button"
100
    And I should see "Please select models to be restored."
101
    # Select all models.
102
    When I click on "Select all" "link"
103
    And I click on "Restore selected" "button"
104
    Then I should see "Succesfully re-created 2 new model(s)."
105
    And I should see "Analytics models"
106
    And I should see "Courses at risk of not starting"
107
    And I should see "Students at risk of dropping out"