Skip to content

Commit

Permalink
improved then steps
Browse files Browse the repository at this point in the history
  • Loading branch information
sushmita56 committed Apr 27, 2022
1 parent 1e3adb2 commit e3e3d55
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Feature: shares are received in the default folder for received shares
And user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
And user "Brian" unshares folder "Shares/FOLDER" using the WebDAV API
And user "Brian" shares folder "/Shares" with user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
Then the OCS status code of responses on each endpoint should be "<ocs_status_code>" respectively
And the HTTP status code of responses on each endpoint should be "<http_status_code>" respectively
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 404 | 200 |
| 2 | 404 | 404 |
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 100, 100, 404 | 200, 200, 204, 200 |
| 2 | 200, 200, 404 | 200, 200,204, 404 |
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ Feature: sharing works when a username and group name are the same
And user "Alice" has shared file "randomfile.txt" with group "Brian"
And user "Carol" has accepted share "/randomfile.txt" offered by user "Alice"
When user "Alice" shares file "randomfile.txt" with user "Brian" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
When user "Brian" accepts share "/randomfile.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And user "Brian" accepts share "/randomfile.txt" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "100"
And the HTTP status code of responses on all endpoints should be "200"
And user "Brian" should see the following elements
| /Shares/randomfile.txt |
And user "Carol" should see the following elements
Expand All @@ -42,11 +40,9 @@ Feature: sharing works when a username and group name are the same
And user "Alice" has shared file "randomfile.txt" with user "Brian"
And user "Brian" has accepted share "/randomfile.txt" offered by user "Alice"
When user "Alice" shares file "randomfile.txt" with group "Brian" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
When user "Carol" accepts share "/randomfile.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And user "Carol" accepts share "/randomfile.txt" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "100"
And the HTTP status code of responses on all endpoints should be "200"
And user "Brian" should see the following elements
| /Shares/randomfile.txt |
And user "Carol" should see the following elements
Expand All @@ -66,11 +62,9 @@ Feature: sharing works when a username and group name are the same
And user "Alice" has shared file "randomfile.txt" with group "brian"
And user "Carol" has accepted share "/randomfile.txt" offered by user "Alice"
When user "Alice" shares file "randomfile.txt" with user "Brian" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
When user "Brian" accepts share "/randomfile.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And user "Brian" accepts share "/randomfile.txt" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "100"
And the HTTP status code of responses on all endpoints should be "200"
And user "Brian" should see the following elements
| /Shares/randomfile.txt |
And user "Carol" should see the following elements
Expand All @@ -90,11 +84,9 @@ Feature: sharing works when a username and group name are the same
And user "Alice" has shared file "randomfile.txt" with user "Brian"
And user "Brian" has accepted share "/randomfile.txt" offered by user "Alice"
When user "Alice" shares file "randomfile.txt" with group "brian" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
When user "Carol" accepts share "/randomfile.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And user "Carol" accepts share "/randomfile.txt" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "100"
And the HTTP status code of responses on all endpoints should be "200"
And user "Carol" should see the following elements
| /Shares/randomfile.txt |
And user "Brian" should see the following elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,15 @@ Feature: share with groups, group names are case-sensitive
And user "Carol" has been added to group "<group_id2>"
And user "David" has been added to group "<group_id3>"
When user "Alice" shares file "textfile1.txt" with group "<group_id1>" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
When user "Brian" accepts share "/textfile1.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the content of file "/Shares/textfile1.txt" for user "Brian" should be "ownCloud test text file 1"
And user "Brian" accepts share "/textfile1.txt" offered by user "Alice" using the sharing API
Then the content of file "/Shares/textfile1.txt" for user "Brian" should be "ownCloud test text file 1"
When user "Alice" shares file "textfile2.txt" with group "<group_id2>" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
When user "Carol" accepts share "/textfile2.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the content of file "/Shares/textfile2.txt" for user "Carol" should be "ownCloud test text file 2"
And user "Carol" accepts share "/textfile2.txt" offered by user "Alice" using the sharing API
Then the content of file "/Shares/textfile2.txt" for user "Carol" should be "ownCloud test text file 2"
When user "Alice" shares file "textfile3.txt" with group "<group_id3>" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
When user "David" accepts share "/textfile3.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "David" accepts share "/textfile3.txt" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "<ocs_status_code>"
And the HTTP status code of responses on all endpoints should be "200"
And the content of file "/Shares/textfile3.txt" for user "David" should be "ownCloud test text file 3"
Examples:
| ocs_api_version | group_id1 | group_id2 | group_id3 | ocs_status_code |
Expand All @@ -62,24 +52,18 @@ Feature: share with groups, group names are case-sensitive
And group "<group_id1>" has been created
And user "Brian" has been added to group "<group_id1>"
When user "Alice" shares file "textfile1.txt" with group "<group_id1>" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
When user "Brian" accepts share "/textfile1.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" should include
And user "Brian" accepts share "/textfile1.txt" offered by user "Alice" using the sharing API
Then the fields of the last response to user "Alice" should include
| share_with | <group_id1> |
| file_target | /Shares/textfile1.txt |
| path | /Shares/textfile1.txt |
| permissions | share,read,update |
| uid_owner | %username% |
And the content of file "/Shares/textfile1.txt" for user "Brian" should be "ownCloud test text file 1"
When user "Alice" shares file "textfile2.txt" with group "<group_id2>" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
When user "Alice" shares file "textfile3.txt" with group "<group_id3>" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And user "Alice" shares file "textfile3.txt" with group "<group_id3>" using the sharing API
Then the OCS status code of responses on each endpoint should be "<ocs_status_code>, <ocs_status_code>, 404, 404" respectively
And the HTTP status code of responses on each endpoint should be "200, 200, <http_status_code>, <http_status_code>" respectively
Examples:
| ocs_api_version | group_id1 | group_id2 | group_id3 | ocs_status_code | http_status_code |
| 1 | case-sensitive-group | Case-Sensitive-Group | CASE-SENSITIVE-GROUP | 100 | 200 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ Feature: cannot share resources outside the group when share with membership gro
And user "Alice" has been added to group "grp0"
And user "Alice" has created folder "PARENT"
When user "Alice" shares folder "/PARENT" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
And user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "<ocs_status_code>"
And the HTTP status code of responses on all endpoints should be "<http_status_code>"
And as "Brian" folder "/Shares/PARENT" should exist
But as "Brian" folder "/PARENT" should not exist
Examples:
Expand All @@ -58,11 +56,9 @@ Feature: cannot share resources outside the group when share with membership gro
And user "Brian" has been added to group "grp0"
And user "Alice" has created folder "PARENT"
When user "Alice" shares folder "/PARENT" with group "grp0" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
And user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "<ocs_status_code>"
And the HTTP status code of responses on all endpoints should be "<http_status_code>"
And as "Brian" folder "/Shares/PARENT" should exist
But as "Brian" folder "/PARENT" should not exist
Examples:
Expand Down Expand Up @@ -101,11 +97,9 @@ Feature: cannot share resources outside the group when share with membership gro
And user "Brian" has been added to group "grp0"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" shares folder "/textfile0.txt" with group "grp0" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
And user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "<ocs_status_code>"
And the HTTP status code of responses on all endpoints should be "<http_status_code>"
And as "Brian" file "/Shares/textfile0.txt" should exist
But as "Brian" file "/textfile0.txt" should not exist
Examples:
Expand All @@ -122,11 +116,9 @@ Feature: cannot share resources outside the group when share with membership gro
And user "Alice" has been added to group "grp0"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" shares folder "/textfile0.txt" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
And user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "<ocs_status_code>"
And the HTTP status code of responses on all endpoints should be "<http_status_code>"
And as "Brian" file "/Shares/textfile0.txt" should exist
But as "Brian" file "/textfile0.txt" should not exist
Examples:
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -3387,7 +3387,7 @@ public function userDeletesFile(string $user, string $file):void {
$this->pauseUploadDelete();
$this->response = $this->makeDavRequest($user, 'DELETE', $file, []);
$this->lastUploadDeleteTime = \time();
$this->pushToLastStatusCodesArrays();
$this->pushToLastHttpStatusCodesArray((string) $this->getResponse()->getStatusCode());
}

/**
Expand Down

0 comments on commit e3e3d55

Please sign in to comment.