2 Feature: Browsing tagged items
3 In order to search by tag
5 I need to be able to browse tagged items
8 Given the following "users" exist:
9 | username | firstname | lastname | email | interests |
10 | user1 | User | 1 | user1@example.com | Cat |
11 | user2 | User | 2 | user1@example.com | Cat, Dog |
12 | user3 | User | 3 | user1@example.com | Dog |
13 And the following "courses" exist:
14 | fullname | shortname | tags |
15 | Course 1 | c1 | Cat, Dog |
16 | Course 2 | c2 | Cat |
17 | Course 3 | c3 | Cat |
18 | Course 4 | c4 | Cat |
19 | Course 5 | c5 | Cat |
20 | Course 6 | c6 | Cat |
21 | Course 7 | c7 | Cat |
23 Scenario: Browse tag index with javascript disabled
24 When I log in as "user1"
25 And I press "Customise this page"
26 # TODO MDL-57120 "Tags" link not accessible without navigation block.
27 And I add the "Navigation" block if not present
28 And I click on "Tags" "link" in the "Navigation" "block"
30 Then I should see "Courses" in the ".tag-index-items h3" "css_element"
31 And I should see "User 1" in the "#tagarea-core-user" "css_element"
32 And I should see "Course 7"
33 And I should see "Course 3"
34 And I should not see "Course 2"
35 And I should not see "Course 1"
36 And I should see "User 1" in the "#tagarea-core-user" "css_element"
37 And I should see "User 2"
38 And I should not see "User 3"
39 And I click on "More" "link" in the "#tagarea-core-course" "css_element"
40 And I should see "Courses" in the "#tagarea-core-course" "css_element"
41 And "#tagarea-core-user" "css_element" should not exist
42 And I should not see "Course 7"
43 And I should not see "Course 3"
44 And I should see "Course 2"
45 And I should see "Course 1"
46 And I click on "Back" "link" in the "#tagarea-core-course" "css_element"
47 And I should see "Courses" in the ".tag-index-items h3" "css_element"
48 And "#tagarea-core-user" "css_element" should not exist
49 And I should see "Course 7"
50 And I should see "Course 3"
51 And I should not see "Course 2"
52 And I should not see "Course 1"
53 And I follow "Show only tagged Courses"
54 And I should see "Courses tagged with \"Cat\""
55 And "#tagarea-core-user" "css_element" should not exist
56 And I should see "Course 7"
57 And I should see "Course 3"
58 And I should see "Course 2"
59 And I should see "Course 1"
60 And I follow "Back to all items tagged with \"Cat\""
61 And I should see "Courses" in the "#tagarea-core-course" "css_element"
62 And I should see "User interests" in the "#tagarea-core-user" "css_element"
63 And I should see "Course 7"
64 And I should see "Course 3"
65 And I should not see "Course2"
66 And I should not see "Course1"
70 Scenario: Browse tag index with javascript enabled
71 When I log in as "user1"
72 And I press "Customise this page"
73 # TODO MDL-57120 "Tags" link not accessible without navigation block.
74 And I add the "Navigation" block if not present
75 And I click on "Site pages" "list_item" in the "Navigation" "block"
76 And I click on "Tags" "link" in the "Navigation" "block"
78 Then I should see "Courses" in the "#tagarea-core-course" "css_element"
79 And I should see "User interests" in the "#tagarea-core-user" "css_element"
80 And I should see "Course 7"
81 And I should see "Course 3"
82 And I should not see "Course 2"
83 And I should not see "Course 1"
84 And I click on "More" "link" in the "#tagarea-core-course" "css_element"
85 And I should see "Courses" in the "#tagarea-core-course" "css_element"
86 And I should see "User interests" in the "#tagarea-core-user" "css_element"
87 And I should not see "Course 7"
88 And I should not see "Course 3"
89 And I should see "Course 2"
90 And I should see "Course 1"
91 And I click on "Back" "link" in the "#tagarea-core-course" "css_element"
92 And I should see "Courses" in the "#tagarea-core-course" "css_element"
93 And I should see "User interests" in the "#tagarea-core-user" "css_element"
94 And I should see "Course 7"
95 And I should see "Course 3"
96 And I should not see "Course 2"
97 And I should not see "Course 1"
98 And I follow "Show only tagged Courses"
99 And I should see "Courses" in the "#tagarea-core-course" "css_element"
100 And "#tagarea-core-user" "css_element" should not exist
101 And I should see "Course 7"
102 And I should see "Course 3"
103 And I should see "Course 2"
104 And I should see "Course 1"
105 And I follow "Back to all items tagged with \"Cat\""
106 And I should see "Courses" in the "#tagarea-core-course" "css_element"
107 And I should see "User interests" in the "#tagarea-core-user" "css_element"
108 And I should see "Course 7"
109 And I should see "Course 3"
110 And I should not see "Course2"
111 And I should not see "Course1"