Skip to content

Commit

Permalink
some fixes to make tests pass with ocis pr 409
Browse files Browse the repository at this point in the history
  • Loading branch information
individual-it committed Jul 30, 2020
1 parent 4bc7efe commit f8659a4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 11 deletions.
40 changes: 36 additions & 4 deletions tests/acceptance/features/apiAuthOcs/ocsDELETEAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,43 @@ Feature: auth
| /ocs/v2.php/cloud/apps/testing |
| /ocs/v1.php/cloud/groups/group1 |
| /ocs/v2.php/cloud/groups/group1 |
Then the HTTP status code of responses on all endpoints should be "401"
And the OCS status code of responses on all endpoints should be "notset"

@smokeTest @skipOnOcV10 @issue-ocis-ocs-26
#after fixing all issues delete this Scenario and use the one above
Scenario: send DELETE requests to OCS endpoints as admin with wrong password
When the administrator requests these endpoints with "DELETE" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v1.php/cloud/users/%username% |
| /ocs/v2.php/cloud/users/%username% |
| /ocs/v1.php/cloud/users/%username%/subadmins |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "998"

@smokeTest @skipOnOcV10 @issue-ocis-ocs-26
#after fixing all issues delete this Scenario and use the one above
Scenario: send DELETE requests to OCS endpoints as admin with wrong password
When the administrator requests these endpoints with "DELETE" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v1.php/cloud/users/%username%/groups |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "996"

@smokeTest @skipOnOcV10 @issue-ocis-ocs-26
#after fixing all issues delete this Scenario and use the one above
Scenario: send DELETE requests to OCS endpoints as admin with wrong password
When the administrator requests these endpoints with "DELETE" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v2.php/cloud/users/%username%/groups |
| /ocs/v1.php/cloud/users/%username%/subadmins |
Then the HTTP status code of responses on all endpoints should be "500"
And the OCS status code of responses on all endpoints should be "996"

@smokeTest @skipOnOcV10 @issue-ocis-ocs-26
#after fixing all issues delete this Scenario and use the one above
Scenario: send DELETE requests to OCS endpoints as admin with wrong password
When the administrator requests these endpoints with "DELETE" using password "invalid" about user "Alice"
| endpoint |
| /ocs/v2.php/cloud/users/%username% |
| /ocs/v2.php/cloud/users/%username%/subadmins |
Then the HTTP status code of responses on all endpoints should be "401"
And the OCS status code of responses on all endpoints should be "notset"
Then the HTTP status code of responses on all endpoints should be "404"
And the OCS status code of responses on all endpoints should be "998"
24 changes: 19 additions & 5 deletions tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,29 @@ Feature: auth
| /ocs/v2.php/cloud/apps |
| /ocs/v1.php/cloud/groups |
| /ocs/v2.php/cloud/groups |
| /ocs/v1.php/cloud/users |
| /ocs/v2.php/cloud/users |
| /ocs/v1.php/config |
| /ocs/v2.php/config |
| /ocs/v1.php/privatedata/getattribute |
| /ocs/v2.php/privatedata/getattribute |
Then the HTTP status code of responses on all endpoints should be "401"
And the OCS status code of responses on all endpoints should be "notset"

@skipOnOcV10
@issue-ocis-ocs-26
@smokeTest
#after fixing all issues delete this Scenario and use the one above
Scenario: using OCS anonymously
When a user requests these endpoints with "GET" and no authentication
| endpoint |
| /ocs/v1.php/cloud/users |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "100"
When a user requests these endpoints with "GET" and no authentication
| endpoint |
| /ocs/v2.php/cloud/users |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "200"

@issue-32068 @skipOnOcis
@issue-ocis-reva-11
@issue-ocis-reva-30
Expand Down Expand Up @@ -153,12 +167,12 @@ Feature: auth
| endpoint |
| /ocs/v1.php/cloud/users |
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "403"
And the OCS status code of responses on all endpoints should be "100"
When the user "Alice" requests these endpoints with "GET" with basic auth
| endpoint |
| /ocs/v2.php/cloud/users |
Then the HTTP status code of responses on all endpoints should be "403"
And the OCS status code of responses on all endpoints should be "403"
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "200"
When the user "Alice" requests these endpoints with "GET" with basic auth
| endpoint |
| /ocs/v2.php/config |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ Feature: sharing
# And folder "/folder1/folder2" should be included as path in the response
Examples:
| ocs_api_version | http_status_code | ocs_status_code |
| 1 | 200 | 996 |
| 2 | 500 | 996 |
| 1 | 200 | 100 |
| 2 | 200 | 200 |

@skipOnOcis @issue-ocis-reva-14 @issue-ocis-reva-243
Scenario Outline: user shares a file with file name longer than 64 chars to another user
Expand Down

0 comments on commit f8659a4

Please sign in to comment.