Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_glossary_random
2
Feature: Random glossary entry block is used in a course
3
  In order to show the entries from glossary
4
  As a teacher
5
  I can add the random glossary entry to a course page
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname |
10
      | Course 1 | C1        |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email             |
13
      | student1 | Sam1      | Student1 | student1@example.com |
14
      | teacher1 | Terry1    | Teacher1 | teacher1@example.com |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | student1 | C1     | student        |
18
      | teacher1 | C1     | editingteacher |
19
 
20
  Scenario: Student can not see the block if it is not configured
21
    When I log in as "teacher1"
22
    And I am on "Course 1" course homepage with editing mode on
23
    And I add the "Random glossary entry" block
24
    Then I should see "Please configure this block using the edit icon" in the "block_glossary_random" "block"
25
    And I log out
26
    And I log in as "student1"
27
    And I am on "Course 1" course homepage
28
    And "block_glossary_random" "block" should not exist
29
    And I log out
30
 
31
  Scenario: View random (last) entry in the glossary with auto approval
32
    Given the following "activities" exist:
33
      | activity | name         | intro                     | course | idnumber  | defaultapproval |
34
      | glossary | GlossaryAuto | Test glossary description | C1     | glossary1 | 1               |
35
    And I log in as "teacher1"
36
    And I am on "Course 1" course homepage with editing mode on
37
    And I add the "Random glossary entry" block
38
    And I configure the "block_glossary_random" block
39
    And I set the following fields to these values:
40
      | Title                           | AutoGlossaryblock   |
41
      | Take entries from this glossary | GlossaryAuto        |
42
      | How a new entry is chosen       | Last modified entry |
43
    And I press "Save changes"
44
    And I log out
45
    When I log in as "student1"
46
    And I am on "Course 1" course homepage
47
    Then I should see "There are no entries yet in the chosen glossary" in the "AutoGlossaryblock" "block"
48
    And I click on "Add a new entry" "link" in the "AutoGlossaryblock" "block"
49
    And I set the following fields to these values:
50
      | Concept    | Concept1    |
51
      | Definition | Definition1 |
52
    And I press "Save changes"
53
    And I am on "Course 1" course homepage
54
    And I should see "Concept1" in the "AutoGlossaryblock" "block"
55
    And I should see "Definition1" in the "AutoGlossaryblock" "block"
56
    And I should not see "There are no entries yet in the chosen glossary" in the "AutoGlossaryblock" "block"
57
    And I click on "Add a new entry" "link" in the "AutoGlossaryblock" "block"
58
    And I set the following fields to these values:
59
      | Concept    | Concept2    |
60
      | Definition | Definition2 |
61
    And I press "Save changes"
62
    And I am on "Course 1" course homepage
63
    # Only the last entry appears in the block
64
    And I should not see "Concept1" in the "AutoGlossaryblock" "block"
65
    And I should not see "Definition1" in the "AutoGlossaryblock" "block"
66
    And I should see "Concept2" in the "AutoGlossaryblock" "block"
67
    And I should see "Definition2" in the "AutoGlossaryblock" "block"
68
    And I click on "View all entries" "link" in the "AutoGlossaryblock" "block"
69
    And I should see "GlossaryAuto" in the "#page-navbar" "css_element"
70
    And I should see "Concept1" in the "#page-content" "css_element"
71
    And I should see "Concept2" in the "#page-content" "css_element"
72
    And I log out
73
 
74
  Scenario: View random (last) entry in the glossary with manual approval
75
    Given the following "activities" exist:
76
      | activity | name           | intro                     | course | idnumber  | defaultapproval |
77
      | glossary | GlossaryManual | Test glossary description | C1     | glossary2 | 0               |
78
    And I log in as "teacher1"
79
    And I am on "Course 1" course homepage with editing mode on
80
    And I add the "Random glossary entry" block
81
    And I configure the "block_glossary_random" block
82
    And I set the following fields to these values:
83
      | Title                           | ManualGlossaryblock |
84
      | Take entries from this glossary | GlossaryManual      |
85
      | How a new entry is chosen       | Last modified entry |
86
    And I press "Save changes"
87
    And I log out
88
    When I log in as "student1"
89
    And I am on "Course 1" course homepage
90
    Then I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
91
    And I click on "Add a new entry" "link" in the "ManualGlossaryblock" "block"
92
    And I set the following fields to these values:
93
      | Concept    | Concept1    |
94
      | Definition | Definition1 |
95
    And I press "Save changes"
96
    And I am on "Course 1" course homepage
97
    And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
98
    And I log out
99
    And I log in as "teacher1"
100
    And I am on "Course 1" course homepage
101
    And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block"
102
    And I follow "GlossaryManual"
103
    And I follow "Pending approval"
104
    And I follow "Approve"
105
    And I click on "Course 1" "link" in the "#page-navbar" "css_element"
106
    And I should see "Concept1" in the "ManualGlossaryblock" "block"
107
    And I should see "Definition1" in the "ManualGlossaryblock" "block"
108
    And I log out