Fixing navbar in addressbook

This commit is contained in:
shekhar-cis 2022-12-02 12:16:09 +05:30
parent 2d327352e2
commit 346b1a4084
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
11 changed files with 116 additions and 67 deletions

View File

@ -78,7 +78,7 @@ class TeleniumTestProcess(TeleniumTestCase):
def drag(self, xpath1, xpath2): def drag(self, xpath1, xpath2):
"""this method is for dragging""" """this method is for dragging"""
self.cli.drag(xpath1, xpath2, 1) self.cli.drag(xpath1, xpath2, 1)
self.cli.sleep(0.3) self.cli.sleep(1)
def assertCheckScrollDown(self, selector, timeout=-1): def assertCheckScrollDown(self, selector, timeout=-1):
"""this method is for checking scroll""" """this method is for checking scroll"""
@ -92,7 +92,7 @@ class TeleniumTestProcess(TeleniumTestCase):
return False return False
if timeout > 0 and time() - start > timeout: if timeout > 0 and time() - start > timeout:
raise Exception("Timeout") raise Exception("Timeout")
sleep(0.1) sleep(0.5)
def assertCheckScrollUp(self, selector, timeout=-1): def assertCheckScrollUp(self, selector, timeout=-1):
"""this method is for checking scroll UP""" """this method is for checking scroll UP"""
@ -106,7 +106,7 @@ class TeleniumTestProcess(TeleniumTestCase):
return False return False
if timeout > 0 and time() - start > timeout: if timeout > 0 and time() - start > timeout:
raise Exception("Timeout") raise Exception("Timeout")
sleep(0.1) sleep(0.5)
def open_side_navbar(self): def open_side_navbar(self):
"""Common method for opening Side navbar (Side Drawer)""" """Common method for opening Side navbar (Side Drawer)"""

View File

@ -30,10 +30,10 @@ class AddressBook(TeleniumTestProcess):
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=5) self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=5)
# this is for opening addressbook screen # this is for opening addressbook screen
self.cli.wait_click('//NavigationItem[@text=\"Address Book\"]', timeout=5) self.cli.wait_click('//NavigationItem[@text=\"Address Book\"]', timeout=5)
# Checking current screen
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5)
# This is for checking the Side nav Bar is closed # This is for checking the Side nav Bar is closed
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5) self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
# Checking current screen
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5)
# Check for rendered button # Check for rendered button
self.assertExists('//ActionTopAppBarButton[@icon=\"account-plus\"]', timeout=5) self.assertExists('//ActionTopAppBarButton[@icon=\"account-plus\"]', timeout=5)
# Click on "Account-Plus' Icon to open popup to save a new Address # Click on "Account-Plus' Icon to open popup to save a new Address
@ -46,7 +46,7 @@ class AddressBook(TeleniumTestProcess):
self.cli.setattr('//AddAddressPopup/BoxLayout[0]/MDTextField[@hint_text=\"Label\"]', 'text', self.test_label) self.cli.setattr('//AddAddressPopup/BoxLayout[0]/MDTextField[@hint_text=\"Label\"]', 'text', self.test_label)
# Checking the Label Field should not be empty # Checking the Label Field should not be empty
self.assertExists( self.assertExists(
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format(self.test_label), timeout=2) '//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format(self.test_label), timeout=5)
# Add Correct Address # Add Correct Address
self.cli.setattr( self.cli.setattr(
'//AddAddressPopup/BoxLayout[0]/MDTextField[@hint_text=\"Address\"]', 'text', '//AddAddressPopup/BoxLayout[0]/MDTextField[@hint_text=\"Address\"]', 'text',
@ -57,15 +57,15 @@ class AddressBook(TeleniumTestProcess):
test_address['autoresponder_address']) test_address['autoresponder_address'])
# Validating the Label field # Validating the Label field
self.assertExists( self.assertExists(
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format(self.test_label), timeout=2) '//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format(self.test_label), timeout=5)
# Validating the Valid Address is entered # Validating the Valid Address is entered
self.assertExists( self.assertExists(
'//AddAddressPopup/BoxLayout[0]/MDTextField[1][@text=\"{}\"]'.format( '//AddAddressPopup/BoxLayout[0]/MDTextField[1][@text=\"{}\"]'.format(
test_address['autoresponder_address']), timeout=3) test_address['autoresponder_address']), timeout=5)
# Checking cancel button # Checking cancel button
self.assertExists('//MDRaisedButton[@text=\"Cancel\"]', timeout=5) self.assertExists('//MDRaisedButton[@text=\"Cancel\"]', timeout=5)
# Click on 'Cancel' Button to dismiss the popup # Click on 'Cancel' Button to dismiss the popup
self.cli.wait_click('//MDRaisedButton[@text=\"Cancel\"]', timeout=2) self.cli.wait_click('//MDRaisedButton[@text=\"Cancel\"]', timeout=5)
# Checking current screen # Checking current screen
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5) self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5)
@ -83,18 +83,18 @@ class AddressBook(TeleniumTestProcess):
self.cli.setattr('//AddAddressPopup/BoxLayout[0]/MDTextField[0]', 'text', 'test_label2') self.cli.setattr('//AddAddressPopup/BoxLayout[0]/MDTextField[0]', 'text', 'test_label2')
# Checking the Label Field should not be empty # Checking the Label Field should not be empty
self.assertExists( self.assertExists(
'//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format('test_label2'), timeout=2) '//AddAddressPopup/BoxLayout[0]/MDTextField[0][@text=\"{}\"]'.format('test_label2'), timeout=5)
# Add Address to Address Field # Add Address to Address Field
self.cli.setattr( self.cli.setattr(
'//AddAddressPopup/BoxLayout[0]/MDTextField[1]', 'text', test_address['recipient']) '//AddAddressPopup/BoxLayout[0]/MDTextField[1]', 'text', test_address['recipient'])
# Checking the Address Field should not be empty # Checking the Address Field should not be empty
self.assertExists( self.assertExists(
'//AddAddressPopup/BoxLayout[0]/MDTextField[1][@text=\"{}\"]'.format(test_address['recipient']), '//AddAddressPopup/BoxLayout[0]/MDTextField[1][@text=\"{}\"]'.format(test_address['recipient']),
timeout=2) timeout=5)
# Checking for "Cancel" button is rendered # Checking for "Cancel" button is rendered
self.assertExists('//MDRaisedButton[@text=\"Cancel\"]', timeout=5) self.assertExists('//MDRaisedButton[@text=\"Cancel\"]', timeout=5)
# Click on 'Cancel' Button to dismiss the popup # Click on 'Cancel' Button to dismiss the popup
self.cli.wait_click('//MDRaisedButton[@text=\"Cancel\"]', timeout=2) self.cli.wait_click('//MDRaisedButton[@text=\"Cancel\"]', timeout=5)
# Check Current Screen (Address Book) # Check Current Screen (Address Book)
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5) self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=5)
@ -103,13 +103,13 @@ class AddressBook(TeleniumTestProcess):
def test_send_message_to_saved_address(self): def test_send_message_to_saved_address(self):
"""This method is to send msg to the saved address from addressbook""" """This method is to send msg to the saved address from addressbook"""
# Checking the Message detail Dialog box is not opened # Checking the Message detail Dialog box is not opened
self.assertNotExists('//MDDialog', timeout=3) self.assertNotExists('//MDDialog', timeout=5)
# Checking the saved address is rendered # Checking the saved address is rendered
self.assertExists('//AddressBook/BoxLayout[0]//SwipeToDeleteItem[0]', timeout=5) self.assertExists('//AddressBook/BoxLayout[0]//SwipeToDeleteItem[0]', timeout=5)
# Click on a Address to open address Details popup # Click on a Address to open address Details popup
self.cli.wait_click('//AddressBook/BoxLayout[0]//SwipeToDeleteItem[0]', timeout=5) self.cli.wait_click('//AddressBook/BoxLayout[0]//SwipeToDeleteItem[0]', timeout=5)
# Checking the Message detail Dialog is opened # Checking the Message detail Dialog is opened
self.assertExists('//MDDialog', timeout=3) self.assertExists('//MDDialog', timeout=5)
# Checking the buttons are rendered # Checking the buttons are rendered
self.assertExists('//MDRaisedButton', timeout=5) self.assertExists('//MDRaisedButton', timeout=5)
# Click on the Send to message Button # Click on the Send to message Button
@ -132,9 +132,9 @@ class AddressBook(TeleniumTestProcess):
# Method to open side navbar (written in telenium_process.py) # Method to open side navbar (written in telenium_process.py)
self.open_side_navbar() self.open_side_navbar()
# this is for opening setting screen # this is for opening setting screen
self.cli.wait_click('//NavigationItem[@text=\"Address Book\"]', timeout=2) self.cli.wait_click('//NavigationItem[@text=\"Address Book\"]', timeout=5)
# checking state of Nav drawer(closed) # checking state of Nav drawer(closed)
self.assertExists("//MDNavigationDrawer[@state~=\"close\"]", timeout=2) self.assertExists("//MDNavigationDrawer[@state~=\"close\"]", timeout=5)
# Checking current screen # Checking current screen
self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=8) self.assertExists("//ScreenManager[@current=\"addressbook\"]", timeout=8)
# Checking the Address is rendered # Checking the Address is rendered

View File

@ -16,6 +16,7 @@ class AllMailMessage(TeleniumTestProcess):
self.open_side_navbar() self.open_side_navbar()
# this is for opening All Mail screen # this is for opening All Mail screen
self.cli.wait_click('//NavigationItem[@text=\"All Mails\"]', timeout=5) self.cli.wait_click('//NavigationItem[@text=\"All Mails\"]', timeout=5)
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
# Assert for checking Current Screen(All mail) # Assert for checking Current Screen(All mail)
self.assertExists("//ScreenManager[@current=\"allmails\"]", timeout=5) self.assertExists("//ScreenManager[@current=\"allmails\"]", timeout=5)
@ -25,7 +26,7 @@ class AllMailMessage(TeleniumTestProcess):
"""Delete Message From Message body of Mail Screen/Window""" """Delete Message From Message body of Mail Screen/Window"""
# click on a Message to get message details screen # click on a Message to get message details screen
self.cli.wait_click( self.cli.wait_click(
'//MDList[0]/CustomSwipeToDeleteItem[0]', timeout=3) '//MDList[0]/CustomSwipeToDeleteItem[0]', timeout=5)
# Assert for checking Current Screen(Mail Detail) # Assert for checking Current Screen(Mail Detail)
self.assertExists("//ScreenManager[@current=\"mailDetail\"]", timeout=5) self.assertExists("//ScreenManager[@current=\"mailDetail\"]", timeout=5)
# CLicking on Trash-Can icon to delete Message # CLicking on Trash-Can icon to delete Message

View File

@ -59,7 +59,7 @@ class CreateRandomAddress(TeleniumTestProcess):
'//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=1) '//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=1)
# Click on Label Text Field to give address Label # Click on Label Text Field to give address Label
self.cli.wait_click( self.cli.wait_click(
'//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=2) '//Random//RandomBoxlayout//MDTextField[@hint_text=\"Label\"]', timeout=5)
# Enter a Label Randomly # Enter a Label Randomly
random_label = "" random_label = ""
for _ in range(10): for _ in range(10):
@ -68,10 +68,10 @@ class CreateRandomAddress(TeleniumTestProcess):
self.cli.sleep(0.1) self.cli.sleep(0.1)
# Checking the Button is rendered # Checking the Button is rendered
self.assertExists( self.assertExists(
'//Random//RandomBoxlayout//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=3) '//Random//RandomBoxlayout//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
# Click on Proceed Next button to generate random Address # Click on Proceed Next button to generate random Address
self.cli.wait_click( self.cli.wait_click(
'//Random//RandomBoxlayout//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=3) '//Random//RandomBoxlayout//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
# Checking "My Address" Screen after creating a address # Checking "My Address" Screen after creating a address
self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5) self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5)
# Checking the new address is created # Checking the new address is created
@ -85,7 +85,7 @@ class CreateRandomAddress(TeleniumTestProcess):
# This is for opening side navbar # This is for opening side navbar
self.open_side_navbar() self.open_side_navbar()
# Click to open Address Dropdown # Click to open Address Dropdown
self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=2) self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=5)
self.assertExists( self.assertExists(
'//NavigationItem[0][@text=\"dropdown_nav_item\"]' '//NavigationItem[0][@text=\"dropdown_nav_item\"]'
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1 '/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1
@ -96,7 +96,7 @@ class CreateRandomAddress(TeleniumTestProcess):
self.assertEqual(is_open, False) self.assertEqual(is_open, False)
self.cli.wait( self.cli.wait(
'//NavigationItem[0][@text=\"dropdown_nav_item\"]' '//NavigationItem[0][@text=\"dropdown_nav_item\"]'
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=2 '/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5
) )
self.cli.wait_click( self.cli.wait_click(
'//NavigationItem[0][@text=\"dropdown_nav_item\"]' '//NavigationItem[0][@text=\"dropdown_nav_item\"]'
@ -104,7 +104,7 @@ class CreateRandomAddress(TeleniumTestProcess):
) )
if self.cli.wait( if self.cli.wait(
'//NavigationItem[0][@text=\"dropdown_nav_item\"]' '//NavigationItem[0][@text=\"dropdown_nav_item\"]'
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=2): '/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5):
sleep(0.2) sleep(0.2)
# Check the state of dropdown. # Check the state of dropdown.
is_open = self.cli.getattr( is_open = self.cli.getattr(

View File

@ -20,7 +20,7 @@ class DraftMessage(TeleniumTestProcess):
# Method to open side navbar # Method to open side navbar
self.open_side_navbar() self.open_side_navbar()
# this is for opening Draft screen # this is for opening Draft screen
self.cli.wait_click('//NavigationItem[@text=\"Draft\"]', timeout=2) self.cli.wait_click('//NavigationItem[@text=\"Draft\"]', timeout=5)
# Checking the drawer is in 'closed' state # Checking the drawer is in 'closed' state
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5) self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
# Checking Draft Screen # Checking Draft Screen
@ -70,9 +70,9 @@ class DraftMessage(TeleniumTestProcess):
# Checking Receiver Address filled or not # Checking Receiver Address filled or not
self.assertExists( self.assertExists(
'//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"{}\"]'.format(test_address['auto_responder']), '//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"{}\"]'.format(test_address['auto_responder']),
timeout=2) timeout=5)
# Checking the sender's Field is empty # Checking the sender's Field is empty
self.assertExists('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"\"]', timeout=3) self.assertExists('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"\"]', timeout=5)
# Assert to check Sender's address dropdown open or not # Assert to check Sender's address dropdown open or not
self.assertEqual(self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open'), False) self.assertEqual(self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open'), False)
# Open Sender's Address DropDown # Open Sender's Address DropDown
@ -88,7 +88,7 @@ class DraftMessage(TeleniumTestProcess):
# Checking sender address is selected # Checking sender address is selected
sender_address = self.cli.getattr('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text]', 'text') sender_address = self.cli.getattr('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text]', 'text')
self.assertExists( self.assertExists(
'//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"{}\"]'.format(sender_address), timeout=3) '//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"{}\"]'.format(sender_address), timeout=5)
# CLICK BACK-BUTTON # CLICK BACK-BUTTON
self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=5) self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=5)
# Checking current screen(Login) after "BACK" Press # Checking current screen(Login) after "BACK" Press
@ -104,11 +104,11 @@ class DraftMessage(TeleniumTestProcess):
# Checking messages in draft box # Checking messages in draft box
self.assertEqual(len(self.cli.select('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem')), 1) self.assertEqual(len(self.cli.select('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem')), 1)
# Wait to render the widget # Wait to render the widget
self.cli.wait('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=3) self.cli.wait('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=5)
# Click on a Message to view its details (Message Detail screen) # Click on a Message to view its details (Message Detail screen)
self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=5) self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=5)
# Checking current screen Mail Detail # Checking current screen Mail Detail
self.assertExists("//ScreenManager[@current=\"mailDetail\"]", timeout=3) self.assertExists("//ScreenManager[@current=\"mailDetail\"]", timeout=5)
# CLICK on EDIT(Pencil) BUTTON # CLICK on EDIT(Pencil) BUTTON
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"pencil\"]', timeout=5) self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"pencil\"]', timeout=5)
@ -117,11 +117,11 @@ class DraftMessage(TeleniumTestProcess):
# Checking the recipient is in the receiver field # Checking the recipient is in the receiver field
self.assertExists( self.assertExists(
'//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"{}\"]'.format(test_address['auto_responder']), '//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"{}\"]'.format(test_address['auto_responder']),
timeout=2) timeout=5)
# Checking the sender address is in the sender field # Checking the sender address is in the sender field
sender_address = self.cli.getattr('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text]', 'text') sender_address = self.cli.getattr('//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text]', 'text')
self.assertExists( self.assertExists(
'//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"{}\"]'.format(sender_address), timeout=3) '//DropDownWidget/ScrollView[0]//BoxLayout[1]/MDTextField[@text=\"{}\"]'.format(sender_address), timeout=5)
# Checking the subject text is in the subject field # Checking the subject text is in the subject field
self.assertExists( self.assertExists(
'//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"{}\"]'.format(self.test_subject), timeout=5) '//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"{}\"]'.format(self.test_subject), timeout=5)

View File

@ -12,7 +12,7 @@ class FileManagerOpening(TeleniumTestProcess):
# Method to open side navbar # Method to open side navbar
self.open_side_navbar() self.open_side_navbar()
# Click to open Address Dropdown # Click to open Address Dropdown
self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=2) self.assertExists('//NavigationItem[0][@text=\"dropdown_nav_item\"]', timeout=5)
self.assertExists( self.assertExists(
'//NavigationItem[0][@text=\"dropdown_nav_item\"]' '//NavigationItem[0][@text=\"dropdown_nav_item\"]'
'/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1 '/IdentitySpinner[@name=\"identity_dropdown\"]', timeout=1
@ -24,7 +24,7 @@ class FileManagerOpening(TeleniumTestProcess):
) )
self.cli.wait( self.cli.wait(
'//NavigationItem[0][@text=\"dropdown_nav_item\"]' '//NavigationItem[0][@text=\"dropdown_nav_item\"]'
'/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=2 '/IdentitySpinner[@name=\"identity_dropdown\"][@state=\"normal\"]', timeout=5
) )
self.cli.wait_click( self.cli.wait_click(
'//NavigationItem[0][@text=\"dropdown_nav_item\"]' '//NavigationItem[0][@text=\"dropdown_nav_item\"]'

View File

@ -25,6 +25,7 @@ class MyAddressScreen(TeleniumTestProcess):
self.assertExists('//NavigationItem[@text=\"My addresses\"]', timeout=5) self.assertExists('//NavigationItem[@text=\"My addresses\"]', timeout=5)
# this is for opening setting screen # this is for opening setting screen
self.cli.wait_click('//NavigationItem[@text=\"My addresses\"]', timeout=5) self.cli.wait_click('//NavigationItem[@text=\"My addresses\"]', timeout=5)
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
# Checking current screen # Checking current screen
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=5) self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=5)
@ -36,6 +37,7 @@ class MyAddressScreen(TeleniumTestProcess):
'//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[@text=\"test2\"]', '//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[@text=\"test2\"]',
'//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[@text=\"test1\"]' '//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[@text=\"test1\"]'
) )
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=10)
# Checking list of Addresses # Checking list of Addresses
self.assertExists("//MyAddress//CustomTwoLineAvatarIconListItem", timeout=5) self.assertExists("//MyAddress//CustomTwoLineAvatarIconListItem", timeout=5)
# Checking the Toggle button is rendered on addresses # Checking the Toggle button is rendered on addresses
@ -64,27 +66,17 @@ class MyAddressScreen(TeleniumTestProcess):
) )
# Clicking on 'Ok' Button To Dismiss the popup # Clicking on 'Ok' Button To Dismiss the popup
self.cli.wait_click('//MDFlatButton[@text=\"Ok\"]', timeout=5) self.cli.wait_click('//MDFlatButton[@text=\"Ok\"]', timeout=5)
# Check the thumb button on address # Checking the address is disabled
self.assertExists( self.assertExists(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn/Thumb", "//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn[@active=false]",
timeout=5 timeout=5
) )
# Clicking on toggle button to enable the address
self.cli.wait_click(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn/Thumb",
timeout=5
)
# Checking the address is enabled
self.assertExists(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn[@active=true]",
timeout=15
)
# Checking the current screen is MyAddress
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=5)
@ordered @ordered
def test_show_Qrcode(self): def test_show_Qrcode(self):
"""Show the Qr code of selected address""" """Show the Qr code of selected address"""
# Checking the current screen is MyAddress
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=5)
# Checking first label # Checking first label
self.assertExists( self.assertExists(
'//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[1][@text=\"test1\"]', '//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[1][@text=\"test1\"]',
@ -95,20 +87,66 @@ class MyAddressScreen(TeleniumTestProcess):
'//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[0][@text=\"test2\"]', '//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[0][@text=\"test2\"]',
timeout=5 timeout=5
) )
self.assertExists(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn[@active=false]",
timeout=5
)
self.assertExists(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test1\"]//ToggleBtn[@active=true]",
timeout=5
)
# Click on Address to open popup # Click on Address to open popup
self.cli.wait_click('//MDList[0]/CustomTwoLineAvatarIconListItem[@text=\"test1\"]', timeout=5) self.cli.wait_click('//MDList[0]/CustomTwoLineAvatarIconListItem[@text=\"test1\"]', timeout=5)
# Check the Popup is opened # Check the Popup is opened
self.assertExists('//MyaddDetailPopup//MDLabel[@text=\"Show QR code\"]', timeout=5) self.assertExists('//MyaddDetailPopup//MDLabel[@text=\"Show QR code\"]', timeout=5)
# Cick on 'Show QR code' button to view QR Code # Cick on 'Show QR code' button to view QR Code
self.cli.wait_click('//MyaddDetailPopup//MDLabel[@text=\"Show QR code\"]') self.cli.wait_click('//MyaddDetailPopup//MDLabel[@text=\"Show QR code\"]', timeout=5)
# Check Current screen is QR Code screen # Check Current screen is QR Code screen
self.assertExists("//ShowQRCode[@name~=\"showqrcode\"]", timeout=2) self.assertExists("//ShowQRCode[@name~=\"showqrcode\"]", timeout=5)
# Check BACK button # Check BACK button
self.assertExists('//ActionTopAppBarButton[@icon~=\"arrow-left\"]', timeout=5) self.assertExists('//ActionTopAppBarButton[@icon~=\"arrow-left\"]', timeout=5)
# Click on BACK button # Click on BACK button
self.cli.wait_click('//ActionTopAppBarButton[@icon~=\"arrow-left\"]', timeout=5) self.cli.wait_click('//ActionTopAppBarButton[@icon~=\"arrow-left\"]', timeout=5)
# Checking current screen(My Address) after BACK press # Checking current screen(My Address) after BACK press
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=5) self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=5)
# Checking first label
self.assertExists(
'//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[1][@text=\"test1\"]',
timeout=5
)
# Checking second label
self.assertExists(
'//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[0][@text=\"test2\"]',
timeout=5
)
self.cli.sleep(0.3)
@ordered
def test_enable_address(self):
"""Test to enable the disabled address"""
# Checking list of Addresses
self.assertExists("//MyAddress//CustomTwoLineAvatarIconListItem", timeout=5)
# Check the thumb button on address
self.assertExists(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn/Thumb",
timeout=5
)
# Checking the address is disabled
self.assertExists(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn[@active=false]",
timeout=5
)
self.cli.sleep(0.3)
# Clicking on toggle button to enable the address
self.cli.wait_click(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn/Thumb",
timeout=10
)
# Checking the address is enabled
self.assertExists(
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn[@active=true]",
timeout=10
)
@ordered @ordered
def test_send_message_from(self): def test_send_message_from(self):
@ -128,9 +166,9 @@ class MyAddressScreen(TeleniumTestProcess):
# Checking Popup Opened # Checking Popup Opened
self.assertExists('//MyaddDetailPopup//MDLabel[@text=\"Send message from\"]', timeout=5) self.assertExists('//MyaddDetailPopup//MDLabel[@text=\"Send message from\"]', timeout=5)
# Click on Send Message Button to redirect Create Screen # Click on Send Message Button to redirect Create Screen
self.cli.wait_click('//MyaddDetailPopup//MDRaisedButton[0]/MDLabel[0]', timeout=2) self.cli.wait_click('//MyaddDetailPopup//MDRaisedButton[0]/MDLabel[0]', timeout=5)
# Checking Current screen(Create) # Checking Current screen(Create)
self.assertExists("//Create[@name~=\"create\"]", timeout=2) self.assertExists("//Create[@name~=\"create\"]", timeout=5)
# Entering Receiver Address # Entering Receiver Address
self.cli.setattr( self.cli.setattr(
'//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", data[1]) '//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", data[1])

View File

@ -1,9 +1,12 @@
from .telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
from .common import skip_screen_checks
from .common import ordered
class PaymentScreen(TeleniumTestProcess): class PaymentScreen(TeleniumTestProcess):
"""SubscriptionPayment Screen Functionality Testing""" """SubscriptionPayment Screen Functionality Testing"""
@ordered
def test_select_subscription(self): def test_select_subscription(self):
"""Select Subscription From List of Subscriptions""" """Select Subscription From List of Subscriptions"""
# This is for checking Current screen # This is for checking Current screen
@ -13,7 +16,7 @@ class PaymentScreen(TeleniumTestProcess):
# Dragging from sent to inbox to get Payment tab # Dragging from sent to inbox to get Payment tab
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]") self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
# assert for checking scroll function # assert for checking scroll function
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=5) self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=10)
# this is for opening Payment screen # this is for opening Payment screen
self.cli.wait_click('//NavigationItem[@text=\"Purchase\"]', timeout=5) self.cli.wait_click('//NavigationItem[@text=\"Purchase\"]', timeout=5)
# Checking the navbar is in closed state # Checking the navbar is in closed state
@ -31,7 +34,12 @@ class PaymentScreen(TeleniumTestProcess):
'//ProductCategoryLayout[0]/ProductLayout[1]', '//ProductCategoryLayout[0]/ProductLayout[1]',
'//ProductCategoryLayout[0]/ProductLayout[0]') '//ProductCategoryLayout[0]/ProductLayout[0]')
# assert for checking scroll function # assert for checking scroll function
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=5) self.assertCheckScrollUp('//Payment//ScrollView[0]', timeout=10)
@skip_screen_checks
@ordered
def test_buy_option(self):
"""Check subscription"""
# Click on BUY Button # Click on BUY Button
self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=5) self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=5)
# CLick on the Payment Method # CLick on the Payment Method

View File

@ -20,17 +20,17 @@ class SendMessage(TeleniumTestProcess):
# Checking current Screen(Inbox screen) # Checking current Screen(Inbox screen)
self.assert_wait_no_except('//ScreenManager[@current]', timeout=10, value='inbox') self.assert_wait_no_except('//ScreenManager[@current]', timeout=10, value='inbox')
# Click on Composer Icon(Plus icon) # Click on Composer Icon(Plus icon)
self.cli.wait_click('//ComposerButton[0]/MDFloatingActionButton[@icon=\"plus\"]', timeout=2) self.cli.wait_click('//ComposerButton[0]/MDFloatingActionButton[@icon=\"plus\"]', timeout=5)
# Checking Message Composer Screen(Create) # Checking Message Composer Screen(Create)
self.assertExists("//ScreenManager[@current=\"create\"]", timeout=4) self.assertExists("//ScreenManager[@current=\"create\"]", timeout=5)
# Checking State of Sender's Address Input Field (should be Empty) # Checking State of Sender's Address Input Field (should be Empty)
self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=3) self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=5)
# Checking State of Receiver's Address Input Field (should be Empty) # Checking State of Receiver's Address Input Field (should be Empty)
self.assertExists('//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"\"]', timeout=5)
# Checking State of Subject Input Field (shoudl be Empty) # Checking State of Subject Input Field (shoudl be Empty)
self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"\"]', timeout=5)
# Click on Send Icon to check validation working # Click on Send Icon to check validation working
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=2) self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=5)
# Checking validation Pop up is Opened # Checking validation Pop up is Opened
self.assertExists('//MDDialog[@open]', timeout=5) self.assertExists('//MDDialog[@open]', timeout=5)
# Checking the 'Ok' Button is rendered # Checking the 'Ok' Button is rendered
@ -49,10 +49,10 @@ class SendMessage(TeleniumTestProcess):
Validate the half filled form and press back button to save message in draft box. Validate the half filled form and press back button to save message in draft box.
""" """
# Checking current screen (Msg composer screen) # Checking current screen (Msg composer screen)
self.assertExists("//ScreenManager[@current=\"create\"]", timeout=2) self.assertExists("//ScreenManager[@current=\"create\"]", timeout=5)
# ADD SENDER'S ADDRESS # ADD SENDER'S ADDRESS
# Checking State of Sender's Address Input Field (Empty) # Checking State of Sender's Address Input Field (Empty)
self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=5)
# Assert to check Sender's address dropdown closed # Assert to check Sender's address dropdown closed
is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open') is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
self.assertEqual(is_open, False) self.assertEqual(is_open, False)
@ -61,7 +61,7 @@ class SendMessage(TeleniumTestProcess):
# Checking the Address Dropdown is in open State # Checking the Address Dropdown is in open State
is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open') is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
# Select Sender's Address from Dropdown # Select Sender's Address from Dropdown
self.cli.wait_click('//ComposerSpinnerOption[0]', timeout=3) self.cli.wait_click('//ComposerSpinnerOption[0]', timeout=5)
# Assert to check Sender's address dropdown closed # Assert to check Sender's address dropdown closed
is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open') is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
self.assertEqual(is_open, False) self.assertEqual(is_open, False)
@ -69,7 +69,7 @@ class SendMessage(TeleniumTestProcess):
sender_address = self.cli.getattr( sender_address = self.cli.getattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[@text]', 'text') '//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[@text]', 'text')
self.assertExists( self.assertExists(
'//DropDownWidget/ScrollView[0]//MDTextField[@text=\"{}\"]'.format(sender_address), timeout=2) '//DropDownWidget/ScrollView[0]//MDTextField[@text=\"{}\"]'.format(sender_address), timeout=5)
# Assert check for empty Subject Field # Assert check for empty Subject Field
self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"\"]', timeout=5) self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"\"]', timeout=5)
# ADD SUBJECT # ADD SUBJECT
@ -78,14 +78,14 @@ class SendMessage(TeleniumTestProcess):
self.assertExists( self.assertExists(
'//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"{}\"]'.format(self.test_subject), timeout=5) '//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"{}\"]'.format(self.test_subject), timeout=5)
# Checking BODY Field(EMPTY) # Checking BODY Field(EMPTY)
self.assertExists('//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[@text=\"\"]', timeout=5)
# ADD BODY # ADD BODY
self.cli.setattr( self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', 'text', self.test_body) '//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', 'text', self.test_body)
# Checking BODY is Entered # Checking BODY is Entered
self.assertExists( self.assertExists(
'//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[@text=\"{}\"]'.format(self.test_body), '//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[@text=\"{}\"]'.format(self.test_body),
timeout=2) timeout=5)
# click on send icon # click on send icon
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=5) self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=5)
# Checking validation Pop up is Opened # Checking validation Pop up is Opened
@ -103,7 +103,7 @@ class SendMessage(TeleniumTestProcess):
""" """
# ADD RECEIVER ADDRESS # ADD RECEIVER ADDRESS
# Checking Receiver Address Field # Checking Receiver Address Field
self.assertExists('//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"\"]', timeout=5)
# Entering Receiver Address # Entering Receiver Address
self.cli.setattr( self.cli.setattr(
'//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", test_address['autoresponder_address']) '//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", test_address['autoresponder_address'])

View File

@ -18,6 +18,7 @@ class SettingScreen(TeleniumTestProcess):
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=10) self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=10)
# this is for opening setting screen # this is for opening setting screen
self.cli.wait_click('//NavigationItem[@text=\"Settings\"]', timeout=5) self.cli.wait_click('//NavigationItem[@text=\"Settings\"]', timeout=5)
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
# Checking current screen # Checking current screen
self.assertExists("//ScreenManager[@current=\"set\"]", timeout=5) self.assertExists("//ScreenManager[@current=\"set\"]", timeout=5)
# Scrolling down currrent screen # Scrolling down currrent screen

View File

@ -13,8 +13,9 @@ class TrashMessage(TeleniumTestProcess):
# Method to open side navbar # Method to open side navbar
self.open_side_navbar() self.open_side_navbar()
# this is for opening Trash screen # this is for opening Trash screen
self.cli.wait_click('//NavigationItem[@text=\"Trash\"]', timeout=2) self.cli.wait_click('//NavigationItem[@text=\"Trash\"]', timeout=5)
# Checking the drawer is in 'closed' state # Checking the drawer is in 'closed' state
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5) self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
# Checking Trash Screen # Checking Trash Screen
self.assertExists("//ScreenManager[@current=\"trash\"]", timeout=5) self.assertExists("//ScreenManager[@current=\"trash\"]", timeout=5)
self.cli.sleep(0.5)