Added failure scenario

This commit is contained in:
prachi 2020-05-02 20:55:15 +05:30
parent e4ce598ddb
commit 674030c8d0
No known key found for this signature in database
GPG Key ID: 2940E6901747AAAF
2 changed files with 88 additions and 29 deletions

View File

@ -28,6 +28,12 @@ class Bitmessage_Login_Screen(TeleniumTestCase):
def test_random_screen(self): def test_random_screen(self):
"""Creating New Adress For New User.""" """Creating New Adress For New User."""
print("=====================Test - Create New Address=====================") print("=====================Test - Create New Address=====================")
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Random[0]/ScrollView[0]/BoxLayout[0]/MDTextField[0]')
time.sleep(3)
self.cli.wait_click(u'/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Random[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/AnchorLayout[0]/MDRaisedButton[0]/MDLabel[0]')
time.sleep(3)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Random[0]/ScrollView[0]/BoxLayout[0]/MDTextField[0]')
time.sleep(3)
random_label = "" random_label = ""
for _ in range(10): for _ in range(10):
random_label += choice(ascii_lowercase) random_label += choice(ascii_lowercase)
@ -47,23 +53,23 @@ if __name__ == '__main__':
find_address=get_file.find("label") find_address=get_file.find("label")
print(find_address) print(find_address)
if find_address != -1: if find_address != -1:
select_address=test_telenium_cases.Bitmessage_Select_Address() # select_address=test_telenium_cases.Bitmessage_Select_Address()
select_address.test_check_already_created_address() # select_address.test_check_already_created_address()
select_address.test_calling_all_methods() # select_address.test_calling_all_methods()
sent_message=test_telenium_cases.Bitmessage_Sent_Screen_Message() # sent_message=test_telenium_cases.Bitmessage_Sent_Screen_Message()
sent_message.test_select_sent() # sent_message.test_select_sent()
sent_message.test_sent_multiple_message() # sent_message.test_sent_multiple_message()
inbox_message=test_telenium_cases.Bitmessage_Inbox_Screen_Message() # inbox_message=test_telenium_cases.Bitmessage_Inbox_Screen_Message()
inbox_message.test_all_inbox_method() # inbox_message.test_all_inbox_method()
sent_message.test_all_sent_method() # sent_message.test_all_sent_method()
# sent_message.test_archive_sent_message_from_list() # # sent_message.test_archive_sent_message_from_list()
draft_message=test_telenium_cases.Bitmessage_Draft_Screen_Message() # draft_message=test_telenium_cases.Bitmessage_Draft_Screen_Message()
draft_message.test_all_draft_method() # draft_message.test_all_draft_method()
trash_message=test_telenium_cases.Bitmessage_Trash_Screen_Message() # trash_message=test_telenium_cases.Bitmessage_Trash_Screen_Message()
trash_message.test_delete_trash_message() # trash_message.test_delete_trash_message()
all_mails=test_telenium_cases.Bitmessage_AllMail_Screen_Message() # all_mails=test_telenium_cases.Bitmessage_AllMail_Screen_Message()
all_mails.test_select_all_mails() # all_mails.test_select_all_mails()
all_mails.test_delete_message_from_draft() # all_mails.test_delete_message_from_draft()
address_book=test_telenium_cases.Bitmessage_AddressBook_Screen_Message() address_book=test_telenium_cases.Bitmessage_AddressBook_Screen_Message()
address_book.test_all_address_book_method() address_book.test_all_address_book_method()
setting=test_telenium_cases.Bitmessage_Setting_Screen() setting=test_telenium_cases.Bitmessage_Setting_Screen()

View File

@ -6,7 +6,7 @@ import os
data=[] data=[]
class Bitmessage_Create_New_Address(TeleniumTestCase): class Bitmessage_Create_New_Address(TeleniumTestCase):
"""Generate New Address Functionality Testing""" """Generate New Address Functionality Testing"""
def runTest(self): def runTest(self):
print(self,"-------------Welcome To Kivy Testing Application Thirteenth Page-------------") print(self,"-------------Welcome To Kivy Testing Application Thirteenth Page-------------")
@ -45,7 +45,7 @@ class Bitmessage_Select_Address(TeleniumTestCase):
print("=====================Test - Select Text From Second Address Created====================") print("=====================Test - Select Text From Second Address Created====================")
global data global data
time.sleep(3) time.sleep(3)
second_address=self.cli.getattr("//CustomTwoLineAvatarIconListItem[0]","secondary_text") second_address=self.cli.getattr("//CustomTwoLineAvatarIconListItem[0]","secondary_text")
first_address=self.cli.getattr("//CustomTwoLineAvatarIconListItem[1]","secondary_text") first_address=self.cli.getattr("//CustomTwoLineAvatarIconListItem[1]","secondary_text")
data.append(second_address) data.append(second_address)
data.append(first_address) data.append(first_address)
@ -127,23 +127,48 @@ class Bitmessage_Sent_Screen_Message(TeleniumTestCase):
time.sleep(1) time.sleep(1)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Inbox[0]/ComposerButton[0]/MDFloatingActionButton[0]/MDLabel[0]') self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Inbox[0]/ComposerButton[0]/MDFloatingActionButton[0]/MDLabel[0]')
time.sleep(3) time.sleep(3)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]') self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]')
time.sleep(3)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/MyTextInput[0]')
time.sleep(3)
self.cli.setattr('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/MyTextInput[0]',"text","second add")
time.sleep(3)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/MDTextField[0]')
time.sleep(4)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/MDTextField[1]')
time.sleep(4)
# time.sleep(3)
self.cli.click_on('//MDIconButton[2]')
time.sleep(3)
self.cli.click_on('//MDRaisedButton[0]')
time.sleep(5) time.sleep(5)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]')
time.sleep(2)
self.cli.click_on('//MyTextInput[0]') self.cli.click_on('//MyTextInput[0]')
time.sleep(3) time.sleep(3)
self.cli.setattr('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/MyTextInput[0]',"text",data[0]) self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/MDTextField[0]')
time.sleep(3) time.sleep(2)
self.cli.setattr('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/MDTextField[0]','text','heyyyyyy') self.cli.setattr('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/MDTextField[0]','text','heyyyyyy')
time.sleep(3) time.sleep(3)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/MDTextField[1]')
time.sleep(4)
random_label="" random_label=""
for char in "how are you this is message body": for char in "how are you this is message body":
random_label += char random_label += char
self.cli.setattr('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/MDTextField[1]','text',random_label) self.cli.setattr('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/MDTextField[1]','text',random_label)
time.sleep(0.2) time.sleep(0.2)
time.sleep(2) time.sleep(3)
self.cli.click_on('//MDIconButton[2]') self.cli.click_on('//MDIconButton[2]')
time.sleep(2) time.sleep(3)
self.cli.click_on('//MDRaisedButton[0]')
time.sleep(6)
self.cli.setattr('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Create[0]/DropDownWidget[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/MyTextInput[0]',"text",data[0])
time.sleep(3)
self.cli.click_on('//MDIconButton[2]')
time.sleep(3)
self.cli.click_on('//MDRaisedButton[0]')
time.sleep(3)
def test_sent_multiple_message(self): def test_sent_multiple_message(self):
"""Sending Second Message From Inbox Screen """Sending Second Message From Inbox Screen
for testing the search and delete functionality for two messages on the screen""" for testing the search and delete functionality for two messages on the screen"""
@ -395,20 +420,44 @@ class Bitmessage_AddressBook_Screen_Message(TeleniumTestCase):
def test_save_address(self): def test_save_address(self):
"""Save Address On Address Book Screen/Window""" """Save Address On Address Book Screen/Window"""
print("=====================Test -Save Address In Address Book=====================") print("=====================Test -Save Address In Address Book=====================")
time.sleep(3) time.sleep(6)
self.cli.execute('app.root.toggle_nav_drawer()') self.cli.execute('app.root.toggle_nav_drawer()')
time.sleep(4) time.sleep(4)
self.cli.drag("//NavigationDrawerSubheader[@text=\"All labels\"]","//NavigationDrawerIconButton[@text=\"All Mails\"]",1) self.cli.drag("//NavigationDrawerSubheader[@text=\"All labels\"]","//NavigationDrawerIconButton[@text=\"All Mails\"]",1)
time.sleep(4) time.sleep(3)
self.cli.click_on('//NavigationDrawerIconButton[6]') self.cli.click_on('//NavigationDrawerIconButton[6]')
time.sleep(4) time.sleep(4)
self.cli.execute('app.addingtoaddressbook()') self.cli.execute('app.addingtoaddressbook()')
time.sleep(3) time.sleep(3)
self.cli.click_on('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]')
time.sleep(4)
self.cli.click_on('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[1]')
time.sleep(4)
self.cli.click_on('//MDRaisedButton[0]')
time.sleep(4)
self.cli.click_on('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]')
time.sleep(3)
self.cli.setattr('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]','text','peter') self.cli.setattr('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]','text','peter')
time.sleep(3) time.sleep(3)
self.cli.setattr('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[1]','text','BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J') self.cli.click_on('//MDRaisedButton[0]')
time.sleep(4)
self.cli.click_on('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[1]')
time.sleep(3) time.sleep(3)
self.cli.wait_click('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[1]/MDRaisedButton[0]/MDLabel[0]') self.cli.setattr('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[1]','text','sectorAppartment')
time.sleep(3)
self.cli.click_on('//MDRaisedButton[0]')
time.sleep(5)
self.cli.click_on('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[1]')
time.sleep(3)
self.cli.setattr('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[1]','text',data[0])
time.sleep(3)
self.cli.setattr('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[1]','text','')
time.sleep(3)
self.cli.click_on('//MDRaisedButton[0]')
time.sleep(4)
self.cli.setattr('/GrashofPopup/GridLayout[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[1]','text','BM-2cX78L9CZpb6GGC3rRVizYiUBwHELMLybd')
time.sleep(3)
self.cli.click_on('//MDRaisedButton[0]')
time.sleep(4) time.sleep(4)
def test_cancel_address(self): def test_cancel_address(self):
@ -528,6 +577,10 @@ class Bitmessage_SubscriptionPayment_Screen(TeleniumTestCase):
time.sleep(3) time.sleep(3)
self.cli.click_on('//NavigationDrawerIconButton[8]') self.cli.click_on('//NavigationDrawerIconButton[8]')
time.sleep(3) time.sleep(3)
self.cli.drag('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Payment[0]/ScrollView[0]/BoxLayout[0]','/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Payment[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]',1)
time.sleep(2)
self.cli.drag('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Payment[0]/ScrollView[0]/BoxLayout[0]','/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Payment[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[2]',1)
time.sleep(2)
self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Payment[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDRaisedButton[0]/MDLabel[0]') self.cli.click_on('/NavigationLayout/BoxLayout[1]/FloatLayout[0]/BoxLayout[0]/ScreenManager[0]/Payment[0]/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDRaisedButton[0]/MDLabel[0]')
time.sleep(2) time.sleep(2)