Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwoichha Adhikari <swoichhaa@gmail.com>2021-07-21 16:42:42 +0300
committerGitHub <noreply@github.com>2021-07-21 16:42:42 +0300
commit968b133fdcea1040532433dbc13307bdc00a5ba9 (patch)
tree6ea4720cb03add9dc04513c4cd4e5a630af71f75 /test/gui/shared/steps
parenteff45848c0bfb1b42673c887abd57d302b5900ac (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/shared/steps')
-rw-r--r--test/gui/shared/steps/steps.py34
1 files changed, 33 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)