1441 |
ariadna |
1 |
@tool @tool_analytics
|
|
|
2 |
Feature: Manager can obtain prediction models insights
|
|
|
3 |
In order to view prediction models insights
|
|
|
4 |
As a manager
|
|
|
5 |
I should be able to obtain the prediction models insights
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| s1 | Student | One | s1@example.com |
|
|
|
11 |
| m1 | Manager | One | m1@example.com |
|
|
|
12 |
| m2 | Manager | Two | m2@example.com |
|
|
|
13 |
| t1 | Teacher | One | t1@example.com |
|
|
|
14 |
And the following "role assigns" exist:
|
|
|
15 |
| user | role | contextlevel | reference |
|
|
|
16 |
| m1 | manager | System | |
|
|
|
17 |
| m2 | manager | System | |
|
|
|
18 |
# To ensure that course start date is in the future, set course start date to "tomorrow".
|
|
|
19 |
And the following "courses" exist:
|
|
|
20 |
| fullname | shortname | startdate |
|
|
|
21 |
| Course 1 | C1 | ##tomorrow## |
|
|
|
22 |
| Course 2 | C2 | ##tomorrow## |
|
|
|
23 |
| Course 3 | C3 | ##tomorrow## |
|
|
|
24 |
And the following "course enrolments" exist:
|
|
|
25 |
| user | course | role |
|
|
|
26 |
| s1 | C1 | student |
|
|
|
27 |
| s1 | C2 | student |
|
|
|
28 |
| s1 | C3 | student |
|
|
|
29 |
| t1 | C3 | editingteacher |
|
|
|
30 |
# Disable "Analytics processes execution via command line only".
|
|
|
31 |
And the following config values are set as admin:
|
|
|
32 |
| onlycli | 0 | analytics |
|
|
|
33 |
| enableanalytics | 1 | |
|
|
|
34 |
And a Python Machine Learning backend server is configured
|
|
|
35 |
And I change the Python Machine Learning backend to use external server
|
|
|
36 |
|
|
|
37 |
@javascript
|
|
|
38 |
Scenario: Manager can obtain prediction models insights
|
|
|
39 |
Given I log in as "m1"
|
|
|
40 |
And I navigate to "Analytics > Analytics models" in site administration
|
|
|
41 |
And I click on "Actions" "link" in the "Courses at risk of not starting" "table_row"
|
|
|
42 |
And I click on "Execute scheduled analysis" "link" in the "Courses at risk of not starting" "table_row"
|
|
|
43 |
And I press "Continue"
|
|
|
44 |
When I select "All predictions" from the "contextid" singleselect
|
|
|
45 |
# Confirm that only courses without teachers, Course 1 and Course 2, are listed.
|
|
|
46 |
Then "Course 1" "text" should exist
|
|
|
47 |
And "Course 2" "text" should exist
|
|
|
48 |
And "Course 3" "text" should not exist
|
|
|
49 |
And I click on "Select Course 1 for bulk action" "checkbox"
|
|
|
50 |
And I press "Not applicable"
|
|
|
51 |
And I press "Confirm"
|
|
|
52 |
# After m1 marks Course 1 as Not applicable, only Course 2 should be listed in the predictions for manager 1.
|
|
|
53 |
And "Course 1" "text" should not exist
|
|
|
54 |
And "Course 2" "text" should exist
|
|
|
55 |
And I log in as "m2"
|
|
|
56 |
And I click on ".popover-region-notifications" "css_element"
|
|
|
57 |
# Notification of new insight exists.
|
|
|
58 |
And "Upcoming courses have no teachers or students" "text" should exist
|
|
|
59 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
|
|
60 |
And I click on "View insight" "link"
|
|
|
61 |
# Course 1, previously marked as Not applicable by manager 1, is still listed for manager 2.
|
|
|
62 |
And "Course 1" "text" should exist
|
|
|
63 |
And I click on "View details" "link" in the "Course 1" "table_row"
|
|
|
64 |
# Prediction details and indicators are displayed for the selected course.
|
|
|
65 |
And the following should exist in the "insights-list" table:
|
|
|
66 |
| Description |
|
|
|
67 |
| Course 1 |
|
|
|
68 |
And the following should exist in the "prediction-calculations" table:
|
|
|
69 |
| -1- | -2- |
|
|
|
70 |
| Teacher availability | No |
|
|
|
71 |
| Student enrolments | Yes |
|
|
|
72 |
# Date of prediction analysis execution.
|
|
|
73 |
And "##today##%A, %d %B %Y##" "text" should exist in the "Time predicted" "table_row"
|
|
|
74 |
And I click on "Select Course 1 for bulk action" "checkbox"
|
|
|
75 |
And I press "Accept"
|
|
|
76 |
And I press "Confirm"
|
|
|
77 |
# Verify that you end up on the page listing predictions for 'No teaching'.
|
|
|
78 |
And "Courses at risk of not starting" "text" should exist
|
|
|
79 |
And "The following courses due to start in the upcoming days are at risk of not starting because they don't have teachers or students enrolled." "text" should exist
|
|
|
80 |
And the following should not exist in the "insights-list" table:
|
|
|
81 |
| Description |
|
|
|
82 |
| Course 1 |
|