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 navigate to "Tags" node in "Site pages"
31 And I follow "Nicetag"
34 And I follow "Flag as inappropriate"
35 And I should see "The person responsible will be notified"
37 And I navigate to "Tags" node in "Site pages"
38 And I follow "Nicetag"
40 And I follow "Sweartag"
41 And I follow "Flag as inappropriate"
42 And I should see "The person responsible will be notified"
44 And I log in as "user3"
45 And I press "Customise this page"
46 # TODO MDL-57120 site "Tags" link not accessible without navigation block.
47 And I add the "Navigation" block if not present
48 And I navigate to "Tags" node in "Site pages"
49 And I follow "Nicetag"
51 And I follow "Sweartag"
52 And I follow "Flag as inappropriate"
53 And I should see "The person responsible will be notified"
57 Scenario: Managing tag flags
58 When I log in as "manager1"
59 And I navigate to "Manage tags" node in "Site administration > Appearance"
60 And I follow "Default collection"
61 Then "Sweartag" "link" should appear before "Badtag" "link"
62 And "Badtag" "link" should appear before "Nicetag" "link"
63 And "(2)" "text" should exist in the "//tr[contains(.,'Sweartag')]//td[contains(@class,'col-flag')]" "xpath_element"
64 And "(1)" "text" should exist in the "//tr[contains(.,'Badtag')]//td[contains(@class,'col-flag')]" "xpath_element"
65 And "(" "text" should not exist in the "//tr[contains(.,'Nicetag')]//td[contains(@class,'col-flag')]" "xpath_element"
66 And "(" "text" should not exist in the "//tr[contains(.,'Neverusedtag')]//td[contains(@class,'col-flag')]" "xpath_element"
67 And I click on "Reset flag" "link" in the "Sweartag" "table_row"
68 And I click on "Reset flag" "link" in the "Badtag" "table_row"
69 And I wait until "//tr[contains(.,'Sweartag')]//a[contains(@title,'Flag as inappropriate')]" "xpath_element" exists
70 And I click on "Flag as inappropriate" "link" in the "Sweartag" "table_row"
71 And I click on "Flag as inappropriate" "link" in the "Nicetag" "table_row"
72 And "(1)" "text" should exist in the "//tr[contains(.,'Sweartag')]//td[contains(@class,'col-flag')]" "xpath_element"
73 And "(1)" "text" should exist in the "//tr[contains(.,'Nicetag')]//td[contains(@class,'col-flag')]" "xpath_element"
74 And "(" "text" should not exist in the "//tr[contains(.,'Badtag')]//td[contains(@class,'col-flag')]" "xpath_element"
75 And "(" "text" should not exist in the "//tr[contains(.,'Neverusedtag')]//td[contains(@class,'col-flag')]" "xpath_element"
76 And I follow "Default collection"
77 And "Nicetag" "link" should appear before "Sweartag" "link"
78 And "Sweartag" "link" should appear before "Badtag" "link"
79 And "(1)" "text" should exist in the "//tr[contains(.,'Sweartag')]//td[contains(@class,'col-flag')]" "xpath_element"
80 And "(1)" "text" should exist in the "//tr[contains(.,'Nicetag')]//td[contains(@class,'col-flag')]" "xpath_element"
81 And "(" "text" should not exist in the "//tr[contains(.,'Badtag')]//td[contains(@class,'col-flag')]" "xpath_element"
82 And "(" "text" should not exist in the "//tr[contains(.,'Neverusedtag')]//td[contains(@class,'col-flag')]" "xpath_element"