chore: add attempts for clicking sign out button

This commit is contained in:
Anastasiya Semenkevich 2023-12-08 15:09:10 +03:00 committed by Anastasiya
parent 5a6d35fde2
commit d953db7a31
1 changed files with 9 additions and 2 deletions

View File

@ -11,5 +11,12 @@ class SignOutPopup(BasePopup):
self._sign_out_and_quit_button = Button('signOutConfirmationButton')
@allure.step('Click sign out and quit button')
def sign_out_and_quit(self):
self._sign_out_and_quit_button.click()
def sign_out_and_quit(self, attempts: int = 2):
try:
self._sign_out_and_quit_button.click()
except Exception as ec:
if attempts:
self.sign_out_and_quit(attempts-1)
else:
raise ec