2021-03-06 00:14:43 +01:00
|
|
|
import time
|
|
|
|
from bitmessagekivy.tests.telenium_process import TeleniumTestProcess
|
2021-03-11 08:43:26 +01:00
|
|
|
from bmconfigparser import BMConfigParser
|
|
|
|
from .common import ordered
|
|
|
|
|
|
|
|
data = BMConfigParser().addresses()
|
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-03-06 00:14:43 +01:00
|
|
|
self.cli.execute('app.clickNavDrawer()')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(4)
|
2021-03-06 00:14:43 +01: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-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-03-06 00:14:43 +01:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[0]','text','peter')
|
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-03-06 00:14:43 +01: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-03-06 00:14:43 +01: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.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-03-06 00:14:43 +01: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-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_cancel_address(self):
|
|
|
|
"""Cancel Address"""
|
|
|
|
print("=====================Test -Cancel Address=====================")
|
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-03-06 00:14:43 +01:00
|
|
|
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[0]','text','prachi')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01: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-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-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[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-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01: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-03-06 00:14:43 +01:00
|
|
|
random_label=""
|
|
|
|
for char in "Hey This is Message From Address Book":
|
|
|
|
random_label += char
|
|
|
|
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-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//MDIconButton[2]')
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(2)
|
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-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.execute('app.clickNavDrawer()')
|
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-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(3)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.drag('//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//TwoLineAvatarIconListItem[0]/BoxLayout[0]',
|
|
|
|
'//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]', 2)
|
2021-03-11 19:48:09 +01:00
|
|
|
self.cli.sleep(2)
|
2021-03-06 00:14:43 +01:00
|
|
|
self.cli.click_on('//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//Button[0]')
|