1 |
efrain |
1 |
@mod @mod_glossary
|
|
|
2 |
Feature: Glossary entries can be searched or browsed by alphabet, category, date or author
|
|
|
3 |
In order to find entries in a glossary
|
|
|
4 |
As a user
|
|
|
5 |
I need to search the entries list by keyword, alphabet, category, date and author
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | intro | displayformat | course | idnumber |
|
|
|
21 |
| glossary | Test glossary name | Test glossary description | fullwithauthor | C1 | g1 |
|
|
|
22 |
And the following "mod_glossary > categories" exist:
|
|
|
23 |
| glossary | name |
|
|
|
24 |
| g1 | The ones I like |
|
|
|
25 |
| g1 | All for you |
|
|
|
26 |
And the following "mod_glossary > entries" exist:
|
|
|
27 |
| glossary | concept | definition | user | categories |
|
|
|
28 |
| g1 | Eggplant | Sour eggplants | teacher1 | All for you |
|
|
|
29 |
| g1 | Cucumber | Sweet cucumber | student1 | The ones I like |
|
|
|
30 |
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
|
|
|
31 |
|
|
|
32 |
@javascript
|
|
|
33 |
Scenario: Search by keyword and browse by alphabet
|
|
|
34 |
When I set the field "hook" to "cucumber"
|
|
|
35 |
And I press "Search"
|
|
|
36 |
Then I should see "Sweet cucumber"
|
|
|
37 |
And I should see "Search: cucumber"
|
|
|
38 |
And I click on "E" "link" in the ".entrybox" "css_element"
|
|
|
39 |
And I should see "Sour eggplants"
|
|
|
40 |
And I should not see "Sweet cucumber"
|
|
|
41 |
And I click on "X" "link" in the ".entrybox" "css_element"
|
|
|
42 |
And I should not see "Sweet cucumber"
|
|
|
43 |
And I should see "No entries found in this section"
|
|
|
44 |
|
|
|
45 |
@javascript
|
|
|
46 |
Scenario: Browse by category
|
|
|
47 |
When I select "Browse by category" from the "Browse the glossary using this index" singleselect
|
|
|
48 |
And I set the field "Categories" to "The ones I like"
|
|
|
49 |
Then I should see "Sweet cucumber"
|
|
|
50 |
And I should not see "Sour eggplants"
|
|
|
51 |
And I set the field "Categories" to "All for you"
|
|
|
52 |
And I should see "Sour eggplants"
|
|
|
53 |
And I should not see "Sweet cucumber"
|
|
|
54 |
|
|
|
55 |
@javascript
|
|
|
56 |
Scenario: Browse by date
|
|
|
57 |
When I select "Browse by date" from the "Browse the glossary using this index" singleselect
|
|
|
58 |
And I follow "By creation date"
|
|
|
59 |
Then "Delete entry: Eggplant" "link" should appear before "Delete entry: Cucumber" "link"
|
|
|
60 |
And I follow "By last update"
|
|
|
61 |
And I follow "By last update change to descending"
|
|
|
62 |
And "Delete entry: Cucumber" "link" should appear before "Delete entry: Eggplant" "link"
|
|
|
63 |
|
|
|
64 |
@javascript
|
|
|
65 |
Scenario: Browse by author
|
|
|
66 |
When I select "Browse by Author" from the "Browse the glossary using this index" singleselect
|
|
|
67 |
And I click on "T" "link" in the ".entrybox" "css_element"
|
|
|
68 |
Then I should see "Teacher 1"
|
|
|
69 |
And I should see "Sour eggplants"
|
|
|
70 |
And I should not see "Sweet cucumber"
|
|
|
71 |
And I click on "S" "link" in the ".entrybox" "css_element"
|
|
|
72 |
And I should see "Student 1"
|
|
|
73 |
And I should see "Sweet cucumber"
|
|
|
74 |
And I should not see "Sour eggplants"
|