1441 |
ariadna |
1 |
@mod @mod_glossary
|
|
|
2 |
Feature: Glossary can set autolinked entries in text and media areas
|
|
|
3 |
In order to display the glossary entries for concepts in texts
|
|
|
4 |
As a teacher
|
|
|
5 |
I can set the glossary activity to autolink the entries
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given remote langimport tests are enabled
|
|
|
9 |
And the following "users" exist:
|
|
|
10 |
| username | firstname | lastname | email |
|
|
|
11 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
12 |
| student1 | Student | 1 | student1@example.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
And the following "activities" exist:
|
|
|
21 |
| activity | name | intro | displayformat | course | idnumber |
|
|
|
22 |
| glossary | Test <span class="multilang" lang="en">glossary</span><span class="multilang" lang="fr">glossaire</span><span class="multilang" lang="es">glossario</span> | Test glossary description | encyclopedia | C1 | glossary1 |
|
|
|
23 |
And the following "mod_glossary > entries" exist:
|
|
|
24 |
| glossary | concept | definition | usedynalink |
|
|
|
25 |
| glossary1 | <span class="multilang" lang="en">English</span><span class="multilang" lang="fr">Anglais</span><span class="multilang" lang="es">inglés</span> | <span class="multilang" lang="en">Relating to England, its people, or the language spoken there.</span><span class="multilang" lang="fr">Relatif à l'Angleterre, à son peuple ou à la langue parlée là-bas.</span><span class="multilang" lang="es">Relacionado con Inglaterra, su gente o el idioma hablado allí.</span> | 1 |
|
|
|
26 |
| glossary1 | <span class="multilang" lang="en">Spanish</span><span class="multilang" lang="fr">Espagnol</span><span class="multilang" lang="es">Castellano</span> | <span class="multilang" lang="en">Relating to Spain, its people, or the language spoken there.</span><span class="multilang" lang="fr">Relatif à l'Espagne, à son peuple ou à la langue parlée là-bas.</span><span class="multilang" lang="es">Relacionado con España, su gente o el idioma hablado allí.</span> | 1 |
|
|
|
27 |
And the following "activities" exist:
|
|
|
28 |
| activity | name | intro | course | idnumber |
|
|
|
29 |
| label | Text and media area | <p>This is a text with the multilang syntax on the <span class="multilang" lang="en">English</span><span class="multilang" lang="fr">Anglais</span><span class="multilang" lang="es">Inglés</span> word that should be auto-linked.</p><p>This are plain text words that should also be auto-linked: English, Anglais, Inglés.</p> | C1 | label1 |
|
|
|
30 |
And the "glossary" filter is "on"
|
|
|
31 |
And the following "language pack" exists:
|
|
|
32 |
| language | fr | es |
|
|
|
33 |
And the "multilang" filter is "on"
|
|
|
34 |
And the "multilang" filter applies to "content and headings"
|
|
|
35 |
|
|
|
36 |
@javascript
|
|
|
37 |
Scenario: Glossary entries show up in text and media areas in the correct user interface/language combination
|
|
|
38 |
When I am on the "Course 1" course page logged in as teacher1
|
|
|
39 |
Then "English" "link" should exist in the ".modtype_label" "css_element"
|
|
|
40 |
And "Anglais" "link" should not exist in the ".modtype_label" "css_element"
|
|
|
41 |
And "Inglés" "link" should not exist in the ".modtype_label" "css_element"
|
|
|
42 |
And the "title" attribute of ".glossary.autolink" "css_element" should contain "Test glossary: English"
|
|
|
43 |
And I follow "Preferences" in the user menu
|
|
|
44 |
And I follow "Preferred language"
|
|
|
45 |
# Change preferred language to Spanish.
|
|
|
46 |
And I set the field "Preferred language" to "es"
|
|
|
47 |
And I press "Save changes"
|
|
|
48 |
And I am on "Course 1" course homepage
|
|
|
49 |
Then "English" "link" should not exist in the ".modtype_label" "css_element"
|
|
|
50 |
And "Anglais" "link" should not exist in the ".modtype_label" "css_element"
|
|
|
51 |
And "Inglés" "link" should exist in the ".modtype_label" "css_element"
|
|
|
52 |
And the "title" attribute of ".glossary.autolink" "css_element" should contain "Test glossario: inglés"
|
|
|
53 |
And I follow "Preferencias" in the user menu
|
|
|
54 |
And I follow "Idioma preferido"
|
|
|
55 |
# Change preferred language to French.
|
|
|
56 |
And I set the field "Idioma preferido" to "fr"
|
|
|
57 |
And I press "Guardar cambios"
|
|
|
58 |
And I am on "Course 1" course homepage
|
|
|
59 |
Then "English" "link" should not exist in the ".modtype_label" "css_element"
|
|
|
60 |
And "Anglais" "link" should exist in the ".modtype_label" "css_element"
|
|
|
61 |
And "Inglés" "link" should not exist in the ".modtype_label" "css_element"
|
|
|
62 |
And the "title" attribute of ".glossary.autolink" "css_element" should contain "Test glossaire : Anglais"
|