diff --git a/tests/acceptance/features/apiLocks/lockFiles.feature b/tests/acceptance/features/apiLocks/lockFiles.feature index db2ac997e18..f5c7691d0b7 100644 --- a/tests/acceptance/features/apiLocks/lockFiles.feature +++ b/tests/acceptance/features/apiLocks/lockFiles.feature @@ -367,3 +367,21 @@ Feature: lock files | new | exclusive | | spaces | shared | | spaces | exclusive | + + + Scenario Outline: lock expiration + Given using DAV path + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "textfile0.txt" + And user "Alice" has locked file "textfile0.txt" setting the following properties + | lockscope | | + | timeout | Second-5 | + When the user waits for "5" seconds to expire the lock + Then user "Alice" should be able to upload file "filesForUpload/lorem.txt" to "textfile0.txt" + Examples: + | dav-path-version | lock-scope | + | old | shared | + | old | exclusive | + | new | shared | + | new | exclusive | + | spaces | shared | + | spaces | exclusive | diff --git a/tests/acceptance/features/bootstrap/WebDavLockingContext.php b/tests/acceptance/features/bootstrap/WebDavLockingContext.php index 63851aec9db..70e756c857e 100644 --- a/tests/acceptance/features/bootstrap/WebDavLockingContext.php +++ b/tests/acceptance/features/bootstrap/WebDavLockingContext.php @@ -828,6 +828,17 @@ public function numberOfLockShouldBeReported(int $count, string $file, string $u ); } + /** + * @When the user waits for :time seconds to expire the lock + * + * @param int $time + * + * @return void + */ + public function waitForCertainSecondsToExpireTheLock(int $time): void { + \sleep($time); + } + /** * This will run before EVERY scenario. * It will set the properties for this object.