diff options
author | Saw-jan Gurung <saw.jan.grg3e@gmail.com> | 2021-11-18 07:56:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 07:56:56 +0300 |
commit | 5431c68c63f2bd4b78fafde56134a5481cfb7ccc (patch) | |
tree | d4c60dadff86e273f61e71611f3f0b68f79cda84 /test/gui | |
parent | 227f9f8707ba987abb01ccb855db3bf64cfcfa72 (diff) |
[gui-tests-only] Fix intermittent test fails (#9207)
* merge similar steps
* fix sharing tests
Diffstat (limited to 'test/gui')
-rw-r--r-- | test/gui/shared/scripts/pageObjects/SharingDialog.py | 12 | ||||
-rw-r--r-- | test/gui/shared/steps/steps.py | 8 | ||||
-rw-r--r-- | test/gui/tst_sharing/test.feature | 13 |
3 files changed, 21 insertions, 12 deletions
diff --git a/test/gui/shared/scripts/pageObjects/SharingDialog.py b/test/gui/shared/scripts/pageObjects/SharingDialog.py index 2e5e54b88..a8a4f1ea5 100644 --- a/test/gui/shared/scripts/pageObjects/SharingDialog.py +++ b/test/gui/shared/scripts/pageObjects/SharingDialog.py @@ -5,6 +5,12 @@ import test class SharingDialog: + ITEM_TO_SHARE = { + "name": "label_name", + "type": "QLabel", + "visible": 1, + "window": names.sharingDialog_OCC_ShareDialog, + } SHARE_WITH_COLLABORATOR_INPUT_FIELD = { "container": names.qt_tabwidget_stackedwidget_SharingDialogUG_OCC_ShareUserGroupWidget, "name": "shareeLineEdit", @@ -118,3 +124,9 @@ class SharingDialog: squish.clickButton( squish.waitForObject(names.scrollArea_permissionsEdit_QCheckBox) ) + + def verifyResource(self, resource): + test.compare( + str(squish.waitForObjectExists(self.ITEM_TO_SHARE).text), + resource, + ) diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py index d1421b236..9ba1d7173 100644 --- a/test/gui/shared/steps/steps.py +++ b/test/gui/shared/steps/steps.py @@ -679,13 +679,6 @@ def step(context, resource): createPublicShareWithRole(context, resource, role) -@When( - 'the user creates a new public link for folder "|any|" with "|any|" using the client-UI' -) -def step(context, resource, role): - createPublicShareWithRole(context, resource, role) - - @When('the user logs out of the client-UI') def step(context): accountStatus = AccountStatus() @@ -833,6 +826,7 @@ def step(context, permissions, user, resource): permissionsList = permissions.split(',') shareItem = SharingDialog() + shareItem.verifyResource(resource) editChecked, shareChecked = shareItem.getAvailablePermission() if 'edit' in permissionsList: diff --git a/test/gui/tst_sharing/test.feature b/test/gui/tst_sharing/test.feature index e9638de37..f24447792 100644 --- a/test/gui/tst_sharing/test.feature +++ b/test/gui/tst_sharing/test.feature @@ -207,7 +207,8 @@ Feature: Sharing Given user "Alice" has created folder "simple-folder" on the server And user "Alice" has created file "simple-folder/lorem.txt" on the server And user "Alice" has set up a client with default settings - When the user creates a new public link for folder "simple-folder" with "Contributor" using the client-UI + When the user creates a new public link for folder "simple-folder" using the client-UI with these details: + | role | Contributor | Then user "Alice" on the server should have a share with these details: | field | value | | share_type | public_link | @@ -219,17 +220,19 @@ Feature: Sharing Scenario Outline: change collaborator permissions of a file & folder - Given user "Alice" has created folder "simple-folder" on the server + Given the setting "shareapi_auto_accept_share" on the server of app "core" has been set to "yes" + And the administrator on the server has set the default folder for received shares to "Shares" + And user "Alice" has created folder "simple-folder" on the server And user "Alice" has created file "lorem.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 "Alice" has shared file "lorem.txt" on the server with user "Brian" with "all" permissions And user "Alice" has set up a client with default settings When the user removes permissions "<permissions>" for user "Brian Murphy" of resource "simple-folder" using the client-UI - And the user closes the sharing dialog - And the user removes permissions "<permissions>" for user "Brian Murphy" of resource "lorem.txt" using the client-UI Then "<permissions>" permissions should not be displayed for user "Brian Murphy" for resource "simple-folder" on the client-UI - And "<permissions>" permissions should not be displayed for user "Brian Murphy" for resource "lorem.txt" on the client-UI + When the user closes the sharing dialog + And the user removes permissions "<permissions>" for user "Brian Murphy" of resource "lorem.txt" using the client-UI + Then "<permissions>" permissions should not be displayed for user "Brian Murphy" for resource "lorem.txt" on the client-UI And user "Alice" on the server should have a share with these details: | field | value | | uid_owner | Alice | |