1 |
efrain |
1 |
@core @core_search
|
|
|
2 |
Feature: Select users when searching for user-created content
|
|
|
3 |
In order to search for content by specific users
|
|
|
4 |
As a user
|
|
|
5 |
I need to be able to add users to the select list in the search form
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given solr is installed
|
|
|
9 |
And the following config values are set as admin:
|
|
|
10 |
| enableglobalsearch | 1 |
|
|
|
11 |
| searchengine | solr |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| shortname | fullname |
|
|
|
14 |
| C1 | Frogs |
|
|
|
15 |
| C2 | Zombies |
|
|
|
16 |
And the following "activities" exist:
|
|
|
17 |
| activity | name | intro | course | idnumber |
|
|
|
18 |
| page | PageName1 | PageDesc1 | C1 | PAGE1 |
|
|
|
19 |
And the following "users" exist:
|
|
|
20 |
| username | firstname | lastname |
|
|
|
21 |
| s1 | Anne | Other |
|
|
|
22 |
| s2 | Anne | Additional |
|
|
|
23 |
| t | Anne | Ditin |
|
|
|
24 |
And the following "course enrolments" exist:
|
|
|
25 |
| user | course | role |
|
|
|
26 |
| s1 | C1 | student |
|
|
|
27 |
| s2 | C2 | student |
|
|
|
28 |
| t | C1 | teacher |
|
|
|
29 |
|
|
|
30 |
@javascript
|
|
|
31 |
Scenario: As administrator, search for users from home page
|
|
|
32 |
Given I log in as "admin"
|
|
|
33 |
And global search expects the query "frogs" and will return:
|
|
|
34 |
| type | idnumber |
|
|
|
35 |
| activity | PAGE1 |
|
|
|
36 |
And I search for "frogs" using the header global search box
|
|
|
37 |
And I expand all fieldsets
|
|
|
38 |
When I expand the "Users" autocomplete
|
|
|
39 |
# Alphabetical last name order.
|
|
|
40 |
Then "Anne Additional" "text" should appear before "Anne Ditin" "text" in the "Users" "autocomplete"
|
|
|
41 |
And "Anne Ditin" "text" should appear before "Anne Other" "text" in the "Users" "autocomplete"
|
|
|
42 |
|
|
|
43 |
@javascript
|
|
|
44 |
Scenario: As administrator, search for users within course
|
|
|
45 |
Given I log in as "admin"
|
|
|
46 |
And I am on "Frogs" course homepage
|
|
|
47 |
And global search expects the query "frogs" and will return:
|
|
|
48 |
| type | idnumber |
|
|
|
49 |
| activity | PAGE1 |
|
|
|
50 |
And I search for "frogs" using the header global search box
|
|
|
51 |
And I expand all fieldsets
|
|
|
52 |
And I select "Course: Frogs" from the "Search within" singleselect
|
|
|
53 |
When I expand the "Users" autocomplete
|
|
|
54 |
# Users in selected course appear first.
|
|
|
55 |
Then "Anne Additional" "text" should appear after "Anne Other" "text" in the "Users" "autocomplete"
|
|
|
56 |
|
|
|
57 |
@javascript
|
|
|
58 |
Scenario: As student, cannot see users on other courses
|
|
|
59 |
Given I log in as "s1"
|
|
|
60 |
And I am on "Frogs" course homepage
|
|
|
61 |
And global search expects the query "frogs" and will return:
|
|
|
62 |
| type | idnumber |
|
|
|
63 |
| activity | PAGE1 |
|
|
|
64 |
And I search for "frogs" using the header global search box
|
|
|
65 |
And I expand all fieldsets
|
|
|
66 |
When I expand the "Users" autocomplete
|
|
|
67 |
Then "Anne Ditin" "text" should appear before "Anne Other" "text" in the "Users" "autocomplete"
|
|
|
68 |
And "Anne Additional" "text" should not exist
|