1 |
efrain |
1 |
@core @core_tag
|
|
|
2 |
Feature: Browsing tagged items
|
|
|
3 |
In order to search by tag
|
|
|
4 |
As a user
|
|
|
5 |
I need to be able to browse tagged items
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
1441 |
ariadna |
9 |
| username | firstname | lastname | email | interests |
|
|
|
10 |
| user1 | User | 1 | user1@example.com | Cat, Zebra |
|
|
|
11 |
| user2 | User | 2 | user2@example.com | Cat, Dog, Zebra |
|
|
|
12 |
| user3 | User | 3 | user3@example.com | Zebra |
|
|
|
13 |
| user4 | User | 4 | user4@example.com | Zebra |
|
|
|
14 |
| user5 | User | 5 | user5@example.com | Zebra |
|
|
|
15 |
| user6 | User | 6 | user6@example.com | Zebra |
|
1 |
efrain |
16 |
And the following "courses" exist:
|
|
|
17 |
| fullname | shortname | tags |
|
|
|
18 |
| Course 1 | c1 | Cat, Dog |
|
|
|
19 |
| Course 2 | c2 | Cat |
|
|
|
20 |
| Course 3 | c3 | Cat |
|
|
|
21 |
| Course 4 | c4 | Cat |
|
|
|
22 |
| Course 5 | c5 | Cat |
|
|
|
23 |
| Course 6 | c6 | Cat |
|
|
|
24 |
| Course 7 | c7 | Cat |
|
1441 |
ariadna |
25 |
And the following config values are set as admin:
|
|
|
26 |
| unaddableblocks | | theme_boost|
|
|
|
27 |
And the following "permission overrides" exist:
|
|
|
28 |
| capability | permission | role | contextlevel | reference |
|
|
|
29 |
| moodle/user:viewdetails | Allow | user | System | |
|
1 |
efrain |
30 |
|
|
|
31 |
Scenario: Browse tag index with javascript disabled
|
|
|
32 |
When I log in as "user1"
|
|
|
33 |
And I turn editing mode on
|
|
|
34 |
# TODO MDL-57120 "Tags" link not accessible without navigation block.
|
|
|
35 |
And I add the "Navigation" block if not present
|
|
|
36 |
And I click on "Tags" "link" in the "Navigation" "block"
|
|
|
37 |
And I follow "Cat"
|
|
|
38 |
Then I should see "Courses" in the ".tag-index-items h3" "css_element"
|
|
|
39 |
And I should see "User 1" in the "#tagarea-core-user" "css_element"
|
|
|
40 |
And I should see "Course 7"
|
|
|
41 |
And I should see "Course 3"
|
|
|
42 |
And I should not see "Course 2"
|
|
|
43 |
And I should not see "Course 1"
|
|
|
44 |
And I should see "User 1" in the "#tagarea-core-user" "css_element"
|
|
|
45 |
And I should see "User 2"
|
|
|
46 |
And I should not see "User 3"
|
|
|
47 |
And I click on "More" "link" in the "#tagarea-core-course" "css_element"
|
|
|
48 |
And I should see "Courses" in the "#tagarea-core-course" "css_element"
|
|
|
49 |
And "#tagarea-core-user" "css_element" should not exist
|
|
|
50 |
And I should not see "Course 7"
|
|
|
51 |
And I should not see "Course 3"
|
|
|
52 |
And I should see "Course 2"
|
|
|
53 |
And I should see "Course 1"
|
|
|
54 |
And I click on "Back" "link" in the "#tagarea-core-course" "css_element"
|
|
|
55 |
And I should see "Courses" in the ".tag-index-items h3" "css_element"
|
|
|
56 |
And "#tagarea-core-user" "css_element" should not exist
|
|
|
57 |
And I should see "Course 7"
|
|
|
58 |
And I should see "Course 3"
|
|
|
59 |
And I should not see "Course 2"
|
|
|
60 |
And I should not see "Course 1"
|
|
|
61 |
And I follow "Show only tagged Courses"
|
|
|
62 |
And I should see "Courses tagged with \"Cat\""
|
|
|
63 |
And "#tagarea-core-user" "css_element" should not exist
|
|
|
64 |
And I should see "Course 7"
|
|
|
65 |
And I should see "Course 3"
|
|
|
66 |
And I should see "Course 2"
|
|
|
67 |
And I should see "Course 1"
|
|
|
68 |
And I follow "Back to all items tagged with \"Cat\""
|
|
|
69 |
And I should see "Courses" in the "#tagarea-core-course" "css_element"
|
|
|
70 |
And I should see "User interests" in the "#tagarea-core-user" "css_element"
|
|
|
71 |
And I should see "Course 7"
|
|
|
72 |
And I should see "Course 3"
|
|
|
73 |
And I should not see "Course2"
|
|
|
74 |
And I should not see "Course1"
|
|
|
75 |
And I log out
|
|
|
76 |
|
|
|
77 |
@javascript
|
|
|
78 |
Scenario: Browse tag index with javascript enabled
|
|
|
79 |
When I log in as "user1"
|
|
|
80 |
And I turn editing mode on
|
|
|
81 |
# TODO MDL-57120 "Tags" link not accessible without navigation block.
|
|
|
82 |
And I add the "Navigation" block if not present
|
|
|
83 |
And I click on "Site pages" "list_item" in the "Navigation" "block"
|
|
|
84 |
And I click on "Tags" "link" in the "Navigation" "block"
|
|
|
85 |
And I follow "Cat"
|
|
|
86 |
Then I should see "Courses" in the "#tagarea-core-course" "css_element"
|
|
|
87 |
And I should see "User interests" in the "#tagarea-core-user" "css_element"
|
|
|
88 |
And I should see "Course 7"
|
|
|
89 |
And I should see "Course 3"
|
|
|
90 |
And I should not see "Course 2"
|
|
|
91 |
And I should not see "Course 1"
|
|
|
92 |
And I click on "More" "link" in the "#tagarea-core-course" "css_element"
|
|
|
93 |
And I should see "Courses" in the "#tagarea-core-course" "css_element"
|
|
|
94 |
And I should see "User interests" in the "#tagarea-core-user" "css_element"
|
|
|
95 |
And I should not see "Course 7"
|
|
|
96 |
And I should not see "Course 3"
|
|
|
97 |
And I should see "Course 2"
|
|
|
98 |
And I should see "Course 1"
|
|
|
99 |
And I click on "Back" "link" in the "#tagarea-core-course" "css_element"
|
|
|
100 |
And I should see "Courses" in the "#tagarea-core-course" "css_element"
|
|
|
101 |
And I should see "User interests" in the "#tagarea-core-user" "css_element"
|
|
|
102 |
And I should see "Course 7"
|
|
|
103 |
And I should see "Course 3"
|
|
|
104 |
And I should not see "Course 2"
|
|
|
105 |
And I should not see "Course 1"
|
|
|
106 |
And I follow "Show only tagged Courses"
|
|
|
107 |
And I should see "Courses" in the "#tagarea-core-course" "css_element"
|
|
|
108 |
And "#tagarea-core-user" "css_element" should not exist
|
|
|
109 |
And I should see "Course 7"
|
|
|
110 |
And I should see "Course 3"
|
|
|
111 |
And I should see "Course 2"
|
|
|
112 |
And I should see "Course 1"
|
|
|
113 |
And I follow "Back to all items tagged with \"Cat\""
|
|
|
114 |
And I should see "Courses" in the "#tagarea-core-course" "css_element"
|
|
|
115 |
And I should see "User interests" in the "#tagarea-core-user" "css_element"
|
|
|
116 |
And I should see "Course 7"
|
|
|
117 |
And I should see "Course 3"
|
|
|
118 |
And I should not see "Course2"
|
|
|
119 |
And I should not see "Course1"
|
|
|
120 |
And I log out
|
1441 |
ariadna |
121 |
|
|
|
122 |
Scenario Outline: Browse tag index and view other profiles
|
|
|
123 |
Given I log in as "user1"
|
|
|
124 |
And I turn editing mode on
|
|
|
125 |
And the following "permission overrides" exist:
|
|
|
126 |
| capability | permission | role | contextlevel | reference |
|
|
|
127 |
| moodle/user:viewdetails | <permission> | user | System | |
|
|
|
128 |
# TODO MDL-57120 "Tags" link not accessible without navigation block.
|
|
|
129 |
And I add the "Navigation" block if not present
|
|
|
130 |
When I click on "Tags" "link" in the "Navigation" "block"
|
|
|
131 |
And I follow "Zebra"
|
|
|
132 |
Then I should <action1> "User 2"
|
|
|
133 |
And I should <action1> "User 3"
|
|
|
134 |
And I should <action1> "User 4"
|
|
|
135 |
And I should <action1> "User 5"
|
|
|
136 |
# Pagination test.
|
|
|
137 |
And I should <action2> "More" in the "#tagarea-core-user" "css_element"
|
|
|
138 |
|
|
|
139 |
Examples:
|
|
|
140 |
| permission | action1 | action2 |
|
|
|
141 |
| Prevent | not see | not see |
|
|
|
142 |
| Allow | see | see |
|