Skip to content

Commit 7ee2217

Browse files
committed
Fixed Create_random_address_generator kivy test
1 parent 346b1a4 commit 7ee2217

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

src/bitmessagekivy/tests/test_create_random_address.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Test for creating new identity
33
"""
44

5-
from time import sleep
65
from random import choice
76
from string import ascii_lowercase
87
from .telenium_process import TeleniumTestProcess
@@ -56,7 +55,7 @@ def test_generate_random_address_label(self):
5655
"""Creating New Adress For New User."""
5756
# Checking the Button is rendered
5857
self.assertExists(
59-
'//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=1)
58+
'//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=5)
6059
# Click on Label Text Field to give address Label
6160
self.cli.wait_click(
6261
'//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=5)
@@ -88,30 +87,30 @@ def test_set_default_address(self):
8887
self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=5)
8988
self.assertExists(
9089
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
91-
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1
90+
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=5
9291
)
93-
is_open = self.cli.getattr(
92+
self.assertExists(
9493
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
95-
'/IdentitySpinner[@name=\"identity_dropdown\"][@is_open]', "is_open")
96-
self.assertEqual(is_open, False)
94+
'/IdentitySpinner[@name=\"identity_dropdown\"][@is_open=false]', timeout=5
95+
)
9796
self.cli.wait(
9897
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
9998
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5
10099
)
100+
# Click to open Address Dropdown
101101
self.cli.wait_click(
102102
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
103-
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1
103+
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=5
104104
)
105-
if self.cli.wait(
105+
self.cli.wait(
106106
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
107-
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5):
108-
sleep(0.2)
107+
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5
108+
)
109109
# Check the state of dropdown.
110-
is_open = self.cli.getattr(
110+
self.assertExists(
111111
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
112-
'/IdentitySpinner[@name=\"identity_dropdown\"][@is_open]', 'is_open'
112+
'/IdentitySpinner[@name=\"identity_dropdown\"][@is_open=true]', timeout=5
113113
)
114-
self.assertEqual(is_open, True)
115114
# List of addresses
116115
addresses_in_dropdown = self.cli.getattr(
117116
'//NavigationItem[0][@text=\"dropdown_nav_item\"]/IdentitySpinner[@values]', 'values'
@@ -122,3 +121,9 @@ def test_set_default_address(self):
122121
)
123122
# Selection of an address to set as a default address.
124123
self.cli.wait_click('//MySpinnerOption[0]', timeout=5)
124+
125+
self.assertExists(
126+
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
127+
'/IdentitySpinner[@name=\"identity_dropdown\"][@is_open=false]', timeout=5
128+
)
129+
self.cli.sleep(0.5)

0 commit comments

Comments
 (0)