Skip to content

Commit

Permalink
add test for disabling vfs
Browse files Browse the repository at this point in the history
  • Loading branch information
swoichha committed Jul 22, 2021
1 parent 5feed43 commit 3d8d5d4
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 4 deletions.
2 changes: 2 additions & 0 deletions test/gui/shared/scripts/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@
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}
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}
59 changes: 56 additions & 3 deletions test/gui/shared/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,64 @@ def step(context, resource, content):

@When("the user enables virtual file support")
def step(context):
mouseClick(waitForObjectItem(names.stack_folderList_QTreeView, "_1"), 718, 27, Qt.NoModifier, Qt.LeftButton)
activateItem(waitForObjectItem(names.settings_QMenu, "Enable virtual file support (experimental)..."))
clickButton(waitForObject(names.stack_Enable_experimental_placeholder_mode_QPushButton))
mouseClick(
waitForObjectItem(names.stack_folderList_QTreeView, "_1"),
718,
27,
Qt.NoModifier,
Qt.LeftButton,
)
activateItem(
waitForObjectItem(
names.settings_QMenu, "Enable virtual file support (experimental)..."
)
)
clickButton(
waitForObject(names.stack_Enable_experimental_placeholder_mode_QPushButton)
)


@Then("the virtual file support should be enabled")
def step(context):
pass


@Given("the user has enabled virtual file support")
def step(context):
mouseClick(
waitForObjectItem(names.stack_folderList_QTreeView, "_1"),
715,
31,
Qt.NoModifier,
Qt.LeftButton,
)
activateItem(
waitForObjectItem(
names.settings_QMenu, "Enable virtual file support (experimental)..."
)
)
clickButton(
waitForObject(names.stack_Enable_experimental_placeholder_mode_QPushButton)
)


@When("the user diables virtual file support")
def step(context):
mouseClick(
waitForObjectItem(names.stack_folderList_QTreeView, "_1"),
720,
33,
Qt.NoModifier,
Qt.LeftButton,
)
activateItem(
waitForObjectItem(names.settings_QMenu, "Disable virtual file support...")
)
clickButton(
waitForObject(names.disable_virtual_file_support_Disable_support_QPushButton)
)


@Then("the virtual file support should be disbaleds")
def step(context):
pass
10 changes: 9 additions & 1 deletion test/gui/tst_vfs/test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ Feature: Enable/disable virtual file support
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 virtual file support should be enabled
Then the virtual file support should be enabled


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 diables virtual file support
Then the virtual file support should be disbaleds
1 change: 1 addition & 0 deletions test/gui/tst_vfs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
setupHooks('../shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps')


def main():
testSettings.throwOnFailure = True
runFeatureFile('test.feature')

0 comments on commit 3d8d5d4

Please sign in to comment.