From 43fc7d6e5c8323ec6f2105e82b6b41115750316b Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Fri, 1 Oct 2021 19:05:26 +0530 Subject: [PATCH] removed try/except and added assert to check address is created --- .../tests/test_create_random_address.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/bitmessagekivy/tests/test_create_random_address.py b/src/bitmessagekivy/tests/test_create_random_address.py index 5385529d..2f6c1fe7 100644 --- a/src/bitmessagekivy/tests/test_create_random_address.py +++ b/src/bitmessagekivy/tests/test_create_random_address.py @@ -51,18 +51,8 @@ class CreateRandomAddress(TeleniumTestProcess): self.cli.wait_click('//RandomBoxlayout//MDFillRoundFlatIconButton[0]', timeout=2) # Checking "My Address" Screen after creating a address self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5) - # Validating the new address is created, - # because the process takes time to generate new address so we used loop with a timout. - 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 + # Checking the new address is created + self.assertExists('//MDList[0]/CustomTwoLineAvatarIconListItem', timeout=10) @skip_screen_checks @ordered