|
| 1 | +@core @core_course @app @javascript |
| 2 | +Feature: Test course list shown on app start tab |
| 3 | + In order to select a course |
| 4 | + As a student |
| 5 | + I need to see the correct list of courses |
| 6 | + |
| 7 | + Background: |
| 8 | + Given the following "courses" exist: |
| 9 | + | fullname | shortname | |
| 10 | + | Course 1 | C1 | |
| 11 | + | Course 2 | C2 | |
| 12 | + And the following "users" exist: |
| 13 | + | username | |
| 14 | + | student1 | |
| 15 | + | student2 | |
| 16 | + And the following "course enrolments" exist: |
| 17 | + | user | course | role | |
| 18 | + | student1 | C1 | student | |
| 19 | + | student2 | C1 | student | |
| 20 | + | student2 | C2 | student | |
| 21 | + |
| 22 | + Scenario: Student is registered on one course |
| 23 | + When I enter the app |
| 24 | + And I log in as "student1" |
| 25 | + Then I should see "Course 1" |
| 26 | + And I should not see "Course 2" |
| 27 | + |
| 28 | + Scenario: Student is registered on two courses (shortnames not displayed) |
| 29 | + When I enter the app |
| 30 | + And I log in as "student2" |
| 31 | + Then I should see "Course 1" |
| 32 | + And I should see "Course 2" |
| 33 | + And I should not see "C1" |
| 34 | + And I should not see "C2" |
| 35 | + |
| 36 | + Scenario: Student is registered on two courses (shortnames displayed) |
| 37 | + Given the following config values are set as admin: |
| 38 | + | courselistshortnames | 1 | |
| 39 | + When I enter the app |
| 40 | + And I log in as "student2" |
| 41 | + Then I should see "Course 1" |
| 42 | + And I should see "Course 2" |
| 43 | + And I should see "C1" |
| 44 | + And I should see "C2" |
| 45 | + |
| 46 | + Scenario: Student uses course list to enter course, then leaves it again |
| 47 | + When I enter the app |
| 48 | + And I log in as "student2" |
| 49 | + And I press "Course 2" near "Course overview" in the app |
| 50 | + Then the header should be "Course 2" in the app |
| 51 | + And I press the back button in the app |
| 52 | + Then the header should be "Acceptance test site" in the app |
| 53 | + |
| 54 | + Scenario: Student uses filter feature to reduce course list |
| 55 | + Given the following config values are set as admin: |
| 56 | + | courselistshortnames | 1 | |
| 57 | + And the following "courses" exist: |
| 58 | + | fullname | shortname | |
| 59 | + | Frog 3 | C3 | |
| 60 | + | Frog 4 | C4 | |
| 61 | + | Course 5 | C5 | |
| 62 | + | Toad 6 | C6 | |
| 63 | + And the following "course enrolments" exist: |
| 64 | + | user | course | role | |
| 65 | + | student2 | C3 | student | |
| 66 | + | student2 | C4 | student | |
| 67 | + | student2 | C5 | student | |
| 68 | + | student2 | C6 | student | |
| 69 | + # Create bogus courses so that the main ones aren't shown in the 'recently accessed' part. |
| 70 | + # Because these come later in alphabetical order, they may not be displayed in the lower part |
| 71 | + # which is OK. |
| 72 | + And the following "courses" exist: |
| 73 | + | fullname | shortname | |
| 74 | + | Zogus 1 | Z1 | |
| 75 | + | Zogus 2 | Z2 | |
| 76 | + | Zogus 3 | Z3 | |
| 77 | + | Zogus 4 | Z4 | |
| 78 | + | Zogus 5 | Z5 | |
| 79 | + | Zogus 6 | Z6 | |
| 80 | + | Zogus 7 | Z7 | |
| 81 | + | Zogus 8 | Z8 | |
| 82 | + | Zogus 9 | Z9 | |
| 83 | + | Zogus 10 | Z10 | |
| 84 | + And the following "course enrolments" exist: |
| 85 | + | user | course | role | |
| 86 | + | student2 | Z1 | student | |
| 87 | + | student2 | Z2 | student | |
| 88 | + | student2 | Z3 | student | |
| 89 | + | student2 | Z4 | student | |
| 90 | + | student2 | Z5 | student | |
| 91 | + | student2 | Z6 | student | |
| 92 | + | student2 | Z7 | student | |
| 93 | + | student2 | Z8 | student | |
| 94 | + | student2 | Z9 | student | |
| 95 | + | student2 | Z10 | student | |
| 96 | + When I enter the app |
| 97 | + And I log in as "student2" |
| 98 | + Then I should see "C1" |
| 99 | + And I should see "C2" |
| 100 | + And I should see "C3" |
| 101 | + And I should see "C4" |
| 102 | + And I should see "C5" |
| 103 | + And I should see "C6" |
| 104 | + And I press "Information" near "Course overview" in the app |
| 105 | + And I press "Filter my courses" in the app |
| 106 | + And I set the field "Filter my courses" to "fr" in the app |
| 107 | + Then I should not see "C1" |
| 108 | + And I should not see "C2" |
| 109 | + And I should see "C3" |
| 110 | + And I should see "C4" |
| 111 | + And I should not see "C5" |
| 112 | + And I should not see "C6" |
| 113 | + And I press "Information" near "Course overview" in the app |
| 114 | + And I press "Filter my courses" in the app |
| 115 | + Then I should see "C1" |
| 116 | + And I should see "C2" |
| 117 | + And I should see "C3" |
| 118 | + And I should see "C4" |
| 119 | + And I should see "C5" |
| 120 | + And I should see "C6" |
0 commit comments