2 Feature: Users can flag tags and manager can reset flags
5 I need to be able to flag the tag as inappropriate
8 Given the following "users" exist:
9 | username | firstname | lastname | email | interests |
10 | manager1 | Manager | 1 | manager1@example.com | |
11 | user1 | User | 1 | user1@example.com | Nicetag, Badtag, Sweartag |
12 | user2 | User | 2 | user2@example.com | |
13 | user3 | User | 3 | user3@example.com | |
14 And the following "system role assigns" exist:
15 | user | course | role |
16 | manager1 | Acceptance test site | manager |
17 And the following "tags" exist:
20 And I log in as "admin"
21 And I set the following system permissions of "Authenticated user" role:
22 | capability | permission |
23 | moodle/site:viewparticipants | Allow |
24 | moodle/user:viewdetails | Allow |
26 And I log in as "user2"
27 And I press "Customise this page"
28 # TODO MDL-57120 site "Tags" link not accessible without navigation block.
29 And I add the "Navigation" block if not present
30 And I click on "Site pages" "list_item" in the "Navigation" "block"
31 And I click on "Tags" "link" in the "Navigation" "block"
32 And I follow "Nicetag"
35 And I follow "Flag as inappropriate"
36 And I should see "The person responsible will be notified"
38 # TODO MDL-57120 site "Tags" link not accessible without navigation block.
39 And I add the "Navigation" block if not present
40 And I click on "Site pages" "list_item" in the "Navigation" "block"
41 And I click on "Tags" "link" in the "Navigation" "block"
42 And I follow "Nicetag"
44 And I follow "Sweartag"
45 And I follow "Flag as inappropriate"
46 And I should see "The person responsible will be notified"
48 And I log in as "user3"
49 And I press "Customise this page"
50 # TODO MDL-57120 site "Tags" link not accessible without navigation block.
51 And I add the "Navigation" block if not present
52 And I click on "Site pages" "list_item" in the "Navigation" "block"
53 And I click on "Tags" "link" in the "Navigation" "block"
54 And I follow "Nicetag"
56 And I follow "Sweartag"
57 And I follow "Flag as inappropriate"
58 And I should see "The person responsible will be notified"
62 Scenario: Managing tag flags
63 When I log in as "manager1"
64 And I navigate to "Appearance > Manage tags" in site administration
65 And I follow "Default collection"
66 Then "Sweartag" "link" should appear before "Badtag" "link"
67 And "Badtag" "link" should appear before "Nicetag" "link"
68 And "(2)" "text" should exist in the "//tr[contains(.,'Sweartag')]//td[contains(@class,'col-flag')]" "xpath_element"
69 And "(1)" "text" should exist in the "//tr[contains(.,'Badtag')]//td[contains(@class,'col-flag')]" "xpath_element"
70 And "(" "text" should not exist in the "//tr[contains(.,'Nicetag')]//td[contains(@class,'col-flag')]" "xpath_element"
71 And "(" "text" should not exist in the "//tr[contains(.,'Neverusedtag')]//td[contains(@class,'col-flag')]" "xpath_element"
72 And I click on "Reset flag" "link" in the "Sweartag" "table_row"
73 And I click on "Reset flag" "link" in the "Badtag" "table_row"
74 And I wait until "//tr[contains(.,'Sweartag')]//a[contains(@title,'Flag as inappropriate')]" "xpath_element" exists
75 And I click on "Flag as inappropriate" "link" in the "Sweartag" "table_row"
76 And I click on "Flag as inappropriate" "link" in the "Nicetag" "table_row"
77 And "(1)" "text" should exist in the "//tr[contains(.,'Sweartag')]//td[contains(@class,'col-flag')]" "xpath_element"
78 And "(1)" "text" should exist in the "//tr[contains(.,'Nicetag')]//td[contains(@class,'col-flag')]" "xpath_element"
79 And "(" "text" should not exist in the "//tr[contains(.,'Badtag')]//td[contains(@class,'col-flag')]" "xpath_element"
80 And "(" "text" should not exist in the "//tr[contains(.,'Neverusedtag')]//td[contains(@class,'col-flag')]" "xpath_element"
81 And I follow "Default collection"
82 And "Nicetag" "link" should appear before "Sweartag" "link"
83 And "Sweartag" "link" should appear before "Badtag" "link"
84 And "(1)" "text" should exist in the "//tr[contains(.,'Sweartag')]//td[contains(@class,'col-flag')]" "xpath_element"
85 And "(1)" "text" should exist in the "//tr[contains(.,'Nicetag')]//td[contains(@class,'col-flag')]" "xpath_element"
86 And "(" "text" should not exist in the "//tr[contains(.,'Badtag')]//td[contains(@class,'col-flag')]" "xpath_element"
87 And "(" "text" should not exist in the "//tr[contains(.,'Neverusedtag')]//td[contains(@class,'col-flag')]" "xpath_element"