added assert for popup and drag

This commit is contained in:
shekhar-cis 2021-07-22 15:34:32 +05:30
parent 114adacc92
commit dd5830505e
Signed by untrusted user: shekhar-cis
GPG Key ID: 8B2A6C8D5F7F1635
8 changed files with 81 additions and 93 deletions

View File

@ -7,7 +7,6 @@ data = [
'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr' 'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr'
] ]
class AddressBook(TeleniumTestProcess): class AddressBook(TeleniumTestProcess):
"""AddressBook Screen Functionality Testing""" """AddressBook Screen Functionality Testing"""
@ -15,8 +14,7 @@ class AddressBook(TeleniumTestProcess):
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=====================")
self.cli.sleep(12) self.cli.sleep(3)
# this is for checking current screen # this is for checking current screen
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=3) self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=3)
# this is for opening Nav drawer # this is for opening Nav drawer
@ -34,25 +32,25 @@ class AddressBook(TeleniumTestProcess):
# Click on Account-Plus Icon to opeb popup for add Address # Click on Account-Plus Icon to opeb popup for add Address
self.cli.execute('app.addingtoaddressbook()') self.cli.execute('app.addingtoaddressbook()')
# Click on Label field to check validation # Click on Label field to check validation
self.cli.wait_click('//GrashofPopup/BoxLayout[0]/MDTextField[0]', timeout=2) self.cli.wait_click('//GrashofPopup/BoxLayout[0]/MDTextField[@hint_text=\"Label\"]', timeout=2)
# Checking the Label Field shows Validation for empty string # Checking the Label Field shows Validation for empty string
self.assertExists('//GrashofPopup/BoxLayout[0]/MDTextField[@text=\"\"]', timeout=2) self.assertExists('//GrashofPopup/BoxLayout[0]/MDTextField[@text=\"\"]', timeout=2)
# # Click on Address Field # # Click on Address Field
self.cli.wait_click('//GrashofPopup/BoxLayout[0]/MDTextField[1]', timeout=2) self.cli.wait_click('//GrashofPopup/BoxLayout[0]/MDTextField[@hint_text=\"Address\"]', timeout=2)
# Checking the Address Field shows Validation for empty string # Checking the Address Field shows Validation for empty string
self.assertExists('//GrashofPopup/BoxLayout[0]/MDTextField[@text=\"\"]', timeout=2) self.assertExists('//GrashofPopup/BoxLayout[0]/MDTextField[@text=\"\"]', timeout=2)
# Click On save Button to check Field validation # Click On save Button to check Field validation
self.cli.wait_click('//MDRaisedButton[0]', timeout=2) self.cli.wait_click('//MDRaisedButton[0]', timeout=2)
# Add Label to label Field # Add Label to label Field
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[0]', 'text', 'test1') self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[@hint_text=\"Label\"]', 'text', 'test1')
# Add incorrect Address to Address Field to check validation # Add incorrect Address to Address Field to check validation
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]', 'text', data[0]) self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[@hint_text=\"Address\"]', 'text', data[0])
# Click on Save Button to check the address is correct or not # Click on Save Button to check the address is correct or not
self.cli.wait_click('//MDRaisedButton[0]') self.cli.wait_click('//MDRaisedButton[@text=\"Save\"]')
# Add Correct Address # Add Correct Address
self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[1]', 'text', 'BM-2cX78L9CZpb6GGC3rRVizYiUBwHELMLybd') self.cli.setattr('//GrashofPopup/BoxLayout[0]/MDTextField[@hint_text=\"Address\"]', 'text', 'BM-2cX78L9CZpb6GGC3rRVizYiUBwHELMLybd')
# Click on Save Button # Click on Save Button
self.cli.wait_click('//MDRaisedButton[0]', timeout=2) self.cli.wait_click('//MDRaisedButton[@text=\"Save\"]', timeout=2)
# Check Current Screen (Address Book) # Check Current Screen (Address Book)
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=2) self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=2)
# Checking Number of addresses increased # Checking Number of addresses increased
@ -92,7 +90,7 @@ class AddressBook(TeleniumTestProcess):
# Open and select Sender's Address from DropDown # Open and select Sender's Address from DropDown
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]', 'text', 'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr') self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]', 'text', 'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr')
# Checking the Sender's Field is Entered # Checking the Sender's Field is Entered
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]', '') self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[@text]', '')
# ADD SUBJECT # ADD SUBJECT
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Demo Subject') self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Demo Subject')
# Checking Subject Field is Entered # Checking Subject Field is Entered
@ -101,9 +99,9 @@ class AddressBook(TeleniumTestProcess):
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]',
'text', 'Hey,This is draft Message Body from Address Book') 'text', 'Hey,This is draft Message Body from Address Book')
# Checking Message body is Entered # Checking Message body is Entered
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', '') self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[@text]', '')
# Click on Send Icon # Click on Send Icon
self.cli.wait_click('//MDActionTopAppBarButton[2]', timeout=3) self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=3)
# After Click send, Screen is redirected to Inbox screen # After Click send, Screen is redirected to Inbox screen
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5) self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5)
@ -122,10 +120,16 @@ class AddressBook(TeleniumTestProcess):
# Checking current screen # Checking current screen
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=2) self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=2)
# Swipe to delete # Swipe to delete
self.cli.drag( self.assertTrue('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[@disabled]', 'True')
'//MDList[0]/SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]', self.cli.sleep(1)
'//MDList[0]/SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]',2) self.drag(
'//MDList[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
'//MDList[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]')
# Click on trash-can icon # Click on trash-can icon
self.cli.click_on('//MDList[0]/SwipeToDeleteItem[0]//MDIconButton[0]') self.cli.wait_click('//MDList[0]//SwipeToDeleteItem[0]', timeout=3)
# Checking the trash icon is acrivated
self.assertTrue('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[@disabled]', 'False')
# Click on trash icon
self.cli.click_on('//MDList[0]//MDIconButton[@icon=\"delete-forever\"]')
# Checking current screen # Checking current screen
self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=2) self.assertExists("//AddressBook[@name~=\"addressbook\"]", timeout=2)

View File

@ -1,7 +1,6 @@
from .telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
from .common import ordered from .common import ordered
class AllMailMessage(TeleniumTestProcess): class AllMailMessage(TeleniumTestProcess):
"""AllMail Screen Functionality Testing""" """AllMail Screen Functionality Testing"""
@ -33,6 +32,4 @@ class AllMailMessage(TeleniumTestProcess):
# CLicking on Trash-Can icon to delete Message # CLicking on Trash-Can icon to delete Message
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"delete-forever\"]', timeout=5) self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"delete-forever\"]', timeout=5)
# After deleting msg, screen is redirected to All mail screen # After deleting msg, screen is redirected to All mail screen
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=5) self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=5)

View File

@ -1,12 +1,10 @@
import os import os
import tempfile import tempfile
from .telenium_process import TeleniumTestProcess, cleanup from .telenium_process import TeleniumTestProcess, cleanup
from .common import ordered from .common import ordered
from random import choice from random import choice
from string import ascii_lowercase from string import ascii_lowercase
class CreateRandomAddress(TeleniumTestProcess): class CreateRandomAddress(TeleniumTestProcess):
"""This is for testing randrom address creation""" """This is for testing randrom address creation"""
@ -29,7 +27,6 @@ class CreateRandomAddress(TeleniumTestProcess):
# Checking Current Screen(Random Screen) after Clicking on Proceed Next Button # Checking Current Screen(Random Screen) after Clicking on Proceed Next Button
self.assertExists("//Random[@name~=\"random\"]", timeout=2) self.assertExists("//Random[@name~=\"random\"]", timeout=2)
@ordered @ordered
def test_random_screen(self): def test_random_screen(self):
"""Creating New Adress For New User.""" """Creating New Adress For New User."""
@ -51,7 +48,8 @@ class CreateRandomAddress(TeleniumTestProcess):
def test_create_new_address(self): def test_create_new_address(self):
"""Clicking on Navigation Drawer To Open New Address""" """Clicking on Navigation Drawer To Open New Address"""
print("=====================Test - Create New Address=====================") print("=====================Test - Create New Address=====================")
self.cli.sleep(5) # New screen is opening and transition effect takes time so Sleep is used
self.cli.sleep(3)
# this is for opening Nav drawer # this is for opening Nav drawer
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3) self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
# checking state of Nav drawer # checking state of Nav drawer
@ -67,7 +65,7 @@ class CreateRandomAddress(TeleniumTestProcess):
self.assertExists("//Login[@name~=\"login\"]", timeout=3) self.assertExists("//Login[@name~=\"login\"]", timeout=3)
# Click on Proceed Next button to enter 'Random' Screen # Click on Proceed Next button to enter 'Random' Screen
self.cli.wait_click( self.cli.wait_click(
'//Screen[0]/BoxLayout[0]/AnchorLayout[3]/MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=2) '//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=2)
# Checking Current Screen(Random Screen) after Clicking on Proceed Next Button # Checking Current Screen(Random Screen) after Clicking on Proceed Next Button
self.assertExists("//Random[@name~=\"random\"]", timeout=1) self.assertExists("//Random[@name~=\"random\"]", timeout=1)
# Executing above function to create new address # Executing above function to create new address
@ -93,4 +91,4 @@ class CreateRandomAddress(TeleniumTestProcess):
# Select address fron Address Dropdown # Select address fron Address Dropdown
self.cli.wait_click('//MySpinnerOption[0]', timeout=2) self.cli.wait_click('//MySpinnerOption[0]', timeout=2)
# Checking Landing Screen(Inbox) # Checking Landing Screen(Inbox)
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2) self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)

View File

@ -27,29 +27,29 @@ class DraftMessage(TeleniumTestProcess):
self.assertExists("//Create[@name~=\"create\"]", timeout=4) self.assertExists("//Create[@name~=\"create\"]", timeout=4)
# 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]/BoxLayout[0]/BoxLayout[0]/MDTextField[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=2)
# Open Sender's Address DropDown # Open Sender's Address DropDown
self.cli.wait_click( self.cli.wait_click(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]', timeout=2) '//DropDownWidget/ScrollView[0]//BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]', timeout=2)
# Due to animation and transition effect, it needed some halt otherwise it fails # Due to animation and transition effect, it needed some halt otherwise it fails
self.cli.sleep(2) self.cli.sleep(2)
# SENDER FIELD # SENDER FIELD
# Select Sender's Address from Dropdown # Select Sender's Address from Dropdown
self.cli.wait_click( self.cli.wait_click(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]', timeout=2) '//DropDownWidget/ScrollView[0]//BoxLayout[0]/CustomSpinner[0]', timeout=2)
self.cli.click_on('//ComposerSpinnerOption[0]') self.cli.click_on('//ComposerSpinnerOption[0]')
# Assert to check Sender's address dropdown open or not # Assert to check Sender's address dropdown open or not
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]', '') self.assertNotEqual('//DropDownWidget/ScrollView[0]//MDTextField[@text]', '')
# RECEIVER FIELD # RECEIVER FIELD
# Checking Receiver Address Field # Checking Receiver Address Field
self.assertExists('//DropDownWidget/ScrollView[0]/BoxLayout[0]/RelativeLayout[0]/BoxLayout[0]/MyTextInput[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"\"]', timeout=2)
# Entering Receiver Address # Entering Receiver Address
self.cli.setattr( self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/RelativeLayout[0]/BoxLayout[0]/MyTextInput[0]', "text", 'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J') '//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", 'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J')
# Checking Receiver Address filled or not # Checking Receiver Address filled or not
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/RelativeLayout[0]/BoxLayout[0]/MyTextInput[0]', '') self.assertNotEqual('//DropDownWidget/ScrollView[0]//MyTextInput[@text]', '')
# CLICK BACK-BUTTON # CLICK BACK-BUTTON
self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]', timeout=2) self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=2)
# Checking current screen(Login) after BACK Press # Checking current screen(Login) after BACK Press
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2) self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
self.cli.sleep(0.5) self.cli.sleep(0.5)
@ -59,32 +59,34 @@ class DraftMessage(TeleniumTestProcess):
self.assertExists("//Create[@name~=\"create\"]", timeout=4) self.assertExists("//Create[@name~=\"create\"]", timeout=4)
# 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]/BoxLayout[0]/BoxLayout[0]/MDTextField[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=2)
# Open Sender's Address DropDown # Open Sender's Address DropDown
self.cli.wait_click( self.cli.wait_click(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]', timeout=2) '//Create//CustomSpinner[0]/ArrowImg[0]', timeout=2)
# Due to animation and transition effect, it needed some halt otherwise it fails # Due to animation and transition effect, it needed some halt otherwise it fails
self.cli.sleep(2) self.cli.sleep(2)
# Select Sender's Address from Dropdown # Select Sender's Address from Dropdown
self.cli.wait_click( self.cli.wait_click(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/BoxLayout[0]/CustomSpinner[0]', timeout=2) '//DropDownWidget/ScrollView[0]//CustomSpinner[0]', timeout=2)
self.cli.click_on('//ComposerSpinnerOption[0]') self.cli.click_on('//ComposerSpinnerOption[0]')
# Assert to check Sender's address dropdown open or not # Assert to check Sender's address dropdown open or not
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/BoxLayout[0]/MDTextField[0]', '') self.assertNotEqual('//DropDownWidget/ScrollView[0]//MDTextField[@text]', '')
# RECEIVER FIELD # RECEIVER FIELD
# Checking Receiver Address Field # Checking Receiver Address Field
self.assertExists('//DropDownWidget/ScrollView[0]/BoxLayout[0]/RelativeLayout[0]/BoxLayout[0]/MyTextInput[@text=\"\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"\"]', timeout=2)
# Entering Receiver Address # Entering Receiver Address
self.cli.setattr( self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/RelativeLayout[0]/BoxLayout[0]/MyTextInput[0]', "text", 'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J') '//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", 'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J')
# Checking Receiver Address filled or not # Checking Receiver Address filled or not
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/RelativeLayout[0]/BoxLayout[0]/MyTextInput[0]', '') self.assertNotEqual('//DropDownWidget/ScrollView[0]//MyTextInput[@text]', '')
# ADD SUBJECT # ADD SUBJECT
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Another Draft message') self.cli.setattr('//DropDownWidget/ScrollView[0]//MyMDTextField[0]', 'text', 'Another Draft message')
# Checking Subject Field is Entered # Checking Subject Field is Entered
self.assertExists('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[@text=\"Another Draft message\"]', timeout=2) self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"Another Draft message\"]', timeout=2)
# CLICK BACK-BUTTON # CLICK BACK-BUTTON
self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]', timeout=2) self.cli.wait_click('//MDToolbar//MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=2)
# Checking current screen(Login) after BACK Press # Checking current screen(Login) after BACK Press
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2) self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
@ -105,21 +107,20 @@ class DraftMessage(TeleniumTestProcess):
# Due to animation and transition effect, it needed some halt otherwise it fails # Due to animation and transition effect, it needed some halt otherwise it fails
self.cli.sleep(1) self.cli.sleep(1)
# SHOW DRAFT MESSAGE AND SELECT FIRST MESSAGE # SHOW DRAFT MESSAGE AND SELECT FIRST MESSAGE
# self.cli.click_on('//Carousel[0]//TwoLineAvatarIconListItem[0]')
self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=2) self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=2)
# Checking current screen Mail Detail # Checking current screen Mail Detail
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=2) self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=2)
# CLICK EDIT BUTTON # CLICK EDIT BUTTON
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[0]', timeout=2) self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"pencil\"]', timeout=2)
# Checking Current Screen 'Create' # Checking Current Screen 'Create'
self.assertExists("//Create[@name~=\"create\"]", timeout=2) self.assertExists("//Create[@name~=\"create\"]", timeout=2)
# ADD MESSAGE BODY # ADD MESSAGE BODY
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[@text]',
'text', 'Hey,This is draft Message Body') 'text', 'Hey,This is draft Message Body')
# Checking Message body is Entered # Checking Message body is Entered
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', '') self.assertNotEqual('//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[@text]', '')
# Click on Send Icon # Click on Send Icon
self.cli.wait_click('//MDActionTopAppBarButton[2]', timeout=3) self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=3)
# After Click send, Screen is redirected to Inbox screen # After Click send, Screen is redirected to Inbox screen
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5) self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5)
@ -142,6 +143,6 @@ class DraftMessage(TeleniumTestProcess):
# Checking Current screen is Mail Detail # Checking Current screen is Mail Detail
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=3) self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=3)
# Click on trash-can icon to delete # Click on trash-can icon to delete
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]', timeout=2) self.cli.wait_click('//MDToolbar//MDActionTopAppBarButton[@icon=\"delete-forever\"]', timeout=2)
# After Deleting, Screen is redirected to Draft screen # After Deleting, Screen is redirected to Draft screen
self.assertExists("//Draft[@name~=\"draft\"]", timeout=1) self.assertExists("//Draft[@name~=\"draft\"]", timeout=1)

View File

@ -8,7 +8,6 @@ data = [
'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr' 'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr'
] ]
class MyAddressScreen(TeleniumTestProcess): class MyAddressScreen(TeleniumTestProcess):
"""MyAddress Screen Functionality Testing""" """MyAddress Screen Functionality Testing"""
@ -17,7 +16,6 @@ class MyAddressScreen(TeleniumTestProcess):
"""Select Address From List of Address""" """Select Address From List of Address"""
print("=====================Test -Select Address From List of Address=====================") print("=====================Test -Select Address From List of Address=====================")
self.cli.sleep(12) self.cli.sleep(12)
# this is for checking current screen # this is for checking current screen
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=3) self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=3)
# this is for opening Nav drawer # this is for opening Nav drawer
@ -34,7 +32,6 @@ class MyAddressScreen(TeleniumTestProcess):
# Checking current screen # Checking current screen
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=2) self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=2)
@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"""
@ -44,17 +41,16 @@ class MyAddressScreen(TeleniumTestProcess):
# Click on Address to open popup # Click on Address to open popup
self.cli.wait_click('//MDList[0]/CustomTwoLineAvatarIconListItem[0]', timeout=2) self.cli.wait_click('//MDList[0]/CustomTwoLineAvatarIconListItem[0]', timeout=2)
# Check the Popup is opened # Check the Popup is opened
self.assertExists('//MyaddDetailPopup/BoxLayout[1]/MDRaisedButton[1]/MDLabel[@text=\"Show QR code\"]', timeout=2) self.assertExists('//MyaddDetailPopup//MDLabel[@text=\"Show QR code\"]', timeout=2)
# 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/BoxLayout[1]/MDRaisedButton[1]/MDLabel[0]') self.cli.wait_click('//MyaddDetailPopup//MDLabel[@text=\"Show QR code\"]')
# 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=2)
# Click on BACK button # Click on BACK button
self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]', timeout=2) self.cli.wait_click('//MDToolbar//MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=2)
# Checking current screen(My Address) after BACK press # Checking current screen(My Address) after BACK press
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=2) self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=2)
@ordered @ordered
def test_send_message_from(self): def test_send_message_from(self):
"""Send Message From Send Message From Button""" """Send Message From Send Message From Button"""
@ -65,28 +61,27 @@ class MyAddressScreen(TeleniumTestProcess):
# Click on Address to open popup # Click on Address to open popup
self.cli.wait_click('//MDList[0]/CustomTwoLineAvatarIconListItem[0]', timeout=2) self.cli.wait_click('//MDList[0]/CustomTwoLineAvatarIconListItem[0]', timeout=2)
# Checking Popup Opened # Checking Popup Opened
self.assertExists('//MyaddDetailPopup/BoxLayout[1]/MDRaisedButton[0]/MDLabel[@text=\"Send message from\"]', timeout=2) self.assertExists('//MyaddDetailPopup//MDLabel[@text=\"Send message from\"]', timeout=2)
# Click on Send Message Button to redirect Create Screen # Click on Send Message Button to redirect Create Screen
self.cli.wait_click('//MyaddDetailPopup/BoxLayout[1]/MDRaisedButton[0]/MDLabel[0]', timeout=2) self.cli.wait_click('//MyaddDetailPopup//MDRaisedButton[0]/MDLabel[0]', timeout=2)
# Checking Current screen(Create ) # Checking Current screen(Create)
self.assertExists("//Create[@name~=\"create\"]", timeout=2) self.assertExists("//Create[@name~=\"create\"]", timeout=2)
# Entering Receiver Address # Entering Receiver Address
self.cli.setattr( self.cli.setattr(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/RelativeLayout[0]/BoxLayout[0]/MyTextInput[0]', "text", data[1]) '//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", data[1])
# Checking Receiver Address filled or not # Checking Receiver Address filled or not
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/RelativeLayout[0]/BoxLayout[0]/MyTextInput[0]', '') self.assertNotEqual('//DropDownWidget//MyTextInput[0]', '')
# ADD SUBJECT # ADD SUBJECT
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', 'text', 'Hey this is Demo Subject') self.cli.setattr('//DropDownWidget/ScrollView[0]//MyMDTextField[0]', 'text', 'Hey this is Demo Subject')
# Checking Subject Field is Entered # Checking Subject Field is Entered
# self.assertExists('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[@text=\"Hey this is Demo Subject\"]', timeout=2) self.assertNotEqual('//DropDownWidget/ScrollView[0]//MyMDTextField[0]', '')
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/MyMDTextField[0]', '')
# ADD MESSAGE BODY # ADD MESSAGE BODY
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', self.cli.setattr('//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[0]',
'text', 'Hey,i am sending message directly from MyAddress book') 'text', 'Hey,i am sending message directly from MyAddress book')
# Checking Message body is Entered # Checking Message body is Entered
self.assertNotEqual('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', '') self.assertNotEqual('//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[@text]', '')
# Click on Send Icon # Click on Send Icon
self.cli.wait_click('//MDActionTopAppBarButton[2]', timeout=3) self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=3)
self.cli.sleep(2) # Send Messages takes 2 seconds to send message so need to user sleep self.cli.sleep(2) # Send Messages takes 2 seconds to send message so need to user sleep
# Checking Current screen after Send a message # Checking Current screen after Send a message
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=3) self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=3)
@ -114,11 +109,12 @@ class MyAddressScreen(TeleniumTestProcess):
self.cli.sleep(1) self.cli.sleep(1)
self.cli.wait_click('//Thumb', timeout=2) self.cli.wait_click('//Thumb', timeout=2)
# CLICKING ON DISABLE ACCOUNT TO OPEN POPUP # CLICKING ON DISABLE ACCOUNT TO OPEN POPUP
self.click_on('//MyAddress/BoxLayout[0]/FloatLayout[0]/MDScrollViewRefreshLayout[0]/MDList[0]/CustomTwoLineAvatarIconListItem[0]', seconds=2) self.click_on('//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[0]', seconds=2)
# Checking the pop is Opened # Checking the pop is Opened
self.assertExists('//MDDialog[@text=\"Address is not currently active. Please click on Toggle button to active it.\"]', timeout=2) self.assertExists('//MDDialog[@text=\"Address is not currently active. Please click on Toggle button to active it.\"]', timeout=2)
# Clicking on 'Ok' Button To Dismiss the pop # Clicking on 'Ok' Button To Dismiss the pop
self.click_on('//MDFlatButton[@text=\"Ok\"]', seconds=2) self.click_on('//MDFlatButton[@text=\"Ok\"]', seconds=2)
self.assertNotExists('//MDDialog[@text=\"Address is not currently active. Please click on Toggle button to active it.\"]', timeout=2)
# ADDRESS ENABLED # ADDRESS ENABLED
self.click_on('//Thumb', seconds=2) self.click_on('//Thumb', seconds=2)
# self.assertExists('//Thumb[@active=\"False\"]', timeout=2) # self.assertExists('//Thumb[@active=\"False\"]', timeout=2)

View File

@ -30,6 +30,9 @@ class PaymentScreen(TeleniumTestProcess):
'//ProductCategoryLayout[0]/ProductLayout[0]') '//ProductCategoryLayout[0]/ProductLayout[0]')
# assert for checking scroll function # assert for checking scroll function
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=3) self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=3)
self.cli.sleep(2)
print(self.cli.getattr('//Payment//MDCustomBottomSheet//MDBottomSheet[0]', 'animation'), 'pop is open or not ----------------------------------------------````````````````````````````````````````````````````````````~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
self.cli.sleep(2)
# Click on BUY Button # Click on BUY Button
self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=2) self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=2)
# CLick on the Payment Method # CLick on the Payment Method

View File

@ -7,7 +7,6 @@ data = [
'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr' 'BM-2cVpswZo8rWLXDVtZEUNcDQvnvHJ6TLRYr'
] ]
class SendMessage(TeleniumTestProcess): class SendMessage(TeleniumTestProcess):
"""Sent Screen Functionality Testing""" """Sent Screen Functionality Testing"""
@ -74,10 +73,11 @@ class SendMessage(TeleniumTestProcess):
# 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=2)
# ADD BODY # ADD BODY
self.cli.setattr( self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]',
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[0]', 'text', 'how are you this is message body') 'text', 'how are you this is message body')
# Checking BODY is Entered # Checking BODY is Entered
self.assertExists('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[@text=\"how are you this is message body\"]', timeout=2) self.assertExists(
'//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[@text=\"how are you this is message body\"]', timeout=2)
# click on send icon # click on send icon
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=2) self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=2)
# Checking validation so Pop up is Opened # Checking validation so Pop up is Opened

View File

@ -1,25 +1,12 @@
from datetime import datetime
from os import wait
from socket import timeout
from time import sleep
from telenium.mods.telenium_client import selectFirst, kivythread, TeleniumMotionEvent, nextid, telenium_input, run_telenium
from .telenium_process import TeleniumTestProcess from .telenium_process import TeleniumTestProcess
class TrashMessage(TeleniumTestProcess): class TrashMessage(TeleniumTestProcess):
def smart_click(self, click_on, sleep):
click_on = self.cli.click_on(click_on)
sleep = self.cli.sleep(sleep)
"""Trash Screen Functionality Testing""" """Trash Screen Functionality Testing"""
def test_delete_trash_message(self): def test_delete_trash_message(self):
"""Delete Trash message permanently from trash message listing""" """Delete Trash message permanently from trash message listing"""
print("=====================Test -Delete Message From Trash Message Listing=====================") print("=====================Test -Delete Message From Trash Message Listing=====================")
self.cli.sleep(8) self.cli.sleep(3)
# this is for opening Nav drawer # this is for opening Nav drawer
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=5) self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=5)
# checking state of Nav drawer # checking state of Nav drawer
@ -29,14 +16,16 @@ class TrashMessage(TeleniumTestProcess):
# self.cli.click_on('//NavigationItem[4]') # self.cli.click_on('//NavigationItem[4]')
# Checking Trash Screen # Checking Trash Screen
self.assertExists("//Trash[@name~=\"trash\"]", timeout=5) self.assertExists("//Trash[@name~=\"trash\"]", timeout=5)
# Transition Effect taking time, so halt is required # Transition Effect taking time, so halt is required
self.cli.sleep(2) self.cli.sleep(2)
# Checking Popup is closed # Checking Trash Icon is in disable state
self.assertEqual(self.cli.getattr('//MDList[0]/CutsomSwipeToDeleteItem[0]', '_opens_process'), False) self.assertTrue('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[@disabled]', 'True')
# This is for swiping message to activate delete icon. # This is for swiping message to activate delete icon.
self.drag( self.drag(
'//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]', '//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
'//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]') '//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]')
# Assert to check the drag is worked (Trash icon Activated)
self.assertTrue('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[@disabled]', 'False')
# Checking Popup is Opened # Checking Popup is Opened
self.assertEqual(self.cli.getattr('//MDList[0]/CutsomSwipeToDeleteItem[0]', '_opens_process'), True) self.assertEqual(self.cli.getattr('//MDList[0]/CutsomSwipeToDeleteItem[0]', '_opens_process'), True)
self.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]', seconds=1) self.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]', seconds=1)