2 Feature: Manager can add standard tags and change the tag type of existing tags
5 I need to be able to change tag type
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:
22 Scenario: Adding standard tags
23 When I log in as "manager1"
24 And I navigate to "Manage tags" node in "Site administration > Appearance"
25 And I follow "Default collection"
26 Then "Make standard" "link" should exist in the "Tag0" "table_row"
27 And "Make standard" "link" should exist in the "Tag1" "table_row"
28 And "Make standard" "link" should exist in the "Tag2" "table_row"
29 And "Remove from standard tags" "link" should exist in the "Tag3" "table_row"
30 And I set the following fields to these values:
31 | Add standard tags | Tag1,TAG2,Tag3,Tag4,Tag5 |
32 And I press "Add standard tags"
33 And I should see "Standard tag(s) added"
35 And "Make standard" "link" should exist in the "Tag0" "table_row"
36 # Tag1 was already present, now it is standard
37 And "Remove from standard" "link" should exist in the "Tag1" "table_row"
38 # Tag2 was already present, now it is standard. It was not renamed to TAG2
39 And "Remove from standard" "link" should exist in the "Tag2" "table_row"
40 And I should not see "TAG2"
41 # Tag3 was already present and it already was standard
42 And "Remove from standard tags" "link" should exist in the "Tag3" "table_row"
43 # Tag4 and Tag5 were added as standard
44 And "Remove from standard tags" "link" should exist in the "Tag4" "table_row"
45 And "Remove from standard tags" "link" should exist in the "Tag5" "table_row"
49 Scenario: Changing tag isstandard
50 When I log in as "manager1"
51 And I navigate to "Manage tags" node in "Site administration > Appearance"
52 And I follow "Default collection"
53 And I click on "Make standard" "link" in the "Tag0" "table_row"
54 And I click on "Make standard" "link" in the "Tag1" "table_row"
55 And I wait until "//tr[contains(.,'Tag0')]//a[contains(@title,'Remove from standard tags')]" "xpath_element" exists
56 And I wait until "//tr[contains(.,'Tag1')]//a[contains(@title,'Remove from standard tags')]" "xpath_element" exists
57 And I click on "Remove from standard tags" "link" in the "Tag0" "table_row"
58 And I click on "Remove from standard tags" "link" in the "Tag3" "table_row"
59 And I wait until "//tr[contains(.,'Tag0')]//a[contains(@title,'Make standard')]" "xpath_element" exists
60 And I wait until "//tr[contains(.,'Tag3')]//a[contains(@title,'Make standard')]" "xpath_element" exists
61 Then "Make standard" "link" should exist in the "Tag0" "table_row"
62 And "Remove from standard tags" "link" should exist in the "Tag1" "table_row"
63 And "Make standard" "link" should exist in the "Tag2" "table_row"
64 And "Make standard" "link" should exist in the "Tag3" "table_row"
65 And I follow "Default collection"
66 And "Make standard" "link" should exist in the "Tag0" "table_row"
67 And "Remove from standard tags" "link" should exist in the "Tag1" "table_row"
68 And "Make standard" "link" should exist in the "Tag2" "table_row"
69 And "Make standard" "link" should exist in the "Tag3" "table_row"
72 Scenario: Changing tag isstandard in edit form
73 When I log in as "manager1"
74 And I navigate to "Manage tags" node in "Site administration > Appearance"
75 And I follow "Default collection"
76 And I click on "Edit this tag" "link" in the "Tag1" "table_row"
77 And I set the following fields to these values:
80 Then "Remove from standard tags" "link" should exist in the "Tag1" "table_row"
81 And I click on "Edit this tag" "link" in the "Tag1" "table_row"
82 And I set the following fields to these values:
85 And "Make standard" "link" should exist in the "Tag1" "table_row"
89 Scenario: Changing standard tags property of tag area
90 When I log in as "manager1"
91 And I follow "Profile" in the user menu
92 And I follow "Edit profile"
93 And I expand all fieldsets
94 And I should not see "Manage standard tags"
95 And I set the following fields to these values:
96 | List of interests | Tag3 , Tag2 |
97 And I press "Update profile"
98 And I navigate to "Manage tags" node in "Site administration > Appearance"
99 And I click on "Change standard tag usage" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
100 And the field "Change showing standard tags in area User interests" matches value "Don't suggest"
101 And I set the field "Change showing standard tags in area User interests" to "Suggest"
102 And I follow "Profile" in the user menu
103 And I follow "Edit profile"
104 And I expand all fieldsets
105 And I should see "Manage standard tags"
106 And I navigate to "Manage tags" node in "Site administration > Appearance"
107 And I click on "Change standard tag usage" "link" in the "//table[contains(@class,'tag-areas-table')]//tr[contains(.,'User interests')]" "xpath_element"
108 And the field "Change showing standard tags in area User interests" matches value "Suggest"
109 And I set the field "Change showing standard tags in area User interests" to "Force"
110 And I follow "Profile" in the user menu
111 And I should see "Tag3"
112 And I should see "Tag2"
113 And I follow "Edit profile"
114 And I expand all fieldsets
115 And I should see "Manage standard tags"
116 And I press "Update profile"
117 # Non-standard tags were automatically removed on form save.
118 And I should see "Tag3"
119 And I should not see "Tag2"