Skip to content

Commit

Permalink
update api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed May 15, 2020
1 parent 1e5e612 commit b230ec6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 111 deletions.
2 changes: 1 addition & 1 deletion tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Feature: auth
| /ocs/v1.php/cloud/users | 403 | 200 |
| /ocs/v2.php/cloud/users | 403 | 403 |
| /ocs/v1.php/config | 100 | 200 |
| /ocs/v2.php/config | 100 | 200 |
| /ocs/v2.php/config | 200 | 200 |
| /ocs/v1.php/privatedata/getattribute | 998 | 200 |
| /ocs/v2.php/privatedata/getattribute | 998 | 404 |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Feature: cannot share resources with invalid permissions
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 100 | 200 |
| 2 | 100 | 200 |
| 2 | 200 | 200 |

@skipOnOcis @issue-ocis-reva-45 @issue-ocis-reva-64
Scenario Outline: Cannot create a share of a file with a user with only (create,delete) permission
Expand Down Expand Up @@ -98,9 +98,9 @@ Feature: cannot share resources with invalid permissions
Examples:
| ocs_api_version | ocs_status_code | http_status_code | permissions |
| 1 | 100 | 200 | delete |
| 2 | 100 | 200 | delete |
| 2 | 200 | 200 | delete |
| 1 | 100 | 200 | create,delete |
| 2 | 100 | 200 | create,delete |
| 2 | 200 | 200 | create,delete |

@skipOnOcis @issue-ocis-reva-34
Scenario Outline: Cannot create a share of a file with a group with only create permission
Expand Down
106 changes: 0 additions & 106 deletions tests/acceptance/features/apiShareManagementBasic/createShare.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ Feature: sharing
| 1 | 100 |
| 2 | 200 |

@skipOnOcis
@issue-ocis-reva-20
@issue-ocis-reva-26
@issue-ocis-reva-43
@issue-ocis-reva-44
@issue-ocis-reva-64
Scenario Outline: Creating a share of a file with a user and asking for various permission combinations
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created with default attributes and without skeleton files
Expand Down Expand Up @@ -71,35 +65,6 @@ Feature: sharing
| 1 | 2 | 2 | 100 |
| 2 | 2 | 2 | 200 |

@skipOnOcV10
@issue-ocis-reva-20
@issue-ocis-reva-26
@issue-ocis-reva-43
@issue-ocis-reva-44
@issue-ocis-reva-64
#after fixing all issues delete this Scenario and use the one above
Scenario Outline: Creating a share of a file with a user and asking for various permission combinations
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created with default attributes and without skeleton files
When user "user0" shares file "textfile0.txt" with user "user1" with permissions <requested_permissions> using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the OCS status message should be "OK"
Examples:
| ocs_api_version | requested_permissions | granted_permissions | ocs_status_code |
# Ask for full permissions. You get share plus read plus update. create and delete do not apply to shares of a file
| 1 | 31 | 31 | 100 |
| 2 | 31 | 31 | 100 |
# Ask for read, share (17), create and delete. You get share plus read
| 1 | 29 | 31 | 100 |
| 2 | 29 | 31 | 100 |
# Ask for read, update, create, delete. You get read plus update.
| 1 | 15 | 15 | 100 |
| 2 | 15 | 15 | 100 |
# Ask for just update. You get exactly update (you do not get read or anything else)
| 1 | 2 | 2 | 100 |
| 2 | 2 | 2 | 100 |

Scenario Outline: Creating a share of a file with no permissions should fail
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created with default attributes and without skeleton files
Expand All @@ -113,51 +78,6 @@ Feature: sharing
| 1 | 200 |
| 2 | 400 |

@skipOnOcV10
@issue-ocis-reva-64
#after fixing all issues delete this Scenario or adjust it, so that it works also with oC10
Scenario Outline: more tests to demonstrate different ocis-reva issue 64 behaviours
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created with default attributes and without skeleton files
And user "user0" has uploaded file with content "user0 file" to "randomfile.txt"
When user "user0" shares file "/randomfile.txt" with user "user1" using the sharing API
Then the OCS status code should be "100"
And the OCS status message should be "OK"
And the HTTP status code should be "<http_status_code>"
And as "user1" file "randomfile.txt" should not exist
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 200 |

@skipOnOcV10
@issue-ocis-reva-64
#after fixing all issues delete this Scenario or adjust it, so that it works also with oC10
Scenario Outline: more tests to demonstrate different ocis-reva issue 64 behaviours
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created with default attributes and without skeleton files
When user "user0" shares file "/doesNotExist/randomfile.txt" with user "user1" using the sharing API
And the HTTP status code should be "<http_status_code>"
And as "user1" file "randomfile.txt" should not exist
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |

@skipOnOcV10
@issue-ocis-reva-64
#after fixing all issues delete this Scenario or adjust it, so that it works also with oC10
Scenario Outline: more tests to demonstrate different ocis-reva issue 64 behaviours
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created with default attributes and without skeleton files
When user "user0" shares file "/NotExistingFile.txt" with user "user1" using the sharing API
And the HTTP status code should be "<http_status_code>"
And as "user1" file "randomfile.txt" should not exist
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |

@skipOnOcis
@issue-ocis-reva-64
#OCIS returns an empty response when sharing with a file inside the /home folder
Expand Down Expand Up @@ -189,12 +109,6 @@ Feature: sharing
| 1 | 200 |
| 2 | 400 |

@skipOnOcis
@issue-ocis-reva-20
@issue-ocis-reva-26
@issue-ocis-reva-43
@issue-ocis-reva-46
@issue-ocis-reva-64
Scenario Outline: Creating a share of a folder with a user, the default permissions are all permissions(31)
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created with default attributes and without skeleton files
Expand All @@ -219,26 +133,6 @@ Feature: sharing
| 1 | 100 |
| 2 | 200 |

@skipOnOcV10
@issue-ocis-reva-20
@issue-ocis-reva-26
@issue-ocis-reva-43
@issue-ocis-reva-46
@issue-ocis-reva-64
#after fixing all issues delete this Scenario and use the one above
Scenario Outline: Creating a share of a folder with a user, the default permissions are all permissions(31)
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created with default attributes and without skeleton files
And user "user0" has created folder "/FOLDER"
When user "user0" shares folder "/FOLDER" with user "user1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the OCS status message should be "OK"
And the HTTP status code should be "200"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 100 |

@skipOnOcis @issue-ocis-reva-34
Scenario Outline: Creating a share of a file with a group, the default permissions are read(1)+update(2)+can-share(16)
Given using OCS API version "<ocs_api_version>"
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/apiVersions/fileVersions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Feature: dav-versions
And user "user0" uploads file "filesForUpload/davtest.txt" asynchronously to "/davtest.txt" in 3 chunks with new chunking and using the WebDAV API
Then the version folder of file "/davtest.txt" for user "user0" should contain "1" element

@smokeTest @issue-ocis-reva-94
@smokeTest
Scenario: Remove a file
Given user "user0" has uploaded file "filesForUpload/davtest.txt" to "/davtest.txt"
And user "user0" has uploaded file "filesForUpload/davtest.txt" to "/davtest.txt"
Expand Down

0 comments on commit b230ec6

Please sign in to comment.