diff options
author | Swoichha Adhikari <swoichhaa@gmail.com> | 2021-04-30 10:33:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-30 10:33:43 +0300 |
commit | bcccfc2b33ffa3e8a0a7cd55cf73af31fe411441 (patch) | |
tree | 7f7bca3d3a4b9da573b71d0520a6374a431ac13b /test/gui/shared | |
parent | 2418595ccf6f29127997bf476a294bf8cdad30b8 (diff) |
[tests-only]refactor tests to use scenario outline (#8578)
Diffstat (limited to 'test/gui/shared')
-rw-r--r-- | test/gui/shared/steps/steps.py | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py index 27a6362c5..c13fdcbdd 100644 --- a/test/gui/shared/steps/steps.py +++ b/test/gui/shared/steps/steps.py @@ -515,12 +515,10 @@ def step(context, permissions, resource, password): waitFor(lambda: (findObject(names.linkShares_0_0_QModelIndex).displayText == "Public link")) -@When('the user creates a new public link for folder "|any|" with "|any|" using the client-UI') -def step(context, resource, role): +def createPublicShare(context, resource, role): resource = sanitizePath(substituteInLineCodes(context, resource)) radioObjectName = '' - if role == 'Viewer': radioObjectName = names.oCC_ShareLinkWidget_radio_readOnly_QRadioButton elif role == 'Editor': @@ -529,8 +527,27 @@ def step(context, resource, role): radioObjectName = names.oCC_ShareLinkWidget_radio_uploadOnly_QRadioButton else: raise Exception("No such role found for resource") - + openPublicLinkDialog(context, resource) clickButton(waitForObject(radioObjectName)) - clickButton(waitForObject(names.oCC_ShareLinkWidget_createShareButton_QPushButton)) + clickButton(waitForObject(names.oCC_ShareLinkWidget_createShareButton_QPushButton)) + +@When('the user creates a new public link for folder "|any|" using the client-UI with these details:') +def step(context, resource): + role = '' + for row in context.table: + if row[0] == 'role': + role=row[1] + break + + if role == '': + raise Exception("No role has been found") + else: + createPublicShare(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): + createPublicShare(context, resource, role) + |