2021-06-10 17:14:19 +02:00
|
|
|
from .telenium_process import TeleniumTestProcess
|
2021-03-11 08:43:26 +01:00
|
|
|
from .common import ordered
|
|
|
|
|
2021-04-08 14:09:05 +02:00
|
|
|
data = [
|
|
|
|
'BM-2cWmjntZ47WKEUtocrdvs19y5CivpKoi1h',
|
|
|
|
'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr'
|
|
|
|
]
|
2021-03-06 00:14:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
class AddressBook(TeleniumTestProcess):
|
|
|
|
"""AddressBook Screen Functionality Testing"""
|
|
|
|
|
2021-03-11 08:43:26 +01:00
|
|
|
@ordered
|
2021-03-06 00:14:43 +01:00
|
|
|
def test_save_address(self):
|
|
|
|
"""Save Address On Address Book Screen/Window"""
|
|
|
|
print("=====================Test -Save Address In Address Book=====================")
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(6)
|
2021-07-01 18:27:38 +02:00
|
|
|
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//NavigationItem[6]')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=0)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.execute('app.addingtoaddressbook()')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[1]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//MDRaisedButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[0]', 'text', 'test1')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//MDRaisedButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[1]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]', 'text', 'sectorAppartment')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//MDRaisedButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(5)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[1]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]', 'text', data[0])
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]', 'text', '')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//MDRaisedButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]', 'text', 'BM-2cX78L9CZpb6GGC3rRVizYiUBwHELMLybd')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//MDRaisedButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-07-01 18:27:38 +02:00
|
|
|
address_book_msgs = len(self.cli.select("//SwipeToDeleteItem"))
|
|
|
|
self.assertEqual(address_book_msgs, 1)
|
2021-03-06 00:14:43 +01:00
|
|
|
|
2021-03-11 08:43:26 +01:00
|
|
|
@ordered
|
2021-03-31 17:02:23 +02:00
|
|
|
def test_cancel_addressbook_popup(self):
|
2021-03-06 00:14:43 +01:00
|
|
|
"""Cancel Address"""
|
2021-03-31 17:02:23 +02:00
|
|
|
print("=====================Test -Cancel Address Add Popup=====================")
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.execute('app.addingtoaddressbook()')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[0]', 'text', 'test2')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]', 'text', data[0])
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//MDRaisedButton[1]')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=1)
|
2021-03-06 00:14:43 +01:00
|
|
|
|
2021-03-11 08:43:26 +01:00
|
|
|
@ordered
|
2021-03-06 00:14:43 +01:00
|
|
|
def test_send_message_to_addressbook(self):
|
|
|
|
"""Directly Send Message To The User"""
|
|
|
|
print("=====================Test -Directly Send Message To The User=====================")
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-05-20 16:07:56 +02:00
|
|
|
self.cli.click_on(
|
|
|
|
'//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/SwipeToDeleteItem[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//MDRaisedButton[0]')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//Create[@name~=\"create\"]", timeout=1)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.click_on(
|
|
|
|
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(2)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Second')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
random_label = ""
|
2021-03-06 00:14:43 +01:00
|
|
|
for char in "Hey This is Message From Address Book":
|
|
|
|
random_label += char
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.setattr(
|
|
|
|
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]', 'text', random_label)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(0.2)
|
2021-03-16 20:28:14 +01:00
|
|
|
self.cli.click_on('//MDActionTopAppBarButton[2]')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.cli.sleep(4)
|
|
|
|
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=1)
|
2021-03-06 00:14:43 +01:00
|
|
|
|
2021-03-11 08:43:26 +01:00
|
|
|
@ordered
|
2021-03-06 00:14:43 +01:00
|
|
|
def test_delete_address_from_address_contact(self):
|
|
|
|
"""Delete Address From Address Book"""
|
|
|
|
print("=====================Test -Delete Address From Address Book=====================")
|
2021-07-01 18:27:38 +02:00
|
|
|
self.cli.sleep(2)
|
|
|
|
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//NavigationItem[6]')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=1)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-05-19 10:27:10 +02:00
|
|
|
self.cli.drag(
|
2021-05-20 16:07:56 +02:00
|
|
|
'//MDList[0]/SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
|
|
|
|
'//MDList[0]/SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]', 1)
|
|
|
|
self.cli.click_on('//MDList[0]/SwipeToDeleteItem[0]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(2)
|
2021-05-20 16:07:56 +02:00
|
|
|
self.cli.click_on('//MDList[0]/SwipeToDeleteItem[0]//MDIconButton[0]')
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=2)
|