Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_glossary
2
Feature: Glossary can be set to various display formats
3
  In order to display different glossary formats
4
  As a teacher
5
  I can set the glossary activity display format
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | Teacher   | One      | teacher1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname |
13
      | Course 1 | C1        |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
17
    Given the following "activities" exist:
18
      | activity | course | name       |
19
      | glossary | C1     | Glossary 1 |
20
    And the following "mod_glossary > entries" exist:
21
      | glossary   | concept | definition         |
22
      | Glossary 1 | Entry 1 | Entry 1 definition |
23
      | Glossary 1 | Entry 2 | Entry 2 definition |
24
 
25
  Scenario: Glossary display format is entry list style
26
    Given I am on the "Glossary 1" "glossary activity editing" page logged in as teacher1
27
    And I set the following fields to these values:
28
      | displayformat | entrylist |
29
    When I press "Save and display"
30
    # Confirm that glossary display format is entry list.
31
    # In this format, the concept definitions are not displayed.
32
    Then I should not see "by Admin User"
33
    And I should not see "Entry 1 definition"
34
    And I should not see "Entry 2 definition"
35
    And ".entrylist" "css_element" should exist
36
 
37
  Scenario: Glossary display format is FAQ-style
38
    Given I am on the "Glossary 1" "glossary activity editing" page logged in as teacher1
39
    And I set the following fields to these values:
40
      | displayformat | faq |
41
    When I press "Save and display"
42
    # Confirm that glossary format is FAQ.
43
    # In this format, the words Question and Answer are displayed.
44
    Then I should see "Question:"
45
    And I should see "Answer:"
46
    And ".faq" "css_element" should exist
47
 
48
  @_file_upload @javascript
49
  Scenario: Glossary display format is full without author style
50
    Given I am on the "Glossary 1" "glossary activity editing" page logged in as teacher1
51
    And I set the following fields to these values:
52
      | displayformat | fullwithoutauthor |
53
    And I press "Save and display"
54
    And I press "Add entry"
55
    # Add an entry with an attachment.
56
    And I set the following fields to these values:
57
      | Concept    | Entry 3                        |
58
      | Definition | Entry 3 definition             |
59
      | Attachment | lib/tests/fixtures/gd-logo.png |
60
    When I press "Save changes"
61
    # Confirm that glossary format is full without author style.
62
    # In this format, the image link should exist and author's name should not be visible.
63
    Then "gd-logo.png" "link" should exist
64
    And I should not see "by Admin User"
65
    And ".fullwithoutauthor" "css_element" should exist
66
 
67
  @_file_upload @javascript
68
  Scenario: Glossary display format is encyclopedia style
69
    Given I am on the "Glossary 1" "glossary activity editing" page logged in as teacher1
70
    And I set the following fields to these values:
71
      | displayformat | encyclopedia |
72
    And I press "Save and display"
73
    And I press "Add entry"
74
    # Add an entry with an attachment.
75
    And I set the following fields to these values:
76
      | Concept    | Entry 3                        |
77
      | Definition | Entry 3 definition             |
78
      | Attachment | lib/tests/fixtures/gd-logo.png |
79
    When I press "Save changes"
80
    # Confirm that glossary format is encyclopedia.
81
    # In this format, the image element should be displayed.
82
    Then "//img[contains(@src, 'gd-logo.png')]" "xpath_element" should exist
83
    And ".encyclopedia" "css_element" should exist
84
 
85
  Scenario Outline: Glossary display format can be set to dictionary, continuous and full with author
86
    Given I am on the "Glossary 1" "glossary activity editing" page logged in as teacher1
87
    # Assign the corresponding display format to glossary activity.
88
    And I set the following fields to these values:
89
      | displayformat | <display_format> |
90
    When I press "Save and display"
91
    # Confirm that glossary format is the display format set in the previous step.
92
    Then I should <visibility> "by Admin User"
93
    And ".<display_format>" "css_element" should exist
94
 
95
    Examples:
96
      | display_format | visibility |
97
      | dictionary     | not see    |
98
      | continuous     | not see    |
99
      | fullwithauthor | see        |