2
2
Test for creating new identity
3
3
"""
4
4
5
- from time import sleep
6
5
from random import choice
7
6
from string import ascii_lowercase
8
7
from .telenium_process import TeleniumTestProcess
@@ -56,7 +55,7 @@ def test_generate_random_address_label(self):
56
55
"""Creating New Adress For New User."""
57
56
# Checking the Button is rendered
58
57
self .assertExists (
59
- '//Random//RandomBoxlayout//MDTextField[@hint_text=\" Label\" ]' , timeout = 1 )
58
+ '//Random//RandomBoxlayout//MDTextField[@hint_text=\" Label\" ]' , timeout = 5 )
60
59
# Click on Label Text Field to give address Label
61
60
self .cli .wait_click (
62
61
'//Random//RandomBoxlayout//MDTextField[@hint_text=\" Label\" ]' , timeout = 5 )
@@ -88,30 +87,30 @@ def test_set_default_address(self):
88
87
self .assertExists ('//NavigationItem[0][@text=\" dropdown_nav_item\" ]' , timeout = 5 )
89
88
self .assertExists (
90
89
'//NavigationItem[0][@text=\" dropdown_nav_item\" ]'
91
- '/IdentitySpinner[@name=\" identity_dropdown\" ]' , timeout = 1
90
+ '/IdentitySpinner[@name=\" identity_dropdown\" ]' , timeout = 5
92
91
)
93
- is_open = self .cli . getattr (
92
+ self .assertExists (
94
93
'//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
+ )
97
96
self .cli .wait (
98
97
'//NavigationItem[0][@text=\" dropdown_nav_item\" ]'
99
98
'/IdentitySpinner[@name=\" identity_dropdown\" ][@state=\" normal\" ]' , timeout = 5
100
99
)
100
+ # Click to open Address Dropdown
101
101
self .cli .wait_click (
102
102
'//NavigationItem[0][@text=\" dropdown_nav_item\" ]'
103
- '/IdentitySpinner[@name=\" identity_dropdown\" ]' , timeout = 1
103
+ '/IdentitySpinner[@name=\" identity_dropdown\" ]' , timeout = 5
104
104
)
105
- if self .cli .wait (
105
+ self .cli .wait (
106
106
'//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
+ )
109
109
# Check the state of dropdown.
110
- is_open = self .cli . getattr (
110
+ self .assertExists (
111
111
'//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
113
113
)
114
- self .assertEqual (is_open , True )
115
114
# List of addresses
116
115
addresses_in_dropdown = self .cli .getattr (
117
116
'//NavigationItem[0][@text=\" dropdown_nav_item\" ]/IdentitySpinner[@values]' , 'values'
@@ -122,3 +121,9 @@ def test_set_default_address(self):
122
121
)
123
122
# Selection of an address to set as a default address.
124
123
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