Create Test Case for Trash and AllMail Screen

This commit is contained in:
prachi 2020-04-23 22:00:15 +05:30
parent c96a6b87c0
commit 71468b8318
No known key found for this signature in database
GPG Key ID: 2940E6901747AAAF
2 changed files with 132 additions and 32 deletions

View File

@ -36,35 +36,55 @@ if __name__ == '__main__':
TeleniumTestCase.start_process() TeleniumTestCase.start_process()
TestBitMessageApp().runTest() TestBitMessageApp().runTest()
print("==================start from first screen=====================") print("==================start from first screen=====================")
TestBitMessageApp().test_login_screen() f=open("/home/cis/.config/PyBitmessage/keys.dat")
TestBitMessageApp().test_random_screen() get_file=f.read()
obj_3=test_telenium_cases.TestCreateNewAddress() find_address=get_file.find("label")
obj_3.test_create_new_address() print(find_address)
TestBitMessageApp().test_random_screen() if find_address != -1:
obj=test_telenium_cases.TestSelectAddress() select_address=test_telenium_cases.TestSelectAddress()
obj.test_select_second_address() select_address.test_check_already_created_address()
obj.test_select_address() select_address.test_calling_all_methods()
obj_1=test_telenium_cases.TestSentMessage() sent_message=test_telenium_cases.TestSentMessage()
obj_1.test_select_sent() sent_message.test_select_sent()
obj_1.test_sent_multiple_message() sent_message.test_sent_multiple_message()
obj_inbox=test_telenium_cases.TestInboxMessage() inbox_message=test_telenium_cases.TestInboxMessage()
obj_inbox.test_select_inbox_of_second_address() inbox_message.test_all_inbox_method()
obj_inbox.test_show_inbox_message() sent_message.test_all_sent_method()
obj_inbox.test_delete_inbox_message() # sent_message.test_archive_sent_message_from_list()
obj_1.test_show_sent_messgae_list() draft_message=test_telenium_cases.TestDraftMessage()
obj_1.test_serach_sent_messages() draft_message.test_all_draft_method()
obj_1.test_show_sent_message_body() trash_message=test_telenium_cases.TestTrashMessage()
obj_1.test_delete_sent_message_body() trash_message.test_delete_trash_message()
obj_1.test_delete_sent_message_from_list() all_mails=test_telenium_cases.TestAllMailsMessage()
obj_1.test_archive_sent_message_from_list() all_mails.test_select_all_mails()
obj_2=test_telenium_cases.TestDraftMessage() all_mails.test_delete_message_from_draft()
obj_2.test_select_draft_message() address_book=test_telenium_cases.TestAddressBookContact()
obj_2.test_edit_draft_messgae() address_book.test_all_address_book_method()
obj_2.test_delete_draft_message() else :
obj_5=test_telenium_cases.TestAddressBookContact() TestBitMessageApp().test_login_screen()
obj_5.test_save_address() TestBitMessageApp().test_random_screen()
obj_5.test_cancel_address() new_address=test_telenium_cases.TestCreateNewAddress()
obj_5.test_send_message_to_addressbook() new_address.test_create_new_address()
obj_5.test_delete_address_from_address_contact() TestBitMessageApp().test_random_screen()
select_address=test_telenium_cases.TestSelectAddress()
select_address.test_calling_all_methods()
sent_message=test_telenium_cases.TestSentMessage()
sent_message.test_select_sent()
sent_message.test_sent_multiple_message()
inbox_message=test_telenium_cases.TestInboxMessage()
inbox_message.test_all_inbox_method()
sent_message.test_all_sent_method()
# sent_message.test_archive_sent_message_from_list()
draft_message=test_telenium_cases.TestDraftMessage()
draft_message.test_all_draft_method()
trash_message=test_telenium_cases.TestTrashMessage()
trash_message.test_delete_trash_message()
all_mails=test_telenium_cases.TestAllMailsMessage()
all_mails.test_select_all_mails()
all_mails.test_delete_message_from_draft()
address_book=test_telenium_cases.TestAddressBookContact()
address_book.test_all_address_book_method()

View File

@ -25,6 +25,15 @@ class TestSelectAddress(TeleniumTestCase):
def runTest(self): def runTest(self):
print(self,"-------------Welcome To Kivy Testing Application second Page-------------") print(self,"-------------Welcome To Kivy Testing Application second Page-------------")
def test_check_already_created_address(self):
time.sleep(6)
self.cli.execute('app.root.toggle_nav_drawer()')
time.sleep(4)
self.cli.drag("//NavigationDrawerSubheader[@text=\"All labels\"]","//NavigationDrawerIconButton[@text=\"All Mails\"]",1)
time.sleep(3)
self.cli.click_on('//NavigationDrawerIconButton[12]')
time.sleep(4)
def test_select_second_address(self): def test_select_second_address(self):
global data global data
time.sleep(5) time.sleep(5)
@ -40,9 +49,15 @@ class TestSelectAddress(TeleniumTestCase):
time.sleep(5) time.sleep(5)
self.cli.click_on('//NavigationDrawerIconButton[0]') self.cli.click_on('//NavigationDrawerIconButton[0]')
time.sleep(5) time.sleep(5)
self.cli.click_on('//NDBadgeLabel[1]')
time.sleep(5)
self.cli.click_on('//NavigationDrawerIconButton[1]') self.cli.click_on('//NavigationDrawerIconButton[1]')
time.sleep(5) time.sleep(5)
def test_calling_all_methods(self):
self.test_select_second_address()
self.test_select_address()
class TestInboxMessage(TestSelectAddress): class TestInboxMessage(TestSelectAddress):
def runTest(self): def runTest(self):
@ -73,6 +88,11 @@ class TestInboxMessage(TestSelectAddress):
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Inbox[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/Button[0]') self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Inbox[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/Button[0]')
time.sleep(4) time.sleep(4)
def test_all_inbox_method(self):
self.test_select_inbox_of_second_address()
self.test_show_inbox_message()
self.test_delete_inbox_message()
class TestSentMessage(TestSelectAddress): class TestSentMessage(TestSelectAddress):
def runTest(self): def runTest(self):
@ -135,7 +155,7 @@ class TestSentMessage(TestSelectAddress):
time.sleep(2) time.sleep(2)
def test_show_sent_messgae_list(self): def test_show_sent_messgae_list(self):
time.sleep(5) time.sleep(5)
self.cli.execute('app.root.toggle_nav_drawer()') self.cli.execute('app.root.toggle_nav_drawer()')
time.sleep(5) time.sleep(5)
self.cli.click_on('//NavigationDrawerIconButton[0]') self.cli.click_on('//NavigationDrawerIconButton[0]')
@ -189,6 +209,13 @@ class TestSentMessage(TestSelectAddress):
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Sent[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/Button[0]') self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Sent[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/Button[0]')
time.sleep(4) time.sleep(4)
def test_all_sent_method(self):
self.test_show_sent_messgae_list()
self.test_serach_sent_messages()
self.test_show_sent_message_body()
self.test_delete_sent_message_body()
self.test_delete_sent_message_from_list()
class TestDraftMessage(TeleniumTestCase): class TestDraftMessage(TeleniumTestCase):
def runTest(self): def runTest(self):
@ -270,6 +297,52 @@ class TestDraftMessage(TeleniumTestCase):
time.sleep(5) time.sleep(5)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/Toolbar[0]/BoxLayout[2]/MDIconButton[1]/MDLabel[0]') self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/Toolbar[0]/BoxLayout[2]/MDIconButton[1]/MDLabel[0]')
time.sleep(2) time.sleep(2)
def test_all_draft_method(self):
self.test_select_draft_message()
self.test_edit_draft_messgae()
self.test_delete_draft_message()
class TestAllMailsMessage(TeleniumTestCase):
def runTest(self):
print(self,"-------------Welcome To Kivy Testing Application Sixth Page-------------")
def test_select_all_mails(self):
print("---------------Show All Mails----------------")
time.sleep(5)
self.cli.execute('app.root.toggle_nav_drawer()')
time.sleep(4)
self.cli.click_on('//NavigationDrawerIconButton[5]')
time.sleep(4)
def test_delete_message_from_draft(self):
print("------------Delete Message From Mails-----------")
time.sleep(4)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Allmails[0]/Allmails[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]')
time.sleep(5)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/Toolbar[0]/BoxLayout[2]/MDIconButton[0]/MDLabel[0]')
time.sleep(3)
class TestTrashMessage(TeleniumTestCase):
def runTest(self):
print(self,"-------------Welcome To Kivy Testing Application Fifth Page-------------")
def test_delete_trash_message(self):
print("---------Delete Trash Message Permanently-------------------")
time.sleep(6)
# self.cli.click_on('//NavigationDrawerIconButton[4]')
self.cli.execute('app.root.toggle_nav_drawer()')
time.sleep(4)
self.cli.click_on('//NavigationDrawerIconButton[4]')
time.sleep(4)
self.cli.drag('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Trash[0]/Trash[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/CustomTwoLineAvatarIconListItem[0]/BoxLayout[1]/AvatarSampleWidget[0]','/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Trash[0]/Trash[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/CustomTwoLineAvatarIconListItem[0]/BoxLayout[2]',1)
time.sleep(4)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Trash[0]/Trash[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/Button[0]')
time.sleep(5)
self.cli.click_on('//MDRaisedButton[0]')
time.sleep(4)
class TestAddressBookContact(TeleniumTestCase): class TestAddressBookContact(TeleniumTestCase):
@ -336,3 +409,10 @@ class TestAddressBookContact(TeleniumTestCase):
self.cli.drag('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/AddressBook[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/CustomTwoLineAvatarIconListItem[0]/BoxLayout[1]/AvatarSampleWidget[0]','/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/AddressBook[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/CustomTwoLineAvatarIconListItem[0]/BoxLayout[2]',1) self.cli.drag('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/AddressBook[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/CustomTwoLineAvatarIconListItem[0]/BoxLayout[1]/AvatarSampleWidget[0]','/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/AddressBook[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/CustomTwoLineAvatarIconListItem[0]/BoxLayout[2]',1)
time.sleep(2) time.sleep(2)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/AddressBook[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/Button[0]') self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/AddressBook[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]/RelativeLayout[1]/Button[0]')
def test_all_address_book_method(self):
self.test_save_address()
self.test_cancel_address()
self.test_send_message_to_addressbook()
self.test_delete_address_from_address_contact()