@@ -21,9 +21,32 @@ Feature: avatar
2121 And last avatar is a square of size 512
2222 And last avatar is not a single color
2323
24+
25+
26+ Scenario : get temporary non-square user avatar before cropping it
27+ Given Logging in using web as "user0"
28+ And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png"
29+ When logged in user gets temporary avatar
30+ Then The following headers should be set
31+ | Content -Type | image /png |
32+ # "last avatar" also includes the last temporary avatar
33+ And last avatar is not a square
34+ And last avatar is not a single color
35+
36+ Scenario : get non-square user avatar before cropping it
37+ Given Logging in using web as "user0"
38+ And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png"
39+ # Avatar needs to be cropped to finish setting it
40+ When user "user0" gets avatar for user "user0"
41+ Then The following headers should be set
42+ | Content -Type | image /png |
43+ | X -NC -IsCustomAvatar | 0 |
44+ And last avatar is a square of size 512
45+ And last avatar is not a single color
46+
2447 Scenario : set square user avatar from file
2548 Given Logging in using web as "user0"
26- When logged in user posts avatar from file "data/green-square-256.png"
49+ When logged in user posts temporary avatar from file "data/green-square-256.png"
2750 And user "user0" gets avatar for user "user0"
2851 And The following headers should be set
2952 | Content -Type | image /png |
@@ -41,7 +64,7 @@ Feature: avatar
4164 Scenario : set square user avatar from internal path
4265 Given user "user0" uploads file "data/green-square-256.png" to "/internal-green-square-256.png"
4366 And Logging in using web as "user0"
44- When logged in user posts avatar from internal path "internal-green-square-256.png"
67+ When logged in user posts temporary avatar from internal path "internal-green-square-256.png"
4568 And user "user0" gets avatar for user "user0" with size "64"
4669 And The following headers should be set
4770 | Content -Type | image /png |
@@ -55,21 +78,82 @@ Feature: avatar
5578 And last avatar is a square of size 64
5679 And last avatar is a single "#00FF00" color
5780
58- Scenario : delete user avatar
81+ Scenario : set non-square user avatar from file
5982 Given Logging in using web as "user0"
60- And logged in user posts avatar from file "data/green-square-256.png"
83+ When logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png"
84+ And logged in user crops temporary avatar
85+ | x | 384 |
86+ | y | 256 |
87+ | w | 128 |
88+ | h | 128 |
89+ Then logged in user gets temporary avatar with 404
6190 And user "user0" gets avatar for user "user0"
6291 And The following headers should be set
6392 | Content -Type | image /png |
6493 | X -NC -IsCustomAvatar | 1 |
6594 And last avatar is a square of size 512
66- And last avatar is a single "#00FF00 " color
95+ And last avatar is a single "#FF0000 " color
6796 And user "anonymous" gets avatar for user "user0"
6897 And The following headers should be set
6998 | Content -Type | image /png |
7099 | X -NC -IsCustomAvatar | 1 |
71100 And last avatar is a square of size 512
101+ And last avatar is a single "#FF0000" color
102+
103+ Scenario : set non-square user avatar from internal path
104+ Given user "user0" uploads file "data/coloured-pattern-non-square.png" to "/internal-coloured-pattern-non-square.png"
105+ And Logging in using web as "user0"
106+ When logged in user posts temporary avatar from internal path "internal-coloured-pattern-non-square.png"
107+ And logged in user crops temporary avatar
108+ | x | 704 |
109+ | y | 320 |
110+ | w | 64 |
111+ | h | 64 |
112+ Then logged in user gets temporary avatar with 404
113+ And user "user0" gets avatar for user "user0" with size "64"
114+ And The following headers should be set
115+ | Content -Type | image /png |
116+ | X -NC -IsCustomAvatar | 1 |
117+ And last avatar is a square of size 64
72118 And last avatar is a single "#00FF00" color
119+ And user "anonymous" gets avatar for user "user0" with size "64"
120+ And The following headers should be set
121+ | Content -Type | image /png |
122+ | X -NC -IsCustomAvatar | 1 |
123+ And last avatar is a square of size 64
124+ And last avatar is a single "#00FF00" color
125+
126+ Scenario : cropped user avatar needs to be squared
127+ Given Logging in using web as "user0"
128+ And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png"
129+ When logged in user crops temporary avatar with 400
130+ | x | 384 |
131+ | y | 256 |
132+ | w | 192 |
133+ | h | 128 |
134+
135+
136+
137+ Scenario : delete user avatar
138+ Given Logging in using web as "user0"
139+ And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png"
140+ And logged in user crops temporary avatar
141+ | x | 384 |
142+ | y | 256 |
143+ | w | 128 |
144+ | h | 128 |
145+ And user "user0" gets avatar for user "user0"
146+ And The following headers should be set
147+ | Content -Type | image /png |
148+ | X -NC -IsCustomAvatar | 1 |
149+ And last avatar is a square of size 512
150+ And last avatar is a single "#FF0000" color
151+ And user "anonymous" gets avatar for user "user0"
152+ And The following headers should be set
153+ | Content -Type | image /png |
154+ | X -NC -IsCustomAvatar | 1 |
155+ And last avatar is a square of size 512
156+ And last avatar is a single "#FF0000" color
73157 When logged in user deletes the user avatar
74158 Then user "user0" gets avatar for user "user0"
75159 And The following headers should be set
@@ -84,6 +168,40 @@ Feature: avatar
84168 And last avatar is a square of size 512
85169 And last avatar is not a single color
86170
171+
172+
173+ Scenario : get user avatar with a larger size than the original one
174+ Given Logging in using web as "user0"
175+ And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png"
176+ And logged in user crops temporary avatar
177+ | x | 384 |
178+ | y | 256 |
179+ | w | 128 |
180+ | h | 128 |
181+ When user "user0" gets avatar for user "user0" with size "192"
182+ Then The following headers should be set
183+ | Content -Type | image /png |
184+ | X -NC -IsCustomAvatar | 1 |
185+ And last avatar is a square of size 512
186+ And last avatar is a single "#FF0000" color
187+
188+ Scenario : get user avatar with a smaller size than the original one
189+ Given Logging in using web as "user0"
190+ And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png"
191+ And logged in user crops temporary avatar
192+ | x | 384 |
193+ | y | 256 |
194+ | w | 128 |
195+ | h | 128 |
196+ When user "user0" gets avatar for user "user0" with size "96"
197+ Then The following headers should be set
198+ | Content -Type | image /png |
199+ | X -NC -IsCustomAvatar | 1 |
200+ And last avatar is a square of size 512
201+ And last avatar is a single "#FF0000" color
202+
203+
204+
87205 Scenario : get default guest avatar
88206 When user "user0" gets avatar for guest "guest0"
89207 Then The following headers should be set
0 commit comments