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:
authorArtur Neumann <artur@jankaritech.com>2022-01-11 15:42:55 +0300
committerGitHub <noreply@github.com>2022-01-11 15:42:55 +0300
commitb3f797c493f2b8bf4f5ac45059fb9c479cb56879 (patch)
treebc15f7ec0a5cb303927e6852bdf231a70d940254 /test
parent31a2cc96f19ce83e57c41cd545f141a6e95b8aaa (diff)
wait for deleted account to disappear (#9350)
Diffstat (limited to 'test')
-rw-r--r--test/gui/shared/scripts/pageObjects/AccountStatus.py20
-rw-r--r--test/gui/shared/steps/steps.py39
-rw-r--r--test/gui/tst_loginLogout/test.feature2
3 files changed, 32 insertions, 29 deletions
diff --git a/test/gui/shared/scripts/pageObjects/AccountStatus.py b/test/gui/shared/scripts/pageObjects/AccountStatus.py
index dda7ec92c..2dfcf43c3 100644
--- a/test/gui/shared/scripts/pageObjects/AccountStatus.py
+++ b/test/gui/shared/scripts/pageObjects/AccountStatus.py
@@ -1,5 +1,7 @@
import names
import squish
+import object
+from urllib.parse import urlparse
class AccountStatus:
@@ -30,6 +32,18 @@ class AccountStatus:
"visible": 1,
}
+ settingsdialogToolbutton = None
+
+ def __init__(self, context, displayname, host=None):
+ if host == None:
+ host = urlparse(context.userData['localBackendUrl']).netloc
+ self.settingsdialogToolbutton = {
+ "name": "settingsdialog_toolbutton_" + displayname + "@" + host,
+ "type": "QToolButton",
+ "visible": 1,
+ }
+ squish.clickButton(squish.waitForObject(self.settingsdialogToolbutton))
+
def accountAction(self, action):
squish.sendEvent(
"QMouseEvent",
@@ -46,3 +60,9 @@ class AccountStatus:
def removeConnection(self):
self.accountAction("Remove")
squish.clickButton(squish.waitForObject(self.REMOVE_CONNECTION_BUTTON))
+ squish.waitFor(
+ lambda: (not object.exists(self.settingsdialogToolbutton)),
+ )
+
+ def getText(self):
+ return str(squish.waitForObjectExists(self.settingsdialogToolbutton).text)
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py
index e0f12da6a..b6a8ede16 100644
--- a/test/gui/shared/steps/steps.py
+++ b/test/gui/shared/steps/steps.py
@@ -84,16 +84,10 @@ def step(context):
def step(context, displayname, host):
displayname = substituteInLineCodes(context, displayname)
host = substituteInLineCodes(context, host)
+ accountStatus = AccountStatus(context, displayname, host)
+
test.compare(
- str(
- waitForObjectExists(
- {
- "name": "settingsdialog_toolbutton_" + displayname + "@" + host,
- "type": "QToolButton",
- "visible": 1,
- }
- ).text
- ),
+ accountStatus.getText(),
displayname + "\n" + host,
)
@@ -759,16 +753,16 @@ def step(context, resource):
createPublicShareWithRole(context, resource, role)
-@When('the user logs out of the client-UI')
-def step(context):
- accountStatus = AccountStatus()
+@When('the user "|any|" logs out of the client-UI')
+def step(context, username):
+ accountStatus = AccountStatus(context, getDisplaynameForUser(context, username))
accountStatus.accountAction("Log out")
def isUserSignedOut(context, username):
displayname = getDisplaynameForUser(context, username)
server = context.userData['localBackendUrl']
- accountStatus = AccountStatus()
+ accountStatus = AccountStatus(context, getDisplaynameForUser(context, username))
test.compare(
str(waitForObjectExists(accountStatus.SIGNED_OUT_TEXT_BAR).text),
'Signed out from <a href="'
@@ -784,8 +778,7 @@ def isUserSignedOut(context, username):
def isUserSignedIn(context, username):
displayname = getDisplaynameForUser(context, username)
server = context.userData['localBackendUrl']
- accountStatus = AccountStatus()
-
+ accountStatus = AccountStatus(context, getDisplaynameForUser(context, username))
test.compare(
str(waitForObjectExists(accountStatus.SIGNED_OUT_TEXT_BAR).text),
'Connected '
@@ -810,14 +803,14 @@ def step(context, username):
# TODO: find some way to dynamically to check if files are synced
# It might take some time for all files to sync
snooze(5)
- accountStatus = AccountStatus()
+ accountStatus = AccountStatus(context, getDisplaynameForUser(context, username))
accountStatus.accountAction("Log out")
isUserSignedOut(context, username)
@When('user "|any|" logs in to the client-UI')
def step(context, username):
- accountStatus = AccountStatus()
+ accountStatus = AccountStatus(context, getDisplaynameForUser(context, username))
accountStatus.accountAction("Log in")
password = getPasswordForUser(context, username)
enterUserPassword = EnterPassword()
@@ -838,18 +831,8 @@ def step(context, username, host):
displayname = substituteInLineCodes(context, displayname)
host = substituteInLineCodes(context, host)
- clickButton(
- waitForObject(
- {
- "name": "settingsdialog_toolbutton_" + displayname + "@" + host,
- "type": "QToolButton",
- "visible": 1,
- }
- )
- )
-
waitForFolderToBeSynced(context, '/')
- accountStatus = AccountStatus()
+ accountStatus = AccountStatus(context, displayname, host)
accountStatus.removeConnection()
diff --git a/test/gui/tst_loginLogout/test.feature b/test/gui/tst_loginLogout/test.feature
index 21e3ddb23..d5c579187 100644
--- a/test/gui/tst_loginLogout/test.feature
+++ b/test/gui/tst_loginLogout/test.feature
@@ -8,7 +8,7 @@ Feature: Logout users
Scenario: logging out
Given user "Alice" has set up a client with default settings
- When the user logs out of the client-UI
+ When the user "Alice" logs out of the client-UI
Then user "Alice" should be signed out
Scenario: login after loggin out