Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_tag @javascript
2
Feature: Managers can create and manage tag collections
3
  In order to use tags effectively
4
  As a manager
5
  I need to be able to manage tag collections
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | manager1 | Manager   | 1        | manager1@example.com |
11
      | user1    | User      | 1        | user1@example.com    |
12
    And the following "system role assigns" exist:
13
      | user     | course               | role    |
14
      | manager1 | Acceptance test site | manager |
15
    And the following "tags" exist:
16
      | name | isstandard |
17
      | Tag0 | 1          |
18
      | Tag1 | 1          |
19
      | Tag2 | 1          |
20
      | Tag3 | 1          |
21
    And I log in as "manager1"
22
    And I navigate to "Appearance > Manage tags" in site administration
23
    And I follow "Add tag collection"
24
    And I set the following fields to these values:
25
      | Name | Hobbies |
26
    And I press "Create"
27
 
28
  Scenario: Adding tag collections
29
    When I follow "Hobbies"
30
    Then I should see "Nothing to display"
31
 
32
  Scenario: Editing tag collections
33
    When I set the field "Edit tag collection name" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hobbies')]" "xpath_element" to "Newname"
34
    Then I should not see "Hobbies"
35
    And I should see "Newname"
36
 
37
  Scenario: Resorting tag collections
38
    When I follow "Add tag collection"
39
    And I set the following fields to these values:
40
      | Name | Blogging |
41
    And I press "Create"
42
    Then "Blogging" "link" should appear after "Hobbies" "link"
43
    And I click on "Move up" "link" in the "Blogging" "table_row"
44
    And "Blogging" "link" should appear before "Hobbies" "link"
45
    And I click on "Move down" "link" in the "Blogging" "table_row"
46
    And "Blogging" "link" should appear after "Hobbies" "link"
47
 
48
  Scenario: Deleting tag collections
49
    When I click on "Delete" "link" in the "Hobbies" "table_row"
50
    Then I should see "Are you sure you want to delete tag collection \"Hobbies\"?"
51
    And I press "Yes"
52
    And I should not see "Hobbies"
53
 
54
  Scenario: Assigning tag area to tag collection
55
    And I should see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Default collection')]" "xpath_element"
56
    And I should not see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hobbies')]" "xpath_element"
57
    When I set the field "Change tag collection" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element" to "Hobbies"
58
    Then I should not see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Default collection')]" "xpath_element"
59
    And I should see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hobbies')]" "xpath_element"
60
    And I should see "Hobbies" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
61
 
62
  Scenario: Disabling tag areas
63
    When I click on "Disable" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
64
    And I should not see "User interests" in the "table.tag-collections-table" "css_element"
65
    And I click on "Enable" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
66
    And I should see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Default collection')]" "xpath_element"
67
 
68
  Scenario: Deleting non-empty tag collections
69
    When I set the field "Change tag collection" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element" to "Hobbies"
70
    And I click on "Delete" "link" in the "Hobbies" "table_row"
71
    Then I should see "Are you sure you want to delete tag collection \"Hobbies\"?"
72
    And I press "Yes"
73
    And I should not see "Hobbies"
74
    And I should see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Default collection')]" "xpath_element"
75
 
76
  Scenario: Moving tags when changing tag collections
77
    And I open my profile in edit mode
78
    And I expand all fieldsets
79
    And I set the field "List of interests" to "Swimming, Tag0, Tag3"
80
    And I press "Update profile"
81
    And I navigate to "Appearance > Manage tags" in site administration
82
    When I set the field "Change tag collection" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element" to "Hobbies"
83
    And I follow "Hobbies"
84
    Then I should see "Swimming"
85
    And I should see "Tag0"
86
    And I should see "Tag3"
87
    And I should not see "Tag1"
88
    And I should not see "Tag2"
89
    And I navigate to "Appearance > Manage tags" in site administration
90
    And I follow "Default collection"
91
    # Tag "Swimming" was not standard and was moved completely.
92
    And I should not see "Swimming"
93
    # Standard tag was not removed.
94
    And I should see "Tag0"
95
    And I should see "Tag3"
96
    And I should see "Tag1"
97
    And I should see "Tag2"
98
 
99
  Scenario: Creating searchable and non-searchable tag collections
100
    And I follow "Add tag collection"
101
    And I set the following fields to these values:
102
      | Name | Hiddencoll |
103
      | Searchable | 0 |
104
    And I press "Create"
105
    And "Yes" "text" should not exist in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hiddencoll')]" "xpath_element"
106
    And I turn editing mode on
107
    And the following config values are set as admin:
108
      | unaddableblocks | | theme_boost|
109
    # TODO MDL-57120 "Tags" link not accessible without navigation block.
110
    And I add the "Navigation" block if not present
111
    And I click on "Site pages" "list_item" in the "Navigation" "block"
112
    And I click on "Tags" "link" in the "Navigation" "block"
113
    Then the "Select tag collection" select box should contain "Default collection"
114
    And the "Select tag collection" select box should contain "Hobbies"
115
    And the "Select tag collection" select box should not contain "Hiddencoll"
116
    And I navigate to "Appearance > Manage tags" in site administration
117
    And I click on "Change searchable" "link" in the "Hobbies" "table_row"
118
    And I click on "Site pages" "list_item" in the "Navigation" "block"
119
    And I click on "Tags" "link" in the "Navigation" "block"
120
    And "Select tag collection" "select" should not exist