aboutsummaryrefslogtreecommitdiffstats
path: root/build/integration/collaboration_features
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-03-10 11:54:43 +0100
committerJoas Schilling <coding@schilljs.com>2021-03-10 17:19:56 +0100
commita310a2adc7d82fc12ef13d654753e8a599e6d8a7 (patch)
treed90dde8224e73fdd94fc0c48e7b504d0c41e1d9f /build/integration/collaboration_features
parent236aa194e2704454aa0b21228773071e3223a719 (diff)
downloadnextcloud-server-a310a2adc7d82fc12ef13d654753e8a599e6d8a7.tar.gz
nextcloud-server-a310a2adc7d82fc12ef13d654753e8a599e6d8a7.zip
Add integration tests for autocomplete/get (similar to sharees API)
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'build/integration/collaboration_features')
-rw-r--r--build/integration/collaboration_features/autocomplete.feature175
1 files changed, 175 insertions, 0 deletions
diff --git a/build/integration/collaboration_features/autocomplete.feature b/build/integration/collaboration_features/autocomplete.feature
new file mode 100644
index 00000000000..0ca8ebbc100
--- /dev/null
+++ b/build/integration/collaboration_features/autocomplete.feature
@@ -0,0 +1,175 @@
+Feature: autocomplete
+ Background:
+ Given using api version "2"
+ And group "commongroup" exists
+ And user "admin" belongs to group "commongroup"
+ And user "autocomplete" exists
+ And user "autocomplete2" exists
+ And user "autocomplete2" belongs to group "commongroup"
+
+ Scenario: getting autocomplete
+ Given As an "admin"
+ When get autocomplete for "auto"
+ | id | source |
+ | autocomplete | users |
+ | autocomplete2 | users |
+
+
+ Scenario: getting autocomplete without enumeration
+ Given As an "admin"
+ When parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
+ Then get autocomplete for "auto"
+ | id | source |
+ Then get autocomplete for "autocomplete"
+ | id | source |
+ | autocomplete | users |
+
+
+ Scenario: getting autocomplete with limited enumeration by group
+ Given As an "admin"
+ When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
+ Then get autocomplete for "auto"
+ | id | source |
+ | autocomplete2 | users |
+ Then get autocomplete for "autocomplete"
+ | id | source |
+ | autocomplete | users |
+ | autocomplete2 | users |
+ Then get autocomplete for "autocomplete2"
+ | id | source |
+ | autocomplete2 | users |
+
+
+ Scenario: getting autocomplete with limited enumeration by phone
+ Given As an "admin"
+ When parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
+ Then get autocomplete for "auto"
+ | id | source |
+
+ # autocomplete stores their phone number
+ Given As an "autocomplete"
+ And sending "PUT" to "/cloud/users/autocomplete" with
+ | key | phone |
+ | value | +49 711 / 25 24 28-90 |
+ And the HTTP status code should be "200"
+ And the OCS status code should be "200"
+
+ Given As an "admin"
+ Then get autocomplete for "auto"
+ | id | source |
+
+ # admin populates they have the phone number
+ When search users by phone for region "DE" with
+ | random-string1 | 0711 / 252 428-90 |
+ Then get autocomplete for "auto"
+ | id | source |
+ | autocomplete | users |
+
+
+ Scenario: getting autocomplete with limited enumeration by group or phone
+ Given As an "admin"
+ When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
+ And parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
+
+ # autocomplete stores their phone number
+ Given As an "autocomplete"
+ And sending "PUT" to "/cloud/users/autocomplete" with
+ | key | phone |
+ | value | +49 711 / 25 24 28-90 |
+ And the HTTP status code should be "200"
+ And the OCS status code should be "200"
+ # admin populates they have the phone number
+ Given As an "admin"
+ When search users by phone for region "DE" with
+ | random-string1 | 0711 / 252 428-90 |
+
+ Then get autocomplete for "auto"
+ | id | source |
+ | autocomplete | users |
+ | autocomplete2 | users |
+
+
+ Scenario: getting autocomplete with limited enumeration but sharing is group restricted
+ Given As an "admin"
+ When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
+ And parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
+
+ # autocomplete stores their phone number
+ Given As an "autocomplete"
+ And sending "PUT" to "/cloud/users/autocomplete" with
+ | key | phone |
+ | value | +49 711 / 25 24 28-90 |
+ And the HTTP status code should be "200"
+ And the OCS status code should be "200"
+ # admin populates they have the phone number
+ Given As an "admin"
+ When search users by phone for region "DE" with
+ | random-string1 | 0711 / 252 428-90 |
+
+ Then get autocomplete for "auto"
+ | id | source |
+ | autocomplete | users |
+ | autocomplete2 | users |
+ When parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
+ Then get autocomplete for "auto"
+ | id | source |
+ | autocomplete2 | users |
+
+
+ Scenario: getting autocomplete with limited enumeration by phone but user changes it
+ Given As an "admin"
+ When parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
+ Then get autocomplete for "auto"
+ | id | source |
+
+ # autocomplete stores their phone number
+ Given As an "autocomplete"
+ And sending "PUT" to "/cloud/users/autocomplete" with
+ | key | phone |
+ | value | +49 711 / 25 24 28-90 |
+ And the HTTP status code should be "200"
+ And the OCS status code should be "200"
+
+ Given As an "admin"
+ Then get autocomplete for "auto"
+ | id | source |
+
+ # admin populates they have the phone number
+ When search users by phone for region "DE" with
+ | random-string1 | 0711 / 252 428-90 |
+ Then get autocomplete for "auto"
+ | id | source |
+ | autocomplete | users |
+
+ # autocomplete changes their phone number
+ Given As an "autocomplete"
+ And sending "PUT" to "/cloud/users/autocomplete" with
+ | key | phone |
+ | value | +49 711 / 25 24 28-91 |
+ And the HTTP status code should be "200"
+ And the OCS status code should be "200"
+
+ Given As an "admin"
+ Then get autocomplete for "auto"
+ | id | source |
+
+ # admin populates they have the new phone number
+ When search users by phone for region "DE" with
+ | random-string1 | 0711 / 252 428-91 |
+ Then get autocomplete for "auto"
+ | id | source |
+ | autocomplete | users |
+
+
+ Scenario: getting autocomplete without enumeration and sharing is group restricted
+ Given As an "admin"
+ When parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
+ And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
+
+ Then get autocomplete for "auto"
+ | id | source |
+ Then get autocomplete for "autocomplete"
+ | id | source |
+ Then get autocomplete for "autocomplete2"
+ | id | source |
+ | autocomplete2 | users |