mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 08:37:12 +00:00
chore: added 2 attempts when clicking add buttons during permission creation and replaced id by object name
This commit is contained in:
parent
d0fc8ddc3d
commit
b5e16807ea
@ -531,28 +531,43 @@ class PermissionsSettingsView(QObject):
|
|||||||
self._create_permission_button.wait_until_hidden()
|
self._create_permission_button.wait_until_hidden()
|
||||||
|
|
||||||
@allure.step('Open Who holds context menu')
|
@allure.step('Open Who holds context menu')
|
||||||
def open_who_holds_context_menu(self):
|
def open_who_holds_context_menu(self, attempt: int = 2):
|
||||||
for child in walk_children(self._who_holds_list_item.object):
|
try:
|
||||||
if getattr(child, 'id', '') == 'addItemButton':
|
for child in walk_children(self._who_holds_list_item.object):
|
||||||
driver.mouseClick(child)
|
if getattr(child, 'objectName', '') == 'addItemButton':
|
||||||
return
|
driver.mouseClick(child)
|
||||||
raise LookupError('Add button for who holds not found')
|
return
|
||||||
|
except LookupError:
|
||||||
|
if attempt:
|
||||||
|
return self.open_who_holds_context_menu(attempt - 1)
|
||||||
|
else:
|
||||||
|
raise LookupError('Add button for who holds not found')
|
||||||
|
|
||||||
@allure.step('Open Is allowed to context menu')
|
@allure.step('Open Is allowed to context menu')
|
||||||
def open_is_allowed_to_context_menu(self):
|
def open_is_allowed_to_context_menu(self, attempt: int = 2):
|
||||||
for child in walk_children(self._is_allowed_to_list_item.object):
|
try:
|
||||||
if getattr(child, 'id', '') == 'addItemButton':
|
for child in walk_children(self._is_allowed_to_list_item.object):
|
||||||
driver.mouseClick(child)
|
if getattr(child, 'objectName', '') == 'addItemButton':
|
||||||
return
|
driver.mouseClick(child)
|
||||||
raise LookupError('Add button for allowed to not found')
|
return
|
||||||
|
except LookupError:
|
||||||
|
if attempt:
|
||||||
|
return self.open_is_allowed_to_context_menu(attempt - 1)
|
||||||
|
else:
|
||||||
|
raise LookupError('Add button for allowed to not found')
|
||||||
|
|
||||||
@allure.step('Open In context menu')
|
@allure.step('Open In context menu')
|
||||||
def open_in_context_menu(self):
|
def open_in_context_menu(self, attempt: int = 2):
|
||||||
for child in walk_children(self._in_list_item.object):
|
try:
|
||||||
if getattr(child, 'id', '') == 'addItemButton':
|
for child in walk_children(self._in_list_item.object):
|
||||||
driver.mouseClick(child)
|
if getattr(child, 'objectName', '') == 'addItemButton':
|
||||||
return
|
driver.mouseClick(child)
|
||||||
raise LookupError('Add button for in not found')
|
return
|
||||||
|
except LookupError:
|
||||||
|
if attempt:
|
||||||
|
return self.open_in_context_menu(attempt - 1)
|
||||||
|
else:
|
||||||
|
raise LookupError('Add button for in not found')
|
||||||
|
|
||||||
@allure.step('Switch hide permission checkbox')
|
@allure.step('Switch hide permission checkbox')
|
||||||
def switch_hide_permission_checkbox(self, state):
|
def switch_hide_permission_checkbox(self, state):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user