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:
|
1441 |
ariadna |
23 |
| glossary | name |
|
|
|
24 |
| g1 | <span lang=\"en\" class=\"multilang\">The ones I like</span><span lang=\"fr\" class=\"multilang\">Ceux qui me plaisent</span> |
|
|
|
25 |
| g1 | <span lang=\"en\" class=\"multilang\">All for you</span><span lang=\"fr\" class=\"multilang\">Tout pour toi</span> |
|
|
|
26 |
|
1 |
efrain |
27 |
And the following "mod_glossary > entries" exist:
|
1441 |
ariadna |
28 |
| glossary | concept | definition | user | categories |
|
|
|
29 |
| g1 | <span lang="en" class="multilang">Eggplant</span><span lang="fr" class="multilang">Aubergine</span> | <span lang="en" class="multilang">Sour eggplants</span><span lang="fr" class="multilang">Aubergines aigres</span> | teacher1 | <span lang=\"en\" class=\"multilang\">All for you</span><span lang=\"fr\" class=\"multilang\">Tout pour toi</span> |
|
|
|
30 |
| g1 | 7up | <span lang="en" class="multilang">7up is a softdrink</span><span lang="fr" class="multilang">7up est une boisson</span> | teacher1 | <span lang=\"en\" class=\"multilang\">The ones I like</span><span lang=\"fr\" class=\"multilang\">Ceux qui me plaisent</span> |
|
|
|
31 |
| g1 | <span lang="en" class="multilang">Cucumber</span><span lang="fr" class="multilang">Concombre</span> | <span lang="en" class="multilang">Sweet cucumber</span><span lang="fr" class="multilang">Doux concombre</span> | student1 | <span lang=\"en\" class=\"multilang\">The ones I like</span><span lang=\"fr\" class=\"multilang\">Ceux qui me plaisent</span> |
|
|
|
32 |
And the "multilang" filter is "on"
|
|
|
33 |
And the "multilang" filter applies to "content and headings"
|
|
|
34 |
And I log out
|
1 |
efrain |
35 |
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
|
|
|
36 |
|
|
|
37 |
@javascript
|
|
|
38 |
Scenario: Search by keyword and browse by alphabet
|
|
|
39 |
When I set the field "hook" to "cucumber"
|
|
|
40 |
And I press "Search"
|
|
|
41 |
Then I should see "Sweet cucumber"
|
|
|
42 |
And I should see "Search: cucumber"
|
1441 |
ariadna |
43 |
And I set the field "hook" to "aubergine"
|
|
|
44 |
And I press "Search"
|
|
|
45 |
And I should see "Sour eggplants"
|
|
|
46 |
And I should see "Search: aubergine"
|
|
|
47 |
And I should see "E" in the ".glossarycategoryheader" "css_element"
|
1 |
efrain |
48 |
And I click on "E" "link" in the ".entrybox" "css_element"
|
|
|
49 |
And I should see "Sour eggplants"
|
|
|
50 |
And I should not see "Sweet cucumber"
|
1441 |
ariadna |
51 |
And I should not see "No entries found in this section"
|
|
|
52 |
And I click on "Special" "link" in the ".entrybox" "css_element"
|
|
|
53 |
And I should see "7up"
|
|
|
54 |
And I should not see "Sweet cucumber"
|
|
|
55 |
And I should not see "Sour eggplants"
|
|
|
56 |
And I should not see "No entries found in this section"
|
1 |
efrain |
57 |
And I click on "X" "link" in the ".entrybox" "css_element"
|
|
|
58 |
And I should not see "Sweet cucumber"
|
|
|
59 |
And I should see "No entries found in this section"
|
|
|
60 |
|
|
|
61 |
@javascript
|
1441 |
ariadna |
62 |
Scenario: Search by keyword and browse by alphabet when several multilang entries can be found
|
|
|
63 |
When I add a glossary entry with the following data:
|
|
|
64 |
| Concept | <span lang="de" class="multilang">Concombre</span><span lang="en" class="multilang">Cucumber</span> |
|
|
|
65 |
| Definition | <span lang="fr" class="multilang">Doux concombre</span><span lang="en" class="multilang">Sweet cucumber alternate entry</span> |
|
|
|
66 |
And I set the field "hook" to "cucumber"
|
|
|
67 |
And I press "Search"
|
|
|
68 |
Then I should see "Sweet cucumber"
|
|
|
69 |
And I should see "Sweet cucumber alternate entry"
|
|
|
70 |
And I should see "Search: cucumber"
|
|
|
71 |
|
|
|
72 |
@javascript
|
1 |
efrain |
73 |
Scenario: Browse by category
|
|
|
74 |
When I select "Browse by category" from the "Browse the glossary using this index" singleselect
|
|
|
75 |
And I set the field "Categories" to "The ones I like"
|
|
|
76 |
Then I should see "Sweet cucumber"
|
|
|
77 |
And I should not see "Sour eggplants"
|
|
|
78 |
And I set the field "Categories" to "All for you"
|
|
|
79 |
And I should see "Sour eggplants"
|
|
|
80 |
And I should not see "Sweet cucumber"
|
|
|
81 |
|
|
|
82 |
@javascript
|
|
|
83 |
Scenario: Browse by date
|
|
|
84 |
When I select "Browse by date" from the "Browse the glossary using this index" singleselect
|
|
|
85 |
And I follow "By creation date"
|
|
|
86 |
Then "Delete entry: Eggplant" "link" should appear before "Delete entry: Cucumber" "link"
|
|
|
87 |
And I follow "By last update"
|
|
|
88 |
And I follow "By last update change to descending"
|
|
|
89 |
And "Delete entry: Cucumber" "link" should appear before "Delete entry: Eggplant" "link"
|
|
|
90 |
|
|
|
91 |
@javascript
|
|
|
92 |
Scenario: Browse by author
|
|
|
93 |
When I select "Browse by Author" from the "Browse the glossary using this index" singleselect
|
|
|
94 |
And I click on "T" "link" in the ".entrybox" "css_element"
|
|
|
95 |
Then I should see "Teacher 1"
|
|
|
96 |
And I should see "Sour eggplants"
|
|
|
97 |
And I should not see "Sweet cucumber"
|
|
|
98 |
And I click on "S" "link" in the ".entrybox" "css_element"
|
|
|
99 |
And I should see "Student 1"
|
|
|
100 |
And I should see "Sweet cucumber"
|
|
|
101 |
And I should not see "Sour eggplants"
|