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
path: root/test
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
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')
-rw-r--r--test/gui/shared/scripts/names.py5
-rw-r--r--test/gui/shared/steps/steps.py62
-rw-r--r--test/gui/suite.conf2
-rw-r--r--test/gui/tst_vfs/test.feature20
-rw-r--r--test/gui/tst_vfs/test.py9
5 files changed, 96 insertions, 2 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)
+ )
diff --git a/test/gui/suite.conf b/test/gui/suite.conf
index cbb183980..fd4cbf701 100644
--- a/test/gui/suite.conf
+++ b/test/gui/suite.conf
@@ -4,6 +4,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAPSTYLE=script
-TEST_CASES=tst_addAccount tst_sharing tst_syncing tst_loginLogout tst_removeAccountConnection tst_checkAlltabs
+TEST_CASES=tst_addAccount tst_sharing tst_syncing tst_loginLogout tst_removeAccountConnection tst_checkAlltabs tst_vfs
VERSION=3
WRAPPERS=Qt
diff --git a/test/gui/tst_vfs/test.feature b/test/gui/tst_vfs/test.feature
new file mode 100644
index 000000000..8bcb23bd0
--- /dev/null
+++ b/test/gui/tst_vfs/test.feature
@@ -0,0 +1,20 @@
+Feature: Enable/disable virtual file support
+
+ As a user
+ I want to enable virtual file support
+ So that I can synchronize virtual files with local folder
+
+
+ Scenario: Enable VFS
+ Given user "Alice" has been created on the server with default attributes and without skeleton files
+ And user "Alice" has set up a client with default settings
+ When the user enables virtual file support
+ Then the "Disable virtual file support..." button should be available
+
+
+ Scenario: Disable VFS
+ Given user "Alice" has been created on the server with default attributes and without skeleton files
+ And user "Alice" has set up a client with default settings
+ And the user has enabled virtual file support
+ When the user disables virtual file support
+ Then the "Enable virtual file support (experimental)..." button should be available \ No newline at end of file
diff --git a/test/gui/tst_vfs/test.py b/test/gui/tst_vfs/test.py
new file mode 100644
index 000000000..d6224b99e
--- /dev/null
+++ b/test/gui/tst_vfs/test.py
@@ -0,0 +1,9 @@
+source(findFile('scripts', 'python/bdd.py'))
+
+setupHooks('../shared/scripts/bdd_hooks.py')
+collectStepDefinitions('./steps', '../shared/steps')
+
+
+def main():
+ testSettings.throwOnFailure = True
+ runFeatureFile('test.feature')