2 Feature: Managers can create and manage tag collections
3 In order to use tags effectively
5 I need to be able to manage tag collections
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:
21 And I log in as "manager1"
22 And I navigate to "Manage tags" node in "Site administration > Appearance"
23 And I follow "Add tag collection"
24 And I set the following fields to these values:
26 And I press "Save changes"
28 Scenario: Adding tag collections
29 When I follow "Hobbies"
30 Then I should see "Nothing to display"
33 Scenario: Editing tag collections
34 When I follow "Edit tag collection Hobbies"
35 And I set the following fields to these values:
37 And I press "Save changes"
38 Then I should not see "Hobbies"
39 And I should see "Newname"
42 Scenario: Resorting tag collections
43 When I follow "Add tag collection"
44 And I set the following fields to these values:
46 And I press "Save changes"
47 Then "Blogging" "link" should appear after "Hobbies" "link"
48 And I click on "Move up" "link" in the "Blogging" "table_row"
49 And "Blogging" "link" should appear before "Hobbies" "link"
50 And I click on "Move down" "link" in the "Blogging" "table_row"
51 And "Blogging" "link" should appear after "Hobbies" "link"
54 Scenario: Deleting tag collections
55 When I click on "Delete" "link" in the "Hobbies" "table_row"
56 Then I should see "Are you sure you want to delete tag collection \"Hobbies\"?"
58 And I should not see "Hobbies"
62 Scenario: Assigning tag area to tag collection
63 And I should see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Default collection')]" "xpath_element"
64 And I should not see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hobbies')]" "xpath_element"
65 When I click on "Change tag collection" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
66 And I set the field "Change tag collection of area User interests" to "Hobbies"
67 Then I should not see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Default collection')]" "xpath_element"
68 And I should see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hobbies')]" "xpath_element"
69 And I should see "Hobbies" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
73 Scenario: Disabling tag areas
74 When I click on "Disable" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
75 And I should see "User interests" in the "table.tag-collections-table" "css_element"
76 And I click on "Enable" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
77 And I should see "User interests" in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Default collection')]" "xpath_element"
81 Scenario: Deleting non-empty tag collections
82 When I click on "Change tag collection" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
83 And I set the field "Change tag collection of area User interests" to "Hobbies"
84 And I click on "Delete" "link" in the "Hobbies" "table_row"
85 Then I should see "Are you sure you want to delete tag collection \"Hobbies\"?"
87 And I should not see "Hobbies"
88 And "User interests" "text" should exist in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Default collection')]" "xpath_element"
92 Scenario: Moving tags when changing tag collections
93 And I follow "Preferences" in the user menu
94 And I follow "Edit profile"
95 And I expand all fieldsets
96 And I set the field "List of interests" to "Swimming, Tag0, Tag3"
97 And I press "Update profile"
98 And I navigate to "Manage tags" node in "Site administration > Appearance"
99 When I click on "Change tag collection" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
100 And I set the field "Change tag collection of area User interests" to "Hobbies"
101 And I follow "Hobbies"
102 Then I should see "Swimming"
103 And I should see "Tag0"
104 And I should see "Tag3"
105 And I should not see "Tag1"
106 And I should not see "Tag2"
107 And I follow "Manage tags"
108 And I follow "Default collection"
109 # Tag "Swimming" was not standard and was moved completely.
110 And I should not see "Swimming"
111 # Standard tag was not removed.
112 And I should see "Tag0"
113 And I should see "Tag3"
114 And I should see "Tag1"
115 And I should see "Tag2"
119 Scenario: Creating searchable and non-searchable tag collections
120 And I follow "Add tag collection"
121 And I set the following fields to these values:
122 | Name | Hiddencoll |
124 And I press "Save changes"
125 And "Yes" "text" should not exist in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hiddencoll')]" "xpath_element"
126 And I navigate to "Tags" node in "Site pages"
127 Then the "Select tag collection" select box should contain "Default collection"
128 And the "Select tag collection" select box should contain "Hobbies"
129 And the "Select tag collection" select box should not contain "Hiddencoll"
130 And I navigate to "Manage tags" node in "Site administration > Appearance"
131 And I click on "Edit" "link" in the "Hobbies" "table_row"
132 And I set the following fields to these values:
134 And I press "Save changes"
135 And I navigate to "Tags" node in "Site pages"
136 And "Select tag collection" "select" should not exist