Skip to content

Commit 346b1a4

Browse files
committed
Fixing navbar in addressbook
1 parent 2d32735 commit 346b1a4

11 files changed

+116
-67
lines changed

src/bitmessagekivy/tests/telenium_process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def assert_wait_no_except(self, selector, timeout=-1, value='inbox'):
7878
def drag(self, xpath1, xpath2):
7979
"""this method is for dragging"""
8080
self.cli.drag(xpath1, xpath2, 1)
81-
self.cli.sleep(0.3)
81+
self.cli.sleep(1)
8282

8383
def assertCheckScrollDown(self, selector, timeout=-1):
8484
"""this method is for checking scroll"""
@@ -92,7 +92,7 @@ def assertCheckScrollDown(self, selector, timeout=-1):
9292
return False
9393
if timeout > 0 and time() - start > timeout:
9494
raise Exception("Timeout")
95-
sleep(0.1)
95+
sleep(0.5)
9696

9797
def assertCheckScrollUp(self, selector, timeout=-1):
9898
"""this method is for checking scroll UP"""
@@ -106,7 +106,7 @@ def assertCheckScrollUp(self, selector, timeout=-1):
106106
return False
107107
if timeout > 0 and time() - start > timeout:
108108
raise Exception("Timeout")
109-
sleep(0.1)
109+
sleep(0.5)
110110

111111
def open_side_navbar(self):
112112
"""Common method for opening Side navbar (Side Drawer)"""

src/bitmessagekivy/tests/test_addressbook.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def test_save_address(self):
3030
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=5)
3131
# this is for opening addressbook screen
3232
self.cli.wait_click('//NavigationItem[@text=\"Address Book\"]', timeout=5)
33-
# Checking current screen
34-
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5)
3533
# This is for checking the Side nav Bar is closed
3634
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
35+
# Checking current screen
36+
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5)
3737
# Check for rendered button
3838
self.assertExists('//ActionTopAppBarButton[@icon=\"account-plus\"]', timeout=5)
3939
# Click on "Account-Plus' Icon to open popup to save a new Address
@@ -46,7 +46,7 @@ def test_save_address(self):
4646
self.cli.setattr('//AddAddressPopup/BoxLayout[0]/MDTextField[@hint_text=\"Label\"]', 'text', self.test_label)
4747
# Checking the Label Field should not be empty
4848
self.assertExists(
49-
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format(self.test_label), timeout=2)
49+
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format(self.test_label), timeout=5)
5050
# Add Correct Address
5151
self.cli.setattr(
5252
'//AddAddressPopup/BoxLayout[0]/MDTextField[@hint_text=\"Address\"]', 'text',
@@ -57,15 +57,15 @@ def test_save_address(self):
5757
test_address['autoresponder_address'])
5858
# Validating the Label field
5959
self.assertExists(
60-
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format(self.test_label), timeout=2)
60+
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format(self.test_label), timeout=5)
6161
# Validating the Valid Address is entered
6262
self.assertExists(
6363
'//AddAddressPopup/BoxLayout[0]/MDTextField[1][@text=\"{}\"]'.format(
64-
test_address['autoresponder_address']), timeout=3)
64+
test_address['autoresponder_address']), timeout=5)
6565
# Checking cancel button
6666
self.assertExists('//MDRaisedButton[@text=\"Cancel\"]', timeout=5)
6767
# Click on 'Cancel' Button to dismiss the popup
68-
self.cli.wait_click('//MDRaisedButton[@text=\"Cancel\"]', timeout=2)
68+
self.cli.wait_click('//MDRaisedButton[@text=\"Cancel\"]', timeout=5)
6969
# Checking current screen
7070
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5)
7171

@@ -83,18 +83,18 @@ def test_dismiss_addressbook_popup(self):
8383
self.cli.setattr('//AddAddressPopup/BoxLayout[0]/MDTextField[0]', 'text', 'test_label2')
8484
# Checking the Label Field should not be empty
8585
self.assertExists(
86-
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format('test_label2'), timeout=2)
86+
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format('test_label2'), timeout=5)
8787
# Add Address to Address Field
8888
self.cli.setattr(
8989
'//AddAddressPopup/BoxLayout[0]/MDTextField[1]', 'text', test_address['recipient'])
9090
# Checking the Address Field should not be empty
9191
self.assertExists(
9292
'//AddAddressPopup/BoxLayout[0]/MDTextField[1][@text=\"{}\"]'.format(test_address['recipient']),
93-
timeout=2)
93+
timeout=5)
9494
# Checking for "Cancel" button is rendered
9595
self.assertExists('//MDRaisedButton[@text=\"Cancel\"]', timeout=5)
9696
# Click on 'Cancel' Button to dismiss the popup
97-
self.cli.wait_click('//MDRaisedButton[@text=\"Cancel\"]', timeout=2)
97+
self.cli.wait_click('//MDRaisedButton[@text=\"Cancel\"]', timeout=5)
9898
# Check Current Screen (Address Book)
9999
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5)
100100

@@ -103,13 +103,13 @@ def test_dismiss_addressbook_popup(self):
103103
def test_send_message_to_saved_address(self):
104104
"""This method is to send msg to the saved address from addressbook"""
105105
# Checking the Message detail Dialog box is not opened
106-
self.assertNotExists('//MDDialog', timeout=3)
106+
self.assertNotExists('//MDDialog', timeout=5)
107107
# Checking the saved address is rendered
108108
self.assertExists('//AddressBook/BoxLayout[0]//SwipeToDeleteItem[0]', timeout=5)
109109
# Click on a Address to open address Details popup
110110
self.cli.wait_click('//AddressBook/BoxLayout[0]//SwipeToDeleteItem[0]', timeout=5)
111111
# Checking the Message detail Dialog is opened
112-
self.assertExists('//MDDialog', timeout=3)
112+
self.assertExists('//MDDialog', timeout=5)
113113
# Checking the buttons are rendered
114114
self.assertExists('//MDRaisedButton', timeout=5)
115115
# Click on the Send to message Button
@@ -132,9 +132,9 @@ def test_delete_address_from_saved_address(self):
132132
# Method to open side navbar (written in telenium_process.py)
133133
self.open_side_navbar()
134134
# this is for opening setting screen
135-
self.cli.wait_click('//NavigationItem[@text=\"Address Book\"]', timeout=2)
135+
self.cli.wait_click('//NavigationItem[@text=\"Address Book\"]', timeout=5)
136136
# checking state of Nav drawer(closed)
137-
self.assertExists("//MDNavigationDrawer[@state~=\"close\"]", timeout=2)
137+
self.assertExists("//MDNavigationDrawer[@state~=\"close\"]", timeout=5)
138138
# Checking current screen
139139
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=8)
140140
# Checking the Address is rendered

src/bitmessagekivy/tests/test_allmail_message.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def test_show_allmail_list(self):
1616
self.open_side_navbar()
1717
# this is for opening All Mail screen
1818
self.cli.wait_click('//NavigationItem[@text=\"All Mails\"]', timeout=5)
19+
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
1920
# Assert for checking Current Screen(All mail)
2021
self.assertExists("//ScreenManager[@current=\"allmails\"]", timeout=5)
2122

@@ -25,7 +26,7 @@ def test_delete_message_from_allmail_list(self):
2526
"""Delete Message From Message body of Mail Screen/Window"""
2627
# click on a Message to get message details screen
2728
self.cli.wait_click(
28-
'//MDList[0]/CustomSwipeToDeleteItem[0]', timeout=3)
29+
'//MDList[0]/CustomSwipeToDeleteItem[0]', timeout=5)
2930
# Assert for checking Current Screen(Mail Detail)
3031
self.assertExists("//ScreenManager[@current=\"mailDetail\"]", timeout=5)
3132
# CLicking on Trash-Can icon to delete Message

src/bitmessagekivy/tests/test_create_random_address.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_generate_random_address_label(self):
5959
'//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=1)
6060
# Click on Label Text Field to give address Label
6161
self.cli.wait_click(
62-
'//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=2)
62+
'//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=5)
6363
# Enter a Label Randomly
6464
random_label = ""
6565
for _ in range(10):
@@ -68,10 +68,10 @@ def test_generate_random_address_label(self):
6868
self.cli.sleep(0.1)
6969
# Checking the Button is rendered
7070
self.assertExists(
71-
'//Random//RandomBoxlayout//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=3)
71+
'//Random//RandomBoxlayout//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
7272
# Click on Proceed Next button to generate random Address
7373
self.cli.wait_click(
74-
'//Random//RandomBoxlayout//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=3)
74+
'//Random//RandomBoxlayout//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
7575
# Checking "My Address" Screen after creating a address
7676
self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5)
7777
# Checking the new address is created
@@ -85,7 +85,7 @@ def test_set_default_address(self):
8585
# This is for opening side navbar
8686
self.open_side_navbar()
8787
# Click to open Address Dropdown
88-
self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=2)
88+
self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=5)
8989
self.assertExists(
9090
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
9191
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1
@@ -96,15 +96,15 @@ def test_set_default_address(self):
9696
self.assertEqual(is_open, False)
9797
self.cli.wait(
9898
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
99-
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=2
99+
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5
100100
)
101101
self.cli.wait_click(
102102
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
103103
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1
104104
)
105105
if self.cli.wait(
106106
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
107-
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=2):
107+
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5):
108108
sleep(0.2)
109109
# Check the state of dropdown.
110110
is_open = self.cli.getattr(

src/bitmessagekivy/tests/test_draft_message.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_draft_screen(self):
2020
# Method to open side navbar
2121
self.open_side_navbar()
2222
# this is for opening Draft screen
23-
self.cli.wait_click('//NavigationItem[@text=\"Draft\"]', timeout=2)
23+
self.cli.wait_click('//NavigationItem[@text=\"Draft\"]', timeout=5)
2424
# Checking the drawer is in 'closed' state
2525
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
2626
# Checking Draft Screen
@@ -70,9 +70,9 @@ def test_save_message_to_draft(self):
7070
# Checking Receiver Address filled or not
7171
self.assertExists(
7272
'//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"{}\"]'.format(test_address['auto_responder']),
73-
timeout=2)
73+
timeout=5)
7474
# Checking the sender's Field is empty
75-
self.assertExists('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"\"]', timeout=3)
75+
self.assertExists('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"\"]', timeout=5)
7676
# Assert to check Sender's address dropdown open or not
7777
self.assertEqual(self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open'), False)
7878
# Open Sender's Address DropDown
@@ -88,7 +88,7 @@ def test_save_message_to_draft(self):
8888
# Checking sender address is selected
8989
sender_address = self.cli.getattr('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text]', 'text')
9090
self.assertExists(
91-
'//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"{}\"]'.format(sender_address), timeout=3)
91+
'//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"{}\"]'.format(sender_address), timeout=5)
9292
# CLICK BACK-BUTTON
9393
self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=5)
9494
# Checking current screen(Login) after "BACK" Press
@@ -104,11 +104,11 @@ def test_edit_and_resend_draft_messgae(self):
104104
# Checking messages in draft box
105105
self.assertEqual(len(self.cli.select('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem')), 1)
106106
# Wait to render the widget
107-
self.cli.wait('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=3)
107+
self.cli.wait('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=5)
108108
# Click on a Message to view its details (Message Detail screen)
109109
self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=5)
110110
# Checking current screen Mail Detail
111-
self.assertExists("//ScreenManager[@current=\"mailDetail\"]", timeout=3)
111+
self.assertExists("//ScreenManager[@current=\"mailDetail\"]", timeout=5)
112112

113113
# CLICK on EDIT(Pencil) BUTTON
114114
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"pencil\"]', timeout=5)
@@ -117,11 +117,11 @@ def test_edit_and_resend_draft_messgae(self):
117117
# Checking the recipient is in the receiver field
118118
self.assertExists(
119119
'//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"{}\"]'.format(test_address['auto_responder']),
120-
timeout=2)
120+
timeout=5)
121121
# Checking the sender address is in the sender field
122122
sender_address = self.cli.getattr('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text]', 'text')
123123
self.assertExists(
124-
'//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"{}\"]'.format(sender_address), timeout=3)
124+
'//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"{}\"]'.format(sender_address), timeout=5)
125125
# Checking the subject text is in the subject field
126126
self.assertExists(
127127
'//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"{}\"]'.format(self.test_subject), timeout=5)

src/bitmessagekivy/tests/test_filemanager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_open_file_manager(self):
1212
# Method to open side navbar
1313
self.open_side_navbar()
1414
# Click to open Address Dropdown
15-
self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=2)
15+
self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=5)
1616
self.assertExists(
1717
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
1818
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1
@@ -24,7 +24,7 @@ def test_open_file_manager(self):
2424
)
2525
self.cli.wait(
2626
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'
27-
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=2
27+
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5
2828
)
2929
self.cli.wait_click(
3030
'//NavigationItem[0][@text=\"dropdown_nav_item\"]'

0 commit comments

Comments
 (0)