removed try/except and added assert to check address is created

This commit is contained in:
shekhar-cis 2021-10-01 19:05:26 +05:30
parent f757e7efbf
commit 43fc7d6e5c
Signed by untrusted user: shekhar-cis
GPG Key ID: 8B2A6C8D5F7F1635

View File

@ -51,18 +51,8 @@ class CreateRandomAddress(TeleniumTestProcess):
self.cli.wait_click('//RandomBoxlayout//MDFillRoundFlatIconButton[0]', timeout=2) self.cli.wait_click('//RandomBoxlayout//MDFillRoundFlatIconButton[0]', timeout=2)
# Checking "My Address" Screen after creating a address # Checking "My Address" Screen after creating a address
self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5) self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5)
# Validating the new address is created, # Checking the new address is created
# because the process takes time to generate new address so we used loop with a timout. self.assertExists('//MDList[0]/CustomTwoLineAvatarIconListItem', timeout=10)
num_of_addresses = len(self.cli.select('//MDList[0]/CustomTwoLineAvatarIconListItem'))
start = time()
deadline = start + 6
while time() < deadline:
try:
if num_of_addresses >= 1:
self.assertEqual(num_of_addresses, 1)
break
except TeleniumHttpException:
continue
@skip_screen_checks @skip_screen_checks
@ordered @ordered