From cb3fa3b5102538ec24972f4dbbcf74ff83bb778d Mon Sep 17 00:00:00 2001 From: navjot Date: Thu, 25 Mar 2021 22:08:58 +0530 Subject: [PATCH] added test cases --- src/bitmessagekivy/baseclass/addressbook.py | 1 + src/bitmessagekivy/kv/maildetail.kv | 2 +- src/bitmessagekivy/mpybit.py | 2 +- src/bitmessagekivy/tests/test_addressbook.py | 105 ++++++++++++++++++ .../tests/test_allmail_message.py | 26 +++++ .../tests/test_draft_message.py | 92 +++++++++++++++ .../tests/test_myaddress_screen.py | 55 +++++++++ .../tests/test_network_screen.py | 18 +++ .../tests/test_payment_subscription.py | 25 +++++ src/bitmessagekivy/tests/test_sent_message.py | 99 +++++++++++++++++ .../tests/test_setting_screen.py | 16 +++ .../tests/test_trash_message.py | 22 ++++ 12 files changed, 461 insertions(+), 2 deletions(-) create mode 100644 src/bitmessagekivy/tests/test_addressbook.py create mode 100644 src/bitmessagekivy/tests/test_allmail_message.py create mode 100644 src/bitmessagekivy/tests/test_draft_message.py create mode 100644 src/bitmessagekivy/tests/test_myaddress_screen.py create mode 100644 src/bitmessagekivy/tests/test_network_screen.py create mode 100644 src/bitmessagekivy/tests/test_payment_subscription.py create mode 100644 src/bitmessagekivy/tests/test_sent_message.py create mode 100644 src/bitmessagekivy/tests/test_setting_screen.py create mode 100644 src/bitmessagekivy/tests/test_trash_message.py diff --git a/src/bitmessagekivy/baseclass/addressbook.py b/src/bitmessagekivy/baseclass/addressbook.py index 3066390b..c034e61e 100644 --- a/src/bitmessagekivy/baseclass/addressbook.py +++ b/src/bitmessagekivy/baseclass/addressbook.py @@ -154,6 +154,7 @@ class AddressBook(Screen): self.ids.tag_label.text = '' sqlExecute( "DELETE FROM addressbook WHERE address = '{}';".format(address)) + toast('Address Deleted') def close_pop(self, instance): """Pop is Canceled""" diff --git a/src/bitmessagekivy/kv/maildetail.kv b/src/bitmessagekivy/kv/maildetail.kv index 38b199df..e98b8661 100644 --- a/src/bitmessagekivy/kv/maildetail.kv +++ b/src/bitmessagekivy/kv/maildetail.kv @@ -78,7 +78,7 @@ canvas.before: Color: rgba: (0,0,0,1) - # Loader: + Loader: : diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 429268e3..23edff12 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -804,7 +804,7 @@ class NavigateApp(MDApp): """This method is used for loading screen on every click""" if instance.text == 'Inbox': self.root.ids.scr_mngr.current = 'inbox' - # self.root.ids.sc1.children[1].active = True + self.root.ids.sc1.children[1].active = True elif instance.text == 'All Mails': self.root.ids.scr_mngr.current = 'allmails' try: diff --git a/src/bitmessagekivy/tests/test_addressbook.py b/src/bitmessagekivy/tests/test_addressbook.py new file mode 100644 index 00000000..d2c6df41 --- /dev/null +++ b/src/bitmessagekivy/tests/test_addressbook.py @@ -0,0 +1,105 @@ +import time +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess +from bmconfigparser import BMConfigParser +from .common import ordered + +data = BMConfigParser().addresses() + + +class AddressBook(TeleniumTestProcess): + """AddressBook Screen Functionality Testing""" + + @ordered + def test_save_address(self): + """Save Address On Address Book Screen/Window""" + print("=====================Test -Save Address In Address Book=====================") + self.cli.sleep(6) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(4) + self.cli.drag("//NavigationItem[@text=\"Sent\"]","//NavigationItem[@text=\"Inbox\"]",1) + self.cli.sleep(3) + self.cli.click_on('//NavigationItem[6]') + self.cli.sleep(4) + self.cli.execute('app.addingtoaddressbook()') + self.cli.sleep(3) + self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[0]') + self.cli.sleep(4) + self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[1]') + self.cli.sleep(4) + self.cli.click_on('//MDRaisedButton[0]') + self.cli.sleep(4) + self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[0]') + self.cli.sleep(3) + self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[0]','text','test1') + self.cli.sleep(3) + self.cli.click_on('//MDRaisedButton[0]') + self.cli.sleep(4) + self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[1]') + self.cli.sleep(3) + self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]','text','sectorAppartment') + self.cli.sleep(3) + self.cli.click_on('//MDRaisedButton[0]') + self.cli.sleep(5) + self.cli.click_on('//GrashofPopup/BoxLayout[0]/MDTextField[1]') + self.cli.sleep(3) + self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]','text',data[0]) + self.cli.sleep(3) + self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]','text','') + self.cli.sleep(3) + self.cli.click_on('//MDRaisedButton[0]') + self.cli.sleep(4) + self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]','text','BM-2cX78L9CZpb6GGC3rRVizYiUBwHELMLybd') + self.cli.sleep(3) + self.cli.click_on('//MDRaisedButton[0]') + self.cli.sleep(4) + + @ordered + def test_cancel_addressbook_popup(self): + """Cancel Address""" + print("=====================Test -Cancel Address Add Popup=====================") + self.cli.sleep(3) + self.cli.execute('app.addingtoaddressbook()') + self.cli.sleep(3) + self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[0]','text','test2') + self.cli.sleep(3) + self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]','text',data[0]) + self.cli.sleep(3) + self.cli.click_on('//MDRaisedButton[1]') + + @ordered + def test_send_message_to_addressbook(self): + """Directly Send Message To The User""" + print("=====================Test -Directly Send Message To The User=====================") + self.cli.sleep(4) + self.cli.click_on('//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]') + self.cli.sleep(3) + self.cli.click_on('//MDRaisedButton[0]') + self.cli.sleep(3) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]') + self.cli.sleep(2) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]') + self.cli.sleep(3) + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Second') + self.cli.sleep(3) + 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) + self.cli.sleep(0.2) + self.cli.click_on('//MDActionTopAppBarButton[2]') + self.cli.sleep(2) + + @ordered + def test_delete_address_from_address_contact(self): + """Delete Address From Address Book""" + print("=====================Test -Delete Address From Address Book=====================") + self.cli.sleep(3) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(3) + self.cli.click_on('//NavigationItem[6]') + self.cli.sleep(3) + 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) + self.cli.sleep(2) + self.cli.click_on('//AddressBook/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//Button[0]') + self.cli.sleep(2) diff --git a/src/bitmessagekivy/tests/test_allmail_message.py b/src/bitmessagekivy/tests/test_allmail_message.py new file mode 100644 index 00000000..7efad3f1 --- /dev/null +++ b/src/bitmessagekivy/tests/test_allmail_message.py @@ -0,0 +1,26 @@ +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess +from .common import ordered + + +class AllMailMessage(TeleniumTestProcess): + """AllMail Screen Functionality Testing""" + + @ordered + def test_show_allmail_list(self): + """Show All Messages on Mail Screen/Window""" + print("=====================Test -Show Messages Of Mail Screen=====================") + self.cli.sleep(5) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(4) + self.cli.click_on('//NavigationItem[5]') + self.cli.sleep(4) + + @ordered + def test_delete_message_from_allmail_list(self): + """Delete Message From Message body of Mail Screen/Window""" + print("=====================Test -Delete Messages Of Mail Screen=====================") + self.cli.sleep(4) + self.cli.click_on('//Allmails[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]') + self.cli.sleep(5) + self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]') + self.cli.sleep(5) diff --git a/src/bitmessagekivy/tests/test_draft_message.py b/src/bitmessagekivy/tests/test_draft_message.py new file mode 100644 index 00000000..16d8d0fd --- /dev/null +++ b/src/bitmessagekivy/tests/test_draft_message.py @@ -0,0 +1,92 @@ +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess +from .common import ordered + + +class DraftMessage(TeleniumTestProcess): + """Draft Screen Functionality Testing""" + + @ordered + def test_save_draft_message(self): + """Select A Draft Screen From Navigaion-Drawer-Box Then + Send a drafted message """ + print("=====================Test - Select A Draft Screen From Navigaion-Drawer-Box=====================") + # OPEN NAVIGATION-DRAWER + self.cli.sleep(4) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(2) + # OPEN INBOX SCREEN + self.cli.click_on('//NavigationItem[1]') + self.cli.sleep(2) + # CLICK ON PLUS ICON BUTTON + self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]') + self.cli.sleep(3) + # SELECT - TO ADDRESS + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]') + self.cli.sleep(2) + self.cli.click_on('//MyTextInput[0]') + self.cli.sleep(3) + # ADD FROM MESSAGE + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]', "text",'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J') + self.cli.sleep(3) + # CLICK BACK-BUTTON + self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]') + self.cli.sleep(5) + self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]') + self.cli.sleep(3) + # SELECT - TO ADDRESS + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]') + self.cli.sleep(1) + self.cli.click_on('//MyTextInput[0]') + self.cli.sleep(3) + # ADD FROM MESSAGE + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]', "text",'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J') + self.cli.sleep(4) + random_label="" + for char in "Another Draft message": + random_label += char + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', random_label) + self.cli.sleep(0.2) + # CLICK BACK-BUTTON + self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]') + self.cli.sleep(4) + + @ordered + def test_edit_and_resend_draft_messgae(self): + """Select A Message From List of Messages Then + make changes and send it.""" + print("=====================Test - Edit A Message From Draft Screen=====================") + # OPEN NAVIGATION-DRAWER + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(4) + # OPEN DRAFT SCREEN + self.cli.click_on('//NavigationItem[3]') + self.cli.sleep(4) + # SHOW DRAFT MESSAGE AND SELECT FIRST MESSAGE + self.cli.click_on('//Carousel[0]//TwoLineAvatarIconListItem[0]') + self.cli.sleep(3) + # CLICK EDIT BUTTON + self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[0]') + self.cli.sleep(5) + random_label="" + for char in "Hey,This is draft Message Body": + random_label += char + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]', 'text', random_label) + self.cli.sleep(0.2) + self.cli.sleep(3) + self.cli.click_on('//MDActionTopAppBarButton[2]') + self.cli.sleep(5) + + @ordered + def test_delete_draft_message(self): + """Delete A Message From List of Messages""" + print("=====================Test - Delete A Message From List of Messages=====================") + self.cli.sleep(5) + # self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")') + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(4) + self.cli.click_on('//NavigationItem[3]') + self.cli.sleep(5) + self.cli.click_on('//Carousel[0]//TwoLineAvatarIconListItem[0]') + self.cli.sleep(5) + self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]') + self.cli.sleep(5) diff --git a/src/bitmessagekivy/tests/test_myaddress_screen.py b/src/bitmessagekivy/tests/test_myaddress_screen.py new file mode 100644 index 00000000..7fd7da3e --- /dev/null +++ b/src/bitmessagekivy/tests/test_myaddress_screen.py @@ -0,0 +1,55 @@ +from bmconfigparser import BMConfigParser +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess +from .common import ordered + +data = BMConfigParser().addresses() + + +class MyAddressScreen(TeleniumTestProcess): + """MyAddress Screen Functionality Testing""" + + @ordered + def test_select_myaddress_list(self): + """Select Address From List of Address""" + print("=====================Test -Select Address From List of Address=====================") + self.cli.sleep(4) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(3) + self.cli.drag("//NavigationItem[@text=\"Sent\"]","//NavigationItem[@text=\"Inbox\"]",1) + self.cli.sleep(3) + self.cli.click_on('//NavigationItem[11]') + self.cli.sleep(4) + + @ordered + def test_show_Qrcode(self): + """Show the Qr code of selected address""" + print("=====================Test -Show QR code of selected address=====================") + self.cli.sleep(4) + self.cli.click_on('//MyAddress/BoxLayout[0]/FloatLayout[0]/MDScrollViewRefreshLayout[0]/MDList[0]/CustomTwoLineAvatarIconListItem[0]') + self.cli.sleep(3) + self.cli.click_on('//MyaddDetailPopup/BoxLayout[1]/MDRaisedButton[1]/MDLabel[0]') + self.cli.sleep(3) + self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]') + self.cli.sleep(3) + + @ordered + def test_send_message_from(self): + """Send Message From Send Message From Button""" + print("=====================Test -Send Message From Send Message From Button=====================") + self.cli.sleep(4) + self.cli.click_on('//MyAddress/BoxLayout[0]/FloatLayout[0]/MDScrollViewRefreshLayout[0]/MDList[0]/CustomTwoLineAvatarIconListItem[0]') + self.cli.sleep(4) + self.cli.click_on('//MyaddDetailPopup/BoxLayout[1]/MDRaisedButton[0]/MDLabel[0]') + self.cli.sleep(3) + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput', "text", data[1]) + self.cli.sleep(3) + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Hey') + self.cli.sleep(3) + random_label="" + for char in "Hey,i am sending message directly from MyAddress book": + random_label += char + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]', 'text', random_label) + self.cli.sleep(0.2) + self.cli.sleep(2) + self.cli.click_on('//MDActionTopAppBarButton[2]') + self.cli.sleep(4) diff --git a/src/bitmessagekivy/tests/test_network_screen.py b/src/bitmessagekivy/tests/test_network_screen.py new file mode 100644 index 00000000..d0185389 --- /dev/null +++ b/src/bitmessagekivy/tests/test_network_screen.py @@ -0,0 +1,18 @@ +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess + + +class NetwrokStatusScreen(TeleniumTestProcess): + """NetwrokStatus Screen Functionality Testing""" + + def test_network_status(self): + """Show NetwrokStatus""" + print("=====================Test -Show NetwrokStatus=====================") + self.cli.sleep(4) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(3) + self.cli.drag("//NavigationItem[@text=\"Sent\"]","//NavigationItem[@text=\"Inbox\"]",1) + self.cli.sleep(3) + self.cli.click_on('//NavigationItem[10]') + self.cli.sleep(4) + self.cli.click_on('//NetworkStat/MDTabs[0]/MDTabsBar[0]/MDTabsScrollView[0]/MDGridLayout[0]/MDTabsLabel[1]') + self.cli.sleep(4) diff --git a/src/bitmessagekivy/tests/test_payment_subscription.py b/src/bitmessagekivy/tests/test_payment_subscription.py new file mode 100644 index 00000000..7f8341eb --- /dev/null +++ b/src/bitmessagekivy/tests/test_payment_subscription.py @@ -0,0 +1,25 @@ +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess + + +class PaymentScreen(TeleniumTestProcess): + """SubscriptionPayment Screen Functionality Testing""" + + def test_select_subscripton(self): + """Select Subscripton From List of Subscriptons""" + print("=====================Test -Select Subscripton From List of Subscriptons=====================") + self.cli.sleep(4) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(3) + self.cli.drag("//NavigationItem[@text=\"Sent\"]","//NavigationItem[@text=\"Inbox\"]",1) + self.cli.sleep(3) + self.cli.click_on('//NavigationItem[8]') + self.cli.sleep(3) + self.cli.drag('//Payment/BoxLayout[0]/ScrollView[0]/BoxLayout[0]/ProductCategoryLayout[0]/ProductLayout[1]', + '//Payment/BoxLayout[0]/ScrollView[0]/BoxLayout[0]/ProductCategoryLayout[0]/ProductLayout[0]', 1) + self.cli.sleep(2) + self.cli.click_on('//MDRaisedButton[3]') + self.cli.sleep(2) + self.cli.click_on('//ListItemWithLabel[0]') + self.cli.sleep(2) + self.cli.click_on('//MDRaisedButton[3]') + self.cli.sleep(2) diff --git a/src/bitmessagekivy/tests/test_sent_message.py b/src/bitmessagekivy/tests/test_sent_message.py new file mode 100644 index 00000000..dd04b881 --- /dev/null +++ b/src/bitmessagekivy/tests/test_sent_message.py @@ -0,0 +1,99 @@ +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess +from bmconfigparser import BMConfigParser +from .common import ordered + +data = BMConfigParser().addresses() + + +class SendMessage(TeleniumTestProcess): + """Sent Screen Functionality Testing""" + + @ordered + def test_send_message_and_validation(self): + """ + Sending Message From Inbox Screen + opens a pop-up(screen)which send message from sender to reciever + """ + print("=====================Test - Sending Message From Inbox Screen with validation Checks=====================") + self.cli.sleep(3) + # self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")') + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(2) + self.cli.click_on('//NavigationItem[1]') + self.cli.sleep(2) + self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]') + self.cli.sleep(3) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MyMDTextField[0]') + self.cli.sleep(3) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/MyTextInput[0]') + self.cli.sleep(3) + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/MyTextInput[0]', "text", "second add") + self.cli.sleep(3) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]') + self.cli.sleep(4) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]') + self.cli.sleep(4) + self.cli.click_on('//MDActionTopAppBarButton[2]') + self.cli.sleep(3) + self.cli.click_on('//MDFlatButton[0]') + self.cli.sleep(5) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]') + self.cli.sleep(2) + self.cli.click_on('//MyTextInput[0]') + self.cli.sleep(3) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]') + self.cli.sleep(2) + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'heyyyyyy') + self.cli.sleep(3) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]') + self.cli.sleep(4) + random_label="" + for char in "how are you this is message body": + random_label += char + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]','text',random_label) + self.cli.sleep(0.2) + self.cli.sleep(3) + self.cli.click_on('//MDActionTopAppBarButton[2]') + self.cli.sleep(3) + self.cli.click_on('//MDFlatButton[0]') + self.cli.sleep(6) + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]',"text", data[0]) + self.cli.sleep(3) + self.cli.click_on('//MDActionTopAppBarButton[2]') + self.cli.sleep(3) + + @ordered + def test_sent_multiple_messages(self): + """ + Sending Second Message From Inbox Screen + for testing the search and delete functionality for two messages on the screen + """ + print("=====================Test - Sending Message From Inbox Screen=====================") + self.cli.sleep(3) + # self.cli.execute('app.root.ids.nav_drawer.set_state("toggle")') + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(5) + self.cli.click_on('//NavigationItem[1]') + self.cli.sleep(3) + self.cli.click_on('//Inbox/ComposerButton[0]/MDFloatingActionButton[0]') + self.cli.sleep(3) + self.cli.click_on('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]') + self.cli.sleep(2) + self.cli.click_on('//MyTextInput[0]') + self.cli.sleep(3) + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[1]/BoxLayout[0]/MyTextInput[0]', "text", data[0]) + self.cli.sleep(3) + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Second') + self.cli.sleep(3) + random_label="" + for char in "Hey This Is Second Message Body": + random_label += char + self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/TextInput[0]',"text",random_label) + self.cli.sleep(0.2) + self.cli.sleep(2) + self.cli.click_on('//MDActionTopAppBarButton[2]') + self.cli.sleep(5) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(3) + self.cli.click_on('//NavigationItem[2]') + self.cli.sleep(3) diff --git a/src/bitmessagekivy/tests/test_setting_screen.py b/src/bitmessagekivy/tests/test_setting_screen.py new file mode 100644 index 00000000..b3773cb3 --- /dev/null +++ b/src/bitmessagekivy/tests/test_setting_screen.py @@ -0,0 +1,16 @@ +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess + + +class SettingScreen(TeleniumTestProcess): + """Setting Screen Functionality Testing""" + + def test_setting_screen(self): + """Show Setting Screen""" + print("=====================Test -Show Setting Screen=====================") + self.cli.sleep(3) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(3) + self.cli.drag("//NavigationItem[@text=\"Sent\"]","//NavigationItem[@text=\"Inbox\"]",1) + self.cli.sleep(3) + self.cli.click_on('//NavigationItem[7]') + self.cli.sleep(2) diff --git a/src/bitmessagekivy/tests/test_trash_message.py b/src/bitmessagekivy/tests/test_trash_message.py new file mode 100644 index 00000000..08c27fd4 --- /dev/null +++ b/src/bitmessagekivy/tests/test_trash_message.py @@ -0,0 +1,22 @@ +from bitmessagekivy.tests.telenium_process import TeleniumTestProcess + + +class TrashMessage(TeleniumTestProcess): + """Trash Screen Functionality Testing""" + + def test_delete_trash_message(self): + """Delete Trash message permanently from trash message listing""" + print("=====================Test -Delete Message From Trash Message Listing=====================") + self.cli.sleep(4) + self.cli.execute('app.clickNavDrawer()') + self.cli.sleep(4) + self.cli.click_on('//NavigationItem[4]') + self.cli.sleep(4) + self.cli.drag('//Trash/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//TwoLineAvatarIconListItem[0]/BoxLayout[0]', + '//Trash/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]', 2) + self.cli.sleep(4) + self.cli.click_on('//Trash/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/Carousel[0]//Button[0]') + self.cli.sleep(2) + # self.cli.click_on('//MDDialog/MDCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]') + self.cli.click_on('//MDDialog/DialogFakeCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]') + self.cli.sleep(4)