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-08-09 10:07:48 +0300
committerHannah von Reth <hannah.vonreth@owncloud.com>2021-08-09 13:13:18 +0300
commitc625d2d0af226a23b0398ae63bc7b000492c8102 (patch)
treee8db5a11edac748bb0d62d7b6ace27506245ff5b /test/gui/shared
parenta41bc4ac618374338c050daffd453b44d42dc5f1 (diff)
[Tests Only] add test for enable/disable vfs (#8835)
* [Tests Only] add test for vfs * add test for disabling vfs * vfs object from model * make code DRY * added few comment for coordinates
Diffstat (limited to 'test/gui/shared')
-rw-r--r--test/gui/shared/scripts/names.py5
-rw-r--r--test/gui/shared/steps/steps.py62
2 files changed, 66 insertions, 1 deletions
diff --git a/test/gui/shared/scripts/names.py b/test/gui/shared/scripts/names.py
index 01df761a5..783b35dbe 100644
--- a/test/gui/shared/scripts/names.py
+++ b/test/gui/shared/scripts/names.py
@@ -98,4 +98,7 @@ oCC_IssuesWidget_tableView_QTableView = {"container": qt_tabwidget_stackedwidget
o_tableView_0_1_QModelIndex = {"column": 1, "container": oCC_IssuesWidget_tableView_QTableView, "row": 0, "type": "QModelIndex"}
settings_settingsdialog_toolbutton_Add_account_QToolButton = {"name": "settingsdialog_toolbutton_Add account", "type": "QToolButton", "visible": 1, "window": settings_OCC_SettingsDialog}
settings_settingsdialog_toolbutton_Activity_QToolButton = {"name": "settingsdialog_toolbutton_Activity", "type": "QToolButton", "visible": 1, "window": settings_OCC_SettingsDialog}
-sharingDialog_Close_QPushButton = {"text": "Close", "type": "QPushButton", "unnamed": 1, "visible": 1, "window": sharingDialog_OCC_ShareDialog} \ No newline at end of file
+sharingDialog_Close_QPushButton = {"text": "Close", "type": "QPushButton", "unnamed": 1, "visible": 1, "window": sharingDialog_OCC_ShareDialog}
+stack_Enable_experimental_placeholder_mode_QPushButton = {"container": settings_stack_QStackedWidget, "text": "Enable experimental placeholder mode", "type": "QPushButton", "unnamed": 1, "visible": 1}
+disable_virtual_file_support_QMessageBox = {"type": "QMessageBox", "unnamed": 1, "visible": 1, "windowTitle": "Disable virtual file support?"}
+disable_virtual_file_support_Disable_support_QPushButton = {"text": "Disable support", "type": "QPushButton", "unnamed": 1, "visible": 1, "window": disable_virtual_file_support_QMessageBox}
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py
index 56f8aceef..85a99f70f 100644
--- a/test/gui/shared/steps/steps.py
+++ b/test/gui/shared/steps/steps.py
@@ -744,3 +744,65 @@ def step(context, resource, content):
print("file has been overwritten")
waitForFileToBeSynced(context, resource)
+
+
+def enableVFSSupport(vfsBtnText):
+ # The enabling/disabling VFS button do not have it's own object
+ # But it is inside the "stack_folderList_QTreeView" object.
+ # So we are clicking at (718, 27) of "stack_folderList_QTreeView" object to enable/disable VFS
+ mouseClick(
+ waitForObjectItem(names.stack_folderList_QTreeView, "_1"),
+ 718,
+ 27,
+ Qt.NoModifier,
+ Qt.LeftButton,
+ )
+ activateItem(waitForObjectItem(names.settings_QMenu, vfsBtnText))
+ clickButton(
+ waitForObject(names.stack_Enable_experimental_placeholder_mode_QPushButton)
+ )
+
+
+@When("the user enables virtual file support")
+def step(context):
+ enableVFSSupport("Enable virtual file support (experimental)...")
+
+
+@Then('the "|any|" button should be available')
+def step(context, btnText):
+ # The enabling/disabling VFS button do not have it's own object
+ # But it is inside the "stack_folderList_QTreeView" object.
+ # So we are clicking at (718, 27) of "stack_folderList_QTreeView" object to enable/disable VFS
+ mouseClick(
+ waitForObjectItem(names.stack_folderList_QTreeView, "_1"),
+ 718,
+ 27,
+ Qt.NoModifier,
+ Qt.LeftButton,
+ )
+ waitForObjectItem(names.settings_QMenu, btnText)
+
+
+@Given("the user has enabled virtual file support")
+def step(context):
+ enableVFSSupport("Enable virtual file support (experimental)...")
+
+
+@When("the user disables virtual file support")
+def step(context):
+ # The enabling/disabling VFS button do not have it's own object
+ # But it is inside the "stack_folderList_QTreeView" object.
+ # So we are clicking at (718, 27) of "stack_folderList_QTreeView" object to enable/disable VFS
+ mouseClick(
+ waitForObjectItem(names.stack_folderList_QTreeView, "_1"),
+ 733,
+ 27,
+ Qt.NoModifier,
+ Qt.LeftButton,
+ )
+ activateItem(
+ waitForObjectItem(names.settings_QMenu, "Disable virtual file support...")
+ )
+ clickButton(
+ waitForObject(names.disable_virtual_file_support_Disable_support_QPushButton)
+ )