Commit | Line | Data |
---|---|---|
1dc764a6 SL |
1 | @block @block_myoverview @javascript |
2 | Feature: My overview block show users their progress on courses | |
3 | In order to enable the my overview block in a course | |
4 | As a student | |
5 | I can see the progress percentage of the courses I am enrolled in | |
6 | ||
7 | Background: | |
8 | Given the following "users" exist: | |
9 | | username | firstname | lastname | email | idnumber | | |
10 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | | |
11 | | student1 | Student | 1 | student1@example.com | S1 | | |
12 | And the following "courses" exist: | |
13 | | fullname | shortname | category | enablecompletion | startdate | enddate | | |
14 | | Course 1 | C1 | 0 | 1 | ##yesterday## | ##tomorrow## | | |
15 | And the following "activities" exist: | |
16 | | activity | course | idnumber | name | intro | timeopen | timeclose | | |
17 | | choice | C1 | choice1 | Test choice 1 | Test choice description | ##yesterday## | ##tomorrow## | | |
18 | And the following "course enrolments" exist: | |
19 | | user | course | role | | |
20 | | teacher1 | C1 | editingteacher | | |
21 | | student1 | C1 | student | | |
22 | ||
23 | Scenario: Course progress percentage should not be displayed if completion is not enabled | |
24 | Given I log in as "student1" | |
25 | And I click on "Timeline" "link" in the "My overview" "block" | |
26 | When I click on "Sort by courses" "link" in the "My overview" "block" | |
27 | Then I should see "Choice Test choice 1 closes" in the "My overview" "block" | |
28 | And I should not see "0%" in the "My overview" "block" | |
29 | And I click on "Courses" "link" in the "My overview" "block" | |
30 | And I click on "In progress" "link" in the "My overview" "block" | |
31 | And I should see "Course 1" in the "My overview" "block" | |
32 | And I should not see "0%" in the "My overview" "block" | |
33 | And I log out | |
34 | ||
35 | Scenario: User complete activity and verify his progress | |
36 | Given I log in as "teacher1" | |
37 | And I am on "Course 1" course homepage with editing mode on | |
38 | And I follow "Test choice 1" | |
39 | And I navigate to "Edit settings" in current page administration | |
40 | And I set the following fields to these values: | |
41 | | Completion tracking | Show activity as complete when conditions are met | | |
42 | | id_completionview | 1 | | |
43 | And I press "Save and return to course" | |
44 | And I log out | |
45 | And I log in as "student1" | |
46 | And I click on "Sort by courses" "link" in the "My overview" "block" | |
47 | And I should see "Choice Test choice 1 closes" in the "My overview" "block" | |
48 | And I should see "0%" in the "My overview" "block" | |
49 | And I click on "Courses" "link" in the "My overview" "block" | |
50 | When I click on "In progress" "link" in the "My overview" "block" | |
51 | Then I should see "Course 1" in the "My overview" "block" | |
52 | And I should see "0%" in the "My overview" "block" | |
53 | And I am on "Course 1" course homepage | |
54 | And I follow "Test choice 1" | |
55 | And I follow "Dashboard" in the user menu | |
56 | And I click on "Sort by courses" "link" in the "My overview" "block" | |
57 | And I should see "100%" in the "My overview" "block" | |
58 | And I click on "Courses" "link" in the "My overview" "block" | |
59 | And I click on "In progress" "link" in the "My overview" "block" | |
60 | And I should see "Course 1" in the "My overview" "block" | |
61 | And I should see "100%" in the "My overview" "block" | |
62 | And I log out |