1 |
efrain |
1 |
@block @block_myoverview @javascript
|
|
|
2 |
Feature: My overview block searching
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "users" exist:
|
|
|
6 |
| username | firstname | lastname | email | idnumber |
|
|
|
7 |
| student1 | Student | X | student1@example.com | S1 |
|
|
|
8 |
| student2 | Student | Y | student2@example.com | S2 |
|
|
|
9 |
And the following "courses" exist:
|
|
|
10 |
| fullname | shortname | category |
|
|
|
11 |
| Course 01 | C1 | 0 |
|
|
|
12 |
| Course 02 | C2 | 0 |
|
|
|
13 |
| Course 03 | C3 | 0 |
|
|
|
14 |
| Course 04 | C4 | 0 |
|
|
|
15 |
| Course 05 | C5 | 0 |
|
|
|
16 |
| Course 06 | C6 | 0 |
|
|
|
17 |
| Course 07 | C7 | 0 |
|
|
|
18 |
| Course 08 | C8 | 0 |
|
|
|
19 |
| Course 09 | C9 | 0 |
|
|
|
20 |
| Course 10 | C10 | 0 |
|
|
|
21 |
| Course 11 | C11 | 0 |
|
|
|
22 |
| Course 12 | C12 | 0 |
|
|
|
23 |
| Course 13 | C13 | 0 |
|
|
|
24 |
| Fake example | Fake | 0 |
|
|
|
25 |
And the following "course enrolments" exist:
|
|
|
26 |
| user | course | role |
|
|
|
27 |
| student1 | C1 | student |
|
|
|
28 |
| student1 | C2 | student |
|
|
|
29 |
| student1 | C3 | student |
|
|
|
30 |
| student1 | C4 | student |
|
|
|
31 |
| student1 | C5 | student |
|
|
|
32 |
| student1 | C6 | student |
|
|
|
33 |
| student1 | C7 | student |
|
|
|
34 |
| student1 | C8 | student |
|
|
|
35 |
| student1 | C9 | student |
|
|
|
36 |
| student1 | C10 | student |
|
|
|
37 |
| student1 | C11 | student |
|
|
|
38 |
| student1 | C12 | student |
|
|
|
39 |
| student1 | C13 | student |
|
|
|
40 |
|
|
|
41 |
Scenario: There is no search if I am not enrolled in any course
|
|
|
42 |
When I am on the "My courses" page logged in as "student2"
|
|
|
43 |
Then I should see "You're not enrolled in any course" in the "Course overview" "block"
|
|
|
44 |
And "Search courses" "field" should not exist in the "Course overview" "block"
|
|
|
45 |
And I log out
|
|
|
46 |
|
|
|
47 |
Scenario: Single page search
|
|
|
48 |
Given I am on the "My courses" page logged in as "student1"
|
|
|
49 |
And I set the field "Search courses" in the "Course overview" "block" to "Course 0"
|
|
|
50 |
Then I should see "Course 01" in the "Course overview" "block"
|
|
|
51 |
And I should not see "Course 13" in the "Course overview" "block"
|
|
|
52 |
And I log out
|
|
|
53 |
|
|
|
54 |
Scenario: Paginated search
|
|
|
55 |
Given I am on the "My courses" page logged in as "student1"
|
|
|
56 |
And I set the field "Search courses" in the "Course overview" "block" to "Course"
|
|
|
57 |
And I should see "Course 01" in the "Course overview" "block"
|
|
|
58 |
And I should not see "Course 13" in the "Course overview" "block"
|
|
|
59 |
And I click on "[data-control='next']" "css_element" in the "Course overview" "block"
|
|
|
60 |
And I wait until ".block_myoverview [data-control='next']" "css_element" exists
|
|
|
61 |
Then I should see "Course 13" in the "Course overview" "block"
|
|
|
62 |
And I should not see "Course 01" in the "Course overview" "block"
|