diff options
Diffstat (limited to 'build/integration/features/avatar.feature')
-rw-r--r-- | build/integration/features/avatar.feature | 92 |
1 files changed, 63 insertions, 29 deletions
diff --git a/build/integration/features/avatar.feature b/build/integration/features/avatar.feature index f7926615c01..4c8c37fb98c 100644 --- a/build/integration/features/avatar.feature +++ b/build/integration/features/avatar.feature @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later Feature: avatar Background: @@ -8,7 +10,7 @@ Feature: avatar Then The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 0 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is not a single color Scenario: get default user avatar as an anonymous user @@ -16,37 +18,69 @@ Feature: avatar Then The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 0 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is not a single color - Scenario: get temporary user avatar before cropping it + Scenario: get temporary non-square user avatar before cropping it Given Logging in using web as "user0" - And logged in user posts temporary avatar from file "data/green-square-256.png" + And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png" When logged in user gets temporary avatar Then The following headers should be set | Content-Type | image/png | # "last avatar" also includes the last temporary avatar - And last avatar is a square of size 256 - And last avatar is a single "#00FF00" color + And last avatar is not a square + And last avatar is not a single color - Scenario: get user avatar before cropping it + Scenario: get non-square user avatar before cropping it Given Logging in using web as "user0" - And logged in user posts temporary avatar from file "data/green-square-256.png" - # Avatar needs to be cropped to finish setting it even if it is squared + And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png" + # Avatar needs to be cropped to finish setting it When user "user0" gets avatar for user "user0" Then The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 0 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is not a single color + Scenario: set square user avatar from file + Given Logging in using web as "user0" + When logged in user posts temporary avatar from file "data/green-square-256.png" + And user "user0" gets avatar for user "user0" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + # Last avatar size is 512 by default when getting avatar without size parameter + And last avatar is a square of size 512 + And last avatar is a single "#00FF00" color + And user "anonymous" gets avatar for user "user0" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 512 + And last avatar is a single "#00FF00" color + Scenario: set square user avatar from internal path + Given user "user0" uploads file "data/green-square-256.png" to "/internal-green-square-256.png" + And Logging in using web as "user0" + When logged in user posts temporary avatar from internal path "internal-green-square-256.png" + And user "user0" gets avatar for user "user0" with size "64" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 64 + And last avatar is a single "#00FF00" color + And user "anonymous" gets avatar for user "user0" with size "64" + And The following headers should be set + | Content-Type | image/png | + | X-NC-IsCustomAvatar | 1 | + And last avatar is a square of size 64 + And last avatar is a single "#00FF00" color - Scenario: set user avatar from file + Scenario: set non-square user avatar from file Given Logging in using web as "user0" - When logged in user posts temporary avatar from file "data/coloured-pattern.png" + When logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png" And logged in user crops temporary avatar | x | 384 | | y | 256 | @@ -57,19 +91,19 @@ Feature: avatar And The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 1 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is a single "#FF0000" color And user "anonymous" gets avatar for user "user0" And The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 1 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is a single "#FF0000" color - Scenario: set user avatar from internal path - Given user "user0" uploads file "data/coloured-pattern.png" to "/internal-coloured-pattern.png" + Scenario: set non-square user avatar from internal path + Given user "user0" uploads file "data/coloured-pattern-non-square.png" to "/internal-coloured-pattern-non-square.png" And Logging in using web as "user0" - When logged in user posts temporary avatar from internal path "internal-coloured-pattern.png" + When logged in user posts temporary avatar from internal path "internal-coloured-pattern-non-square.png" And logged in user crops temporary avatar | x | 704 | | y | 320 | @@ -91,7 +125,7 @@ Feature: avatar Scenario: cropped user avatar needs to be squared Given Logging in using web as "user0" - And logged in user posts temporary avatar from file "data/coloured-pattern.png" + And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png" When logged in user crops temporary avatar with 400 | x | 384 | | y | 256 | @@ -102,7 +136,7 @@ Feature: avatar Scenario: delete user avatar Given Logging in using web as "user0" - And logged in user posts temporary avatar from file "data/coloured-pattern.png" + And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png" And logged in user crops temporary avatar | x | 384 | | y | 256 | @@ -112,33 +146,33 @@ Feature: avatar And The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 1 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is a single "#FF0000" color And user "anonymous" gets avatar for user "user0" And The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 1 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is a single "#FF0000" color When logged in user deletes the user avatar Then user "user0" gets avatar for user "user0" And The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 0 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is not a single color And user "anonymous" gets avatar for user "user0" And The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 0 | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is not a single color Scenario: get user avatar with a larger size than the original one Given Logging in using web as "user0" - And logged in user posts temporary avatar from file "data/coloured-pattern.png" + And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png" And logged in user crops temporary avatar | x | 384 | | y | 256 | @@ -148,12 +182,12 @@ Feature: avatar Then The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 1 | - And last avatar is a square of size 192 + And last avatar is a square of size 512 And last avatar is a single "#FF0000" color Scenario: get user avatar with a smaller size than the original one Given Logging in using web as "user0" - And logged in user posts temporary avatar from file "data/coloured-pattern.png" + And logged in user posts temporary avatar from file "data/coloured-pattern-non-square.png" And logged in user crops temporary avatar | x | 384 | | y | 256 | @@ -163,7 +197,7 @@ Feature: avatar Then The following headers should be set | Content-Type | image/png | | X-NC-IsCustomAvatar | 1 | - And last avatar is a square of size 96 + And last avatar is a square of size 512 And last avatar is a single "#FF0000" color @@ -172,12 +206,12 @@ Feature: avatar When user "user0" gets avatar for guest "guest0" Then The following headers should be set | Content-Type | image/png | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is not a single color Scenario: get default guest avatar as an anonymous user When user "anonymous" gets avatar for guest "guest0" Then The following headers should be set | Content-Type | image/png | - And last avatar is a square of size 128 + And last avatar is a square of size 512 And last avatar is not a single color |