diff options
author | Swoichha Adhikari <swoichhaa@gmail.com> | 2021-07-21 16:42:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-21 16:42:42 +0300 |
commit | 968b133fdcea1040532433dbc13307bdc00a5ba9 (patch) | |
tree | 6ea4720cb03add9dc04513c4cd4e5a630af71f75 /test/gui | |
parent | eff45848c0bfb1b42673c887abd57d302b5900ac (diff) |
[tests-only] overwrite content of shared file (#8814)
* [tests-only] GUI tests to check the sync when overwriting the content of a shared file
Diffstat (limited to 'test/gui')
-rw-r--r-- | test/gui/shared/steps/steps.py | 34 | ||||
-rw-r--r-- | test/gui/tst_sharing/test.feature | 22 |
2 files changed, 55 insertions, 1 deletions
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py index 622507050..b53d16dd5 100644 --- a/test/gui/shared/steps/steps.py +++ b/test/gui/shared/steps/steps.py @@ -154,7 +154,18 @@ def isFileSynced(fileName): def waitForFileToBeSynced(context, fileName): waitFor( - lambda: isFileSynced(context.userData['clientSyncPath'] + fileName), + lambda: isFileSynced( + sanitizePath(context.userData['clientSyncPath'] + fileName) + ), + context.userData['clientSyncTimeout'] * 1000, + ) + + +def waitForFolderToBeSynced(context, folderName): + waitFor( + lambda: isFolderSynced( + sanitizePath(context.userData['clientSyncPath'] + folderName) + ), context.userData['clientSyncTimeout'] * 1000, ) @@ -724,3 +735,24 @@ def step(context, resource, group): sharingDialog = SharingDialog() sharingDialog.selectCollaborator(group, True) + + +@When('the user overwrites the file "|any|" with content "|any|"') +def step(context, resource, content): + print("starting file overwrite") + waitForFileToBeSynced(context, resource) + waitForFolderToBeSynced(context, '/') + + # overwriting the file immediately after it has been synced from the server seems to have some problem. + # The client does not see the change although the changes have already been made thus we are having a race condition + # So for now we add 3sec static wait + # an issue https://github.com/owncloud/client/issues/8832 has been created for it + + snooze(3) + + f = open(context.userData['clientSyncPath'] + resource, "w") + f.write(content) + f.close() + + print("file has been overwritten") + waitForFileToBeSynced(context, resource) diff --git a/test/gui/tst_sharing/test.feature b/test/gui/tst_sharing/test.feature index 8fe5ecf39..275cc69ae 100644 --- a/test/gui/tst_sharing/test.feature +++ b/test/gui/tst_sharing/test.feature @@ -54,6 +54,28 @@ Feature: Sharing When the user tires to share resource "%client_sync_path%/textfile0.txt" with the group "grp1" using the client-UI Then the error "Path already shared with this group" should be displayed + + Scenario: sharee edits content of a file inside of a shared folder shared by sharer + Given user "Alice" has created folder "simple-folder" on the server + And user "Alice" has uploaded file with content "ownCloud test text file 0" to "simple-folder/textfile.txt" on the server + And user "Brian" has been created on the server with default attributes and without skeleton files + And user "Alice" has shared folder "simple-folder" on the server with user "Brian" with "all" permissions + And user "Brian" has set up a client with default settings + When the user overwrites the file "simple-folder/textfile.txt" with content "overwrite ownCloud test text file" + Then as "Brian" the file "simple-folder/textfile.txt" on the server should have the content "overwrite ownCloud test text file" + And as "Alice" the file "simple-folder/textfile.txt" on the server should have the content "overwrite ownCloud test text file" + + + Scenario: sharee edits content of a file shared by sharer + Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "textfile.txt" on the server + And user "Brian" has been created on the server with default attributes and without skeleton files + And user "Alice" has shared file "textfile.txt" on the server with user "Brian" with "all" permissions + And user "Brian" has set up a client with default settings + When the user overwrites the file "textfile.txt" with content "overwrite ownCloud test text file" + Then as "Brian" the file "textfile.txt" on the server should have the content "overwrite ownCloud test text file" + And as "Alice" the file "textfile.txt" on the server should have the content "overwrite ownCloud test text file" + + @issue-7423 Scenario: unshare a reshared file Given the setting "shareapi_auto_accept_share" on the server of app "core" has been set to "no" |