reading.feature
8.7 KB
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
@kalibro_restart
Feature: Reading
As a Mezuro user
I want to create, edit and remove a reading
Background:
Given the following users
| login | name |
| joaosilva | Joao Silva |
And I am logged in as "joaosilva"
And "Mezuro" plugin is enabled
And I have a Mezuro reading group with the following data
| name | Sample Reading Group |
| description | Sample Description |
| user | joaosilva |
@selenium
Scenario: I want to see the Mezuro reading input form
Given I am on article "Sample Reading Group"
When I follow "Add Reading"
Then I should see "Sample Reading Group Reading Group" in a link
And I should see "Label"
And I should see "Grade"
And I should see "Color"
And I should see "Save" button
@selenium
Scenario: I try to add a reading with no name
Given I am on article "Sample Reading Group"
When I follow "Add Reading"
And I fill the fields with the new following data
| reading_label | |
| reading_grade | 10.2 |
| reading_color | ABCDEF |
And I press "Save"
Then I should see "Please fill all fields marked with (*)." inside an alert
@selenium
Scenario: I try to add a reading with no grade
Given I am on article "Sample Reading Group"
When I follow "Add Reading"
And I fill the fields with the new following data
| reading_label | Useless |
| reading_grade | |
| reading_color | f51313 |
And I press "Save"
Then I should see "Please fill all fields marked with (*)." inside an alert
@selenium
Scenario: I try to add a reading with no color
Given I am on article "Sample Reading Group"
When I follow "Add Reading"
And I fill the fields with the new following data
| reading_label | Fantastic |
| reading_grade | 4.0 |
| reading_color | |
And I press "Save"
Then I should see "Please fill all fields marked with (*)." inside an alert
@selenium
Scenario: I try to add a reading with an invalid color
Given I am on article "Sample Reading Group"
When I follow "Add Reading"
And I fill the fields with the new following data
| reading_label | Fantastic |
| reading_grade | 4.0 |
| reading_color | 1D10T4 |
And I press "Save"
Then I should see "This is not a valid color." inside an alert
@selenium
Scenario: I try to add a reading with a label which already exists
Given I have a Mezuro reading with the following data
| label | Simple |
| grade | 2.0 |
| color | 34afe2 |
And I am on article "Sample Reading Group"
When I follow "Add Reading"
And I fill the fields with the new following data
| reading_label | Simple |
| reading_grade | 4.0 |
| reading_color | 1f0fa0 |
And I press "Save"
Then I should see "This label already exists! Please, choose another one." inside an alert
@selenium
Scenario: I try to add a reading with a grade which already exists
Given I have a Mezuro reading with the following data
| label | Extraordinary |
| grade | 10.0 |
| color | b4bad0 |
And I am on article "Sample Reading Group"
When I follow "Add Reading"
And I fill the fields with the new following data
| reading_label | Super |
| reading_grade | 10.0 |
| reading_color | f0f000 |
And I press "Save"
Then I should see "This grade already exists! Please, choose another one." inside an alert
@selenium
Scenario: I want to add a reading with valid attributes
Given I am on article "Sample Reading Group"
When I follow "Add Reading"
And I fill the fields with the new following data
| reading_label | Normal |
| reading_grade | 1.0 |
| reading_color | 19cbd1 |
And I press "Save"
Then I should see "Normal"
And I should see "1.0"
And I should see the "#19cbd1" color
And I should see "Remove"
@selenium
Scenario: I want to see a reading edit form
Given I have a Mezuro reading with the following data
| label | Simple |
| grade | 2.0 |
| color | 34afe2 |
And I am on article "Sample Reading Group"
When I follow the edit link for "Simple" reading
Then I should see "Simple" in the "reading_label"
And I should see "2.0" in the "reading_grade"
And I should see "34afe2" in the "reading_color"
And I should see "Save" button
@selenium
Scenario: I try to edit a reading leaving empty its title
Given I have a Mezuro reading with the following data
| label | Simple |
| grade | 2.0 |
| color | 34afe2 |
And I am on article "Sample Reading Group"
When I follow the edit link for "Simple" reading
And I erase the "reading_label" field
And I press "Save"
Then I should see "Please fill all fields marked with (*)." inside an alert
@selenium
Scenario: I try to edit a reading leaving empty its grade
Given I have a Mezuro reading with the following data
| label | Simple |
| grade | 2.0 |
| color | 34afe2 |
And I am on article "Sample Reading Group"
When I follow the edit link for "Simple" reading
And I erase the "reading_grade" field
And I press "Save"
Then I should see "Please fill all fields marked with (*)." inside an alert
@selenium
Scenario: I try to edit a reading leaving empty its color
Given I have a Mezuro reading with the following data
| label | Simple |
| grade | 2.0 |
| color | 34afe2 |
And I am on article "Sample Reading Group"
When I follow the edit link for "Simple" reading
And I erase the "reading_color" field
And I press "Save"
Then I should see "Please fill all fields marked with (*)." inside an alert
@selenium
Scenario: I try to edit a reading with an invalid color
Given I have a Mezuro reading with the following data
| label | Worthless |
| grade | 1.0 |
| color | e5cad4 |
And I am on article "Sample Reading Group"
When I follow the edit link for "Worthless" reading
And I fill the fields with the new following data
| reading_label | Worthless |
| reading_grade | 1.0 |
| reading_color | bu5aoooooo |
And I press "Save"
Then I should see "This is not a valid color." inside an alert
@selenium
Scenario: I try to edit a reading with a label which already exists
Given I have a Mezuro reading with the following data
| label | Simple |
| grade | 2.0 |
| color | 34afe2 |
And I have a Mezuro reading with the following data
| label | Complex |
| grade | 5.0 |
| color | 13deb2 |
And I am on article "Sample Reading Group"
When I follow the edit link for "Simple" reading
And I fill the fields with the new following data
| reading_label | Complex |
| reading_grade | 2.0 |
| reading_color | 34afe2 |
And I press "Save"
Then I should see "This label already exists! Please, choose another one." inside an alert
@selenium
Scenario: I try to edit a reading with a grade which already exists
Given I have a Mezuro reading with the following data
| label | Terrible |
| grade | 0.0 |
| color | 4feda4 |
And I have a Mezuro reading with the following data
| label | Perfect |
| grade | 10.0 |
| color | de41b2 |
And I am on article "Sample Reading Group"
When I follow the edit link for "Terrible" reading
And I fill the fields with the new following data
| reading_label | Terrible |
| reading_grade | 10.0 |
| reading_color | 4feda4 |
And I press "Save"
Then I should see "This grade already exists! Please, choose another one." inside an alert
@selenium
Scenario: I want to edit a reading with valid attributes
Given I have a Mezuro reading with the following data
| label | Awful |
| grade | 2.5 |
| color | babaca |
And I am on article "Sample Reading Group"
When I follow the edit link for "Awful" reading
And I fill the fields with the new following data
| reading_label | Awesome |
| reading_grade | 10.0 |
| reading_color | fa40fa |
And I press "Save"
Then I should see "Awesome"
And I should see "10.0"
And I should see the "#fa40fa" color
@selenium
Scenario: I want to remove a reading
Given I have a Mezuro reading with the following data
| label | Unbelievable |
| grade | 9001.0 |
| color | f0f0ca |
And I am on article "Sample Reading Group"
When I follow the remove link for "Unbelievable" reading
Then I should not see "Unbelievable"
And I should not see "9001.0"