Skip to content

Commit

Permalink
sharing related etag tests
Browse files Browse the repository at this point in the history
Co-authored-by: Phil Davis <[email protected]>
  • Loading branch information
individual-it and phil-davis committed Oct 5, 2020
1 parent 5ea571d commit 11e6da1
Show file tree
Hide file tree
Showing 5 changed files with 349 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ default:
- PublicWebDavContext:
- FilesVersionsContext:
- WebDavPropertiesContext:
- AppConfigurationContext:

apiTranslation:
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Feature: propagation of etags when creating folders

Background:
Given user "Alice" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"

Scenario Outline: creating a folder inside a folder changes its etag
Given using <dav_version> DAV path
Expand Down Expand Up @@ -32,3 +34,40 @@ Feature: propagation of etags when creating folders
| new | |
| new | folder |
| new | folder/sub |

Scenario Outline: as share receiver creating a folder inside a folder received as a share changes its etag for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And using <dav_version> DAV path
And user "Alice" has created folder "/folder"
And user "Alice" has shared folder "/folder" with user "Brian"
And user "Brian" has accepted share "/folder" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Brian" creates folder "/Shares/folder/new" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | folder |
| new | |
| new | folder |

Scenario Outline: as sharer creating a folder inside a folder received as a share changes its etag for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And using <dav_version> DAV path
And user "Alice" has created folder "/folder"
And user "Alice" has shared folder "/folder" with user "Brian"
And user "Brian" has accepted share "/folder" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Alice" creates folder "/folder/new" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | folder |
| new | |
| new | folder |

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Feature: propagation of etags when deleting a file or folder

Background:
Given user "Alice" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And user "Alice" has created folder "/upload"

Scenario Outline: deleting a file changes the etags of all parents
Expand Down Expand Up @@ -53,3 +55,91 @@ Feature: propagation of etags when deleting a file or folder
| new | |
| new | upload |
| new | upload/sub |

Scenario Outline: as share receiver deleting a file changes the etags of all parents for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And using <dav_version> DAV path
And user "Alice" has created folder "/upload/sub"
And user "Alice" has uploaded file with content "uploaded content" to "/upload/sub/file.txt"
And user "Alice" has shared folder "/upload" with user "Brian"
And user "Brian" has accepted share "/upload" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Brian" deletes file "/Shares/upload/sub/file.txt" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | upload |
| old | upload/sub |
| new | |
| new | upload |
| new | upload/sub |

Scenario Outline: as sharer deleting a file changes the etags of all parents for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And using <dav_version> DAV path
And user "Alice" has created folder "/upload/sub"
And user "Alice" has uploaded file with content "uploaded content" to "/upload/sub/file.txt"
And user "Alice" has shared folder "/upload" with user "Brian"
And user "Brian" has accepted share "/upload" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Alice" deletes file "/upload/sub/file.txt" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | upload |
| old | upload/sub |
| new | |
| new | upload |
| new | upload/sub |

Scenario Outline: as share receiver deleting a folder changes the etags of all parents for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And using <dav_version> DAV path
And user "Alice" has created folder "/upload/sub"
And user "Alice" has created folder "/upload/sub/toDelete"
And user "Alice" has shared folder "/upload" with user "Brian"
And user "Brian" has accepted share "/upload" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Brian" deletes folder "/Shares/upload/sub/toDelete" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | upload |
| old | upload/sub |
| new | |
| new | upload |
| new | upload/sub |

Scenario Outline: as sharer deleting a folder changes the etags of all parents for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And using <dav_version> DAV path
And user "Alice" has created folder "/upload/sub"
And user "Alice" has created folder "/upload/sub/toDelete"
And user "Alice" has shared folder "/upload" with user "Brian"
And user "Brian" has accepted share "/upload" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Alice" deletes folder "/upload/sub/toDelete" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | upload |
| old | upload/sub |
| new | |
| new | upload |
| new | upload/sub |
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,150 @@ Feature: propagation of etags when moving files or folders
| new | |
| new | upload |
| new | upload/sub |

Scenario Outline: as share receiver renaming a file inside a folder changes its etag for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And using <dav_version> DAV path
And user "Alice" has created folder "/upload"
And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt"
And user "Alice" has shared folder "/upload" with user "Brian"
And user "Brian" has accepted share "/upload" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Brian" moves file "/Shares/upload/file.txt" to "/Shares/upload/renamed.txt" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | upload |
| new | |
| new | upload |

Scenario Outline: as sharer renaming a file inside a folder changes its etag for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And using <dav_version> DAV path
And user "Alice" has created folder "/upload"
And user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt"
And user "Alice" has shared folder "/upload" with user "Brian"
And user "Brian" has accepted share "/upload" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Alice" moves file "/upload/file.txt" to "/upload/renamed.txt" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | upload |
| new | |
| new | upload |


Scenario Outline: as sharer moving a file from one folder to an other changes the etags of both folders for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And using <dav_version> DAV path
And user "Alice" has created folder "/src"
And user "Alice" has created folder "/dst"
And user "Alice" has uploaded file with content "uploaded content" to "/src/file.txt"
And user "Alice" has shared folder "/src" with user "Brian"
And user "Brian" has accepted share "/src" offered by user "Alice"
And user "Alice" has shared folder "/dst" with user "Brian"
And user "Brian" has accepted share "/dst" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Alice" moves file "/src/file.txt" to "/dst/file.txt" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | src |
| old | dst |
| new | |
| new | src |
| new | dst |

Scenario Outline: as share receiver moving a file from one folder to an other changes the etags of both folders for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And using <dav_version> DAV path
And user "Alice" has created folder "/src"
And user "Alice" has created folder "/dst"
And user "Alice" has uploaded file with content "uploaded content" to "/src/file.txt"
And user "Alice" has shared folder "/src" with user "Brian"
And user "Brian" has accepted share "/src" offered by user "Alice"
And user "Alice" has shared folder "/dst" with user "Brian"
And user "Brian" has accepted share "/dst" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Brian" moves file "/Shares/src/file.txt" to "/Shares/dst/file.txt" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | src |
| old | dst |
| new | |
| new | src |
| new | dst |

Scenario Outline: as sharer moving a folder from one folder to an other changes the etags of both folders for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And using <dav_version> DAV path
And user "Alice" has created folder "/src"
And user "Alice" has created folder "/dst"
And user "Alice" has created folder "/src/toMove"
And user "Alice" has shared folder "/src" with user "Brian"
And user "Brian" has accepted share "/src" offered by user "Alice"
And user "Alice" has shared folder "/dst" with user "Brian"
And user "Brian" has accepted share "/dst" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Alice" moves folder "/src/toMove" to "/dst/toMove" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | src |
| old | dst |
| new | |
| new | src |
| new | dst |

Scenario Outline: as share receiver moving a folder from one folder to an other changes the etags of both folders for all collaborators
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has set the default folder for received shares to "Shares"
And parameter "shareapi_auto_accept_share" of app "core" has been set to "no"
And using <dav_version> DAV path
And user "Alice" has created folder "/src"
And user "Alice" has created folder "/dst"
And user "Alice" has created folder "/src/toMove"
And user "Alice" has shared folder "/src" with user "Brian"
And user "Brian" has accepted share "/src" offered by user "Alice"
And user "Alice" has shared folder "/dst" with user "Brian"
And user "Brian" has accepted share "/dst" offered by user "Alice"
And user "Alice" has stored etag of element "/<element>"
And user "Brian" has stored etag of element "/Shares/<element>"
When user "Brian" moves folder "/Shares/src/toMove" to "/Shares/dst/toMove" using the WebDAV API
Then the etag of element "/<element>" of user "Alice" should have changed
And the etag of element "/Shares/<element>" of user "Brian" should have changed
Examples:
| dav_version | element |
| old | |
| old | src |
| old | dst |
| new | |
| new | src |
| new | dst |
Loading

0 comments on commit 11e6da1

Please sign in to comment.