Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_data @datapreset @datapreset_journal
2
Feature: Users can use the Journal preset
3
  In order to create a Journal database
4
  As a user
5
  I need to apply and use the Journal preset
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student1 | Alice     | Student  | student1@example.com |
11
      | teacher1 | Pau       | Teacher  | teacher1@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          | course | idnumber |
21
      | data     | Student reflections    | Database intro | C1     | data1    |
22
    And I am on the "Student reflections" "data activity" page logged in as teacher1
23
    And I follow "Presets"
24
    And I click on "fullname" "radio" in the "Journal" "table_row"
25
    And I click on "Use this preset" "button"
26
    And the following "mod_data > entries" exist:
27
      | database | user      | Title                           | Content                                  |
28
      | data1    | student1  | Reflection created by student   | This is the content for the entry 1      |
29
      | data1    | teacher1  | Reflection created by teacher   | And this is the content for the entry 2  |
30
 
31
  @javascript
32
  Scenario: Journal. Users view entries
33
    When I am on the "Student reflections" "data activity" page logged in as student1
34
    Then I should see "Reflection created by student"
35
    And I should see "This is the content for the entry 1"
36
    And "Actions" "icon" should exist in the "#journal-list" "css_element"
37
    And I should see "Reflection created by teacher"
38
    And I should see "And this is the content for the entry 2"
39
    # Single view.
40
    And I select "Single view" from the "jump" singleselect
41
    And I should see "Reflection created by student"
42
    And I should see "This is the content for the entry 1"
43
    And "Actions" "icon" should exist in the ".journal-single" "css_element"
44
    And I should not see "Reflection created by teacher"
45
    And I should not see "And this is the content for the entry 2"
46
    And I follow "Next"
47
    And I should see "Reflection created by teacher"
48
    And I should see "And this is the content for the entry 2"
49
    # This student can't edit or delete this entry, so the Actions menu shouldn't be displayed.
50
    And "Actions" "icon" should not exist in the ".journal-single" "css_element"
51
    And I should not see "Reflection created by student"
52
    And I should not see "This is the content for the entry 1"
53
 
54
  @javascript
55
  Scenario: Journal. Users can search entries
56
    Given I am on the "Student reflections" "data activity" page logged in as student1
57
    And "Reflection created by student" "text" should appear before "Reflection created by teacher" "text"
58
    When I click on "Advanced search" "checkbox"
59
    And I should see "First name"
60
    And I should see "Last name"
61
    And I set the field "Title" to "student"
62
    And I click on "Save settings" "button" in the "data_adv_form" "region"
63
    Then I should see "Reflection created by student"
64
    And I should not see "Reflection created by teacher"
65
    But I set the field "Title" to "Reflection"
66
    And I set the field "Order" to "Descending"
67
    And I click on "Save settings" "button" in the "data_adv_form" "region"
68
    And "Reflection created by teacher" "text" should appear before "Reflection created by student" "text"
69
 
70
  @javascript
71
  Scenario: Journal. Users can add entries
72
    Given I am on the "Student reflections" "data activity" page logged in as student1
73
    When I press "Add entry"
74
    And I set the field "Title" to "This is the title"
75
    And I set the field "Content" to "This is the content for the new entry."
76
    And I press "Save"
77
    Then I should see "This is the title"
78
    And I should see "This is the content for the new entry."
79
 
80
  @javascript
81
  Scenario: Journal. Renaming a field should affect the template
82
    Given I am on the "Student reflections" "data activity" page logged in as teacher1
83
    And I navigate to "Fields" in current page administration
84
    And I open the action menu in "Content" "table_row"
85
    And I choose "Edit" in the open action menu
86
    And I set the field "Field name" to "Edited field name"
87
    And I press "Save"
88
    And I should see "Field updated"
89
    When I navigate to "Database" in current page administration
90
    Then I click on "Advanced search" "checkbox"
91
    And I should see "Edited field name"
92
    And I click on "Add entry" "button"
93
    And I should see "Edited field name"
94
 
95
  @javascript
96
  Scenario: Journal. Has otherfields tag
97
    Given the following "mod_data > fields" exist:
98
      | database | type | name        | description            |
99
      | data1    | text | Extra field | Test field description |
100
    And I am on the "Student reflections" "data activity" page logged in as teacher1
101
    When I click on "Add entry" "button"
102
    Then I should see "Extra field"