mirrored from git://git.moodle.org/moodle.git
/
tour_filter.feature
179 lines (173 loc) · 7.42 KB
/
tour_filter.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
@tool @tool_usertours
Feature: Apply tour filters to a tour
In order to give more directed tours
As an administrator
I need to create a user tour with filters applied
@javascript
Scenario: Add a tour for a different theme
Given I log in as "admin"
And I add a new user tour with:
| Name | First tour |
| Description | My first tour |
| Apply to URL match | /my/% |
| Tour is enabled | 1 |
| Theme | More |
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
When I am on homepage
Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
@javascript
Scenario: Add a tour for a specific role
Given the following "courses" exist:
| fullname | shortname | format | enablecompletion |
| Course 1 | C1 | topics | 1 |
And the following "users" exist:
| username |
| editor1 |
| teacher1 |
| student1 |
And the following "course enrolments" exist:
| user | course | role |
| editor1 | C1 | editingteacher |
| teacher1 | C1 | teacher |
| student1 | C1 | student |
And I log in as "admin"
And I add a new user tour with:
| Name | First tour |
| Description | My first tour |
| Apply to URL match | /course/view.php% |
| Tour is enabled | 1 |
| Role | Student,Non-editing teacher |
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your course tour.|
And I log out
And I log in as "editor1"
When I am on "Course 1" course homepage
Then I should not see "Welcome to your course tour."
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "Welcome to your course tour."
And I click on "End tour" "button"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I should see "Welcome to your course tour."
@javascript
Scenario: Add tour for a specific category and its subcategory
Given the following "categories" exist:
| name | category | idnumber |
| MainCat | 0 | CAT1 |
| SubCat | CAT1 | CAT2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | CAT1 |
| Course 2 | C2 | CAT2 |
And the following "users" exist:
| username |
| student1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
And I log in as "admin"
And I add a new user tour with:
| Name | First tour |
| Description | My first tour |
| Apply to URL match | /course/view.php% |
| Tour is enabled | 1 |
| Category | MainCat |
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your course tour.|
And I log out
And I log in as "student1"
When I am on "Course 1" course homepage
And I wait until the page is ready
Then I should see "Welcome to your course tour."
When I am on "Course 2" course homepage
And I wait until the page is ready
Then I should see "Welcome to your course tour."
@javascript
Scenario: Add tour for a specific courseformat
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
| Course 2 | C2 | weeks |
And the following "users" exist:
| username |
| student1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
And I log in as "admin"
And I add a new user tour with:
| Name | First tour |
| Description | My first tour |
| Apply to URL match | /course/view.php% |
| Tour is enabled | 1 |
| Course format | Weekly format |
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your course tour.|
And I log out
And I log in as "student1"
When I am on "Course 1" course homepage
And I wait until the page is ready
Then I should not see "Welcome to your course tour."
When I am on "Course 2" course homepage
And I wait until the page is ready
Then I should see "Welcome to your course tour."
@javascript
Scenario: Add tour for a specific course
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
| Course 2 | C2 | weeks |
And the following "users" exist:
| username |
| student1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
And I log in as "admin"
And I add a new user tour with:
| Name | First tour |
| Description | My first tour |
| Apply to URL match | /course/view.php% |
| Tour is enabled | 1 |
| Courses | C1 |
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your course tour.|
And I log out
And I log in as "student1"
When I am on "Course 1" course homepage
And I wait until the page is ready
Then I should see "Welcome to your course tour."
When I am on "Course 2" course homepage
And I wait until the page is ready
Then I should not see "Welcome to your course tour."
@javascript
Scenario: Aria tags should not exist
Given I log in as "admin"
And I open the User tour settings page
# Turn on default tour for boost theme.
And I click on "Enable" "link" in the "Boost - administrator" "table_row"
And I am on site homepage
When I click on "Next" "button"
Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist
And "button[tabindex]" "css_element" should exist
When I click on "Next" "button"
Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist
And "button[tabindex]" "css_element" should not exist
When I click on "Previous" "button"
Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist
And "button[tabindex]" "css_element" should exist
When I click on "End tour" "button"
Then "button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist
And "button[tabindex]" "css_element" should not exist