enhanced code quality
This commit is contained in:
parent
3d8992aed3
commit
3dba85fad9
|
@ -27,14 +27,15 @@ class CreateRandomAddress(TeleniumTestProcess):
|
||||||
# self.assertExists("//ScreenManager[@current=\"login\"]", timeout=5)
|
# self.assertExists("//ScreenManager[@current=\"login\"]", timeout=5)
|
||||||
start = time()
|
start = time()
|
||||||
deadline = start + 2
|
deadline = start + 2
|
||||||
|
|
||||||
while time() < deadline:
|
while time() < deadline:
|
||||||
try:
|
try:
|
||||||
# Clicking on Proceed Next Button to redirect to "random" screen
|
# Clicking on Proceed Next Button to redirect to "random" screen
|
||||||
self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
||||||
except:
|
except TeleniumHttpException:
|
||||||
# Checking Current Screen(Random Screen) after Clicking on "Proceed Next" Button
|
# Checking Current Screen(Random Screen) after Clicking on "Proceed Next" Button
|
||||||
self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
||||||
|
|
||||||
# if not is_checked:
|
# if not is_checked:
|
||||||
# # self.assertExists('//Screen[0]//AnchorLayout[1]//Check[@active=\"True\"]', timeout=5)
|
# # self.assertExists('//Screen[0]//AnchorLayout[1]//Check[@active=\"True\"]', timeout=5)
|
||||||
# self.cli.wait_click('//Screen[0]//AnchorLayout[1]//Check', timeout=2)
|
# self.cli.wait_click('//Screen[0]//AnchorLayout[1]//Check', timeout=2)
|
||||||
|
@ -72,19 +73,19 @@ class CreateRandomAddress(TeleniumTestProcess):
|
||||||
# self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=3)
|
# self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=3)
|
||||||
# import pdb; pdb.set_trace()
|
# import pdb; pdb.set_trace()
|
||||||
self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5)
|
self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5)
|
||||||
num_of_addresses = len(self.cli.select('//MDList[0]/CustomTwoLineAvatarIconListItem'))
|
# self.cli.sleep(10)
|
||||||
|
self.assertExists('//MDList[0]/CustomTwoLineAvatarIconListItem', timeout=10)
|
||||||
start = time()
|
# self.cli.sleep(5)
|
||||||
deadline = start + 6
|
# start = time()
|
||||||
while time() < deadline:
|
# deadline = start + 7
|
||||||
try:
|
# while time() < deadline:
|
||||||
if num_of_addresses >= 1:
|
# try:
|
||||||
self.assertEqual(num_of_addresses, 1)
|
# self.assertExists('//MDList[0]/CustomTwoLineAvatarIconListItem', timeout=7)
|
||||||
break
|
# except TeleniumHttpException:
|
||||||
except TeleniumHttpException:
|
# self.cli.sleep(0.1)
|
||||||
print('iexcept------------------------------------------')
|
# continue
|
||||||
continue
|
|
||||||
print(len(self.cli.select('//MDList[0]/CustomTwoLineAvatarIconListItem')), '>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
|
# print(len(self.cli.select('//MDList[0]/CustomTwoLineAvatarIconListItem')), '>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
|
||||||
# # Clicking on Proceed Next Button to redirect to "random" screen
|
# # Clicking on Proceed Next Button to redirect to "random" screen
|
||||||
# self.cli.sleep(5)
|
# self.cli.sleep(5)
|
||||||
# except:
|
# except:
|
||||||
|
|
|
@ -9,67 +9,14 @@ class DraftMessage(TeleniumTestProcess):
|
||||||
def test_save_draft_message(self):
|
def test_save_draft_message(self):
|
||||||
"""Select A Draft Screen From Navigaion-Drawer-Box Then
|
"""Select A Draft Screen From Navigaion-Drawer-Box Then
|
||||||
Send a drafted message """
|
Send a drafted message """
|
||||||
print("=====================Test - Select A Draft Screen From Navigaion-Drawer-Box=====================")
|
|
||||||
self.cli.sleep(8)
|
self.cli.sleep(8)
|
||||||
# this is for opening Nav drawer
|
# Checking current Screen(Login screen)
|
||||||
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
|
self.assert_wait_no_except('//ScreenManager[@current]', timeout=10, value='login')
|
||||||
# checking state of Nav drawer
|
|
||||||
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
|
|
||||||
# Click to open Inbox
|
|
||||||
self.cli.wait_click('//NavigationItem[@text=\"Inbox\"]', timeout=2)
|
|
||||||
# Checking Inbox Screen
|
|
||||||
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
|
|
||||||
# Due to animation and transition effect, it needed some halt otherwise it fails
|
|
||||||
self.cli.sleep(1)
|
|
||||||
# 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=2)
|
||||||
# Checking Message Composer Screen(Create)
|
# Checking Message Composer Screen(Create)
|
||||||
self.assertExists("//Create[@name~=\"create\"]", timeout=4)
|
self.assertExists("//ScreenManager[@current=\"create\"]", timeout=5)
|
||||||
# ADD SENDER'S ADDRESS
|
|
||||||
# Checking State of Sender's Address Input Field (Empty)
|
|
||||||
self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=2)
|
|
||||||
# Open Sender's Address DropDown
|
|
||||||
self.cli.wait_click(
|
|
||||||
'//DropDownWidget/ScrollView[0]//BoxLayout[0]/CustomSpinner[0]/ArrowImg[0]', timeout=2)
|
|
||||||
# Due to animation and transition effect, it needed some halt otherwise it fails
|
|
||||||
self.cli.sleep(2)
|
|
||||||
# SENDER FIELD
|
|
||||||
# Select Sender's Address from Dropdown
|
|
||||||
self.cli.wait_click(
|
|
||||||
'//DropDownWidget/ScrollView[0]//BoxLayout[0]/CustomSpinner[0]', timeout=2)
|
|
||||||
self.cli.click_on('//ComposerSpinnerOption[0]')
|
|
||||||
# Assert to check Sender's address dropdown open or not
|
|
||||||
self.assertNotEqual('//DropDownWidget/ScrollView[0]//MDTextField[@text]', '')
|
|
||||||
# RECEIVER FIELD
|
|
||||||
# Checking Receiver Address Field
|
|
||||||
self.assertExists('//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"\"]', timeout=2)
|
|
||||||
# Entering Receiver Address
|
|
||||||
self.cli.setattr(
|
|
||||||
'//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", 'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J')
|
|
||||||
# Checking Receiver Address filled or not
|
|
||||||
self.assertNotEqual('//DropDownWidget/ScrollView[0]//MyTextInput[@text]', '')
|
|
||||||
# CLICK BACK-BUTTON
|
|
||||||
self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=2)
|
|
||||||
# Checking current screen(Login) after BACK Press
|
|
||||||
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
|
|
||||||
self.cli.sleep(0.5)
|
|
||||||
# Click on Composer Icon(Plus icon)
|
|
||||||
self.cli.wait_click('//ComposerButton[0]/MDFloatingActionButton[@icon=\"plus\"]', timeout=2)
|
|
||||||
# Checking Message Composer Screen(Create)
|
|
||||||
self.assertExists("//Create[@name~=\"create\"]", timeout=4)
|
|
||||||
# ADD SENDER'S ADDRESS
|
|
||||||
# Checking State of Sender's Address Input Field (Empty)
|
|
||||||
self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=2)
|
|
||||||
|
|
||||||
# Open Sender's Address DropDown
|
|
||||||
self.cli.wait_click(
|
|
||||||
'//Create//CustomSpinner[0]/ArrowImg[0]', timeout=2)
|
|
||||||
# Due to animation and transition effect, it needed some halt otherwise it fails
|
|
||||||
self.cli.sleep(2)
|
|
||||||
# Select Sender's Address from Dropdown
|
|
||||||
self.cli.wait_click(
|
|
||||||
'//DropDownWidget/ScrollView[0]//CustomSpinner[0]', timeout=2)
|
|
||||||
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]//MDTextField[@text]', '')
|
self.assertNotEqual('//DropDownWidget/ScrollView[0]//MDTextField[@text]', '')
|
||||||
|
|
||||||
|
@ -81,68 +28,122 @@ class DraftMessage(TeleniumTestProcess):
|
||||||
'//DropDownWidget/ScrollView[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]//MyTextInput[@text]', '')
|
self.assertNotEqual('//DropDownWidget/ScrollView[0]//MyTextInput[@text]', '')
|
||||||
# ADD SUBJECT
|
|
||||||
self.cli.setattr('//DropDownWidget/ScrollView[0]//MyMDTextField[0]', 'text', 'Another Draft message')
|
|
||||||
# Checking Subject Field is Entered
|
|
||||||
self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"Another Draft message\"]', timeout=2)
|
|
||||||
# CLICK BACK-BUTTON
|
|
||||||
self.cli.wait_click('//MDToolbar//MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=2)
|
|
||||||
# Checking current screen(Login) after BACK Press
|
|
||||||
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
|
|
||||||
|
|
||||||
@ordered
|
is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
|
||||||
def test_edit_and_resend_draft_messgae(self):
|
self.assertEqual(is_open, False)
|
||||||
"""Select A Message From List of Messages Then
|
# Open Sender's Address DropDown
|
||||||
make changes and send it."""
|
self.cli.wait_click('//Create//CustomSpinner[0]/ArrowImg[0]', timeout=5)
|
||||||
print("=====================Test - Edit A Message From Draft Screen=====================")
|
# Checking the Address Dropdown is in open State
|
||||||
# OPEN NAVIGATION-DRAWER
|
is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
|
||||||
# this is for opening Nav drawer
|
# Select Sender's Address from Dropdown
|
||||||
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
|
self.cli.wait_click('//ComposerSpinnerOption[0]', timeout=5)
|
||||||
# checking state of Nav drawer
|
# Assert to check Sender's address dropdown closed
|
||||||
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
|
is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
|
||||||
# Click to open Draft Screen
|
self.assertEqual(is_open, False)
|
||||||
self.cli.wait_click('//NavigationItem[@text=\"Draft\"]', timeout=2)
|
self.cli.sleep(5)
|
||||||
# Checking Draft Screen
|
|
||||||
self.assertExists("//Draft[@name~=\"draft\"]", timeout=2)
|
# # CLICK BACK-BUTTON
|
||||||
# Due to animation and transition effect, it needed some halt otherwise it fails
|
# self.cli.wait_click('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=2)
|
||||||
self.cli.sleep(1)
|
# # Checking current screen(Login) after BACK Press
|
||||||
# SHOW DRAFT MESSAGE AND SELECT FIRST MESSAGE
|
# self.assertExists("//ScreenManager[@current=\"inbox\"]", timeout=4)
|
||||||
self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=2)
|
|
||||||
# Checking current screen Mail Detail
|
# self.cli.sleep(0.5)
|
||||||
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=2)
|
# # Click on Composer Icon(Plus icon)
|
||||||
# CLICK EDIT BUTTON
|
# self.cli.wait_click('//ComposerButton[0]/MDFloatingActionButton[@icon=\"plus\"]', timeout=2)
|
||||||
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"pencil\"]', timeout=2)
|
# # Checking Message Composer Screen(Create)
|
||||||
# Checking Current Screen 'Create'
|
# self.assertExists("//ScreenManager[@current=\"create\"]", timeout=4)
|
||||||
self.assertExists("//Create[@name~=\"create\"]", timeout=2)
|
# # ADD SENDER'S ADDRESS
|
||||||
# ADD MESSAGE BODY
|
# # Checking State of Sender's Address Input Field (Empty)
|
||||||
self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[@text]',
|
# self.assertExists('//DropDownWidget/ScrollView[0]//MDTextField[@text=\"\"]', timeout=2)
|
||||||
'text', 'Hey,This is draft Message Body')
|
|
||||||
# Checking Message body is Entered
|
# # Assert to check Sender's address dropdown is closed
|
||||||
self.assertNotEqual('//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[@text]', '')
|
# is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
|
||||||
# Click on Send Icon
|
# self.assertEqual(is_open, False)
|
||||||
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=3)
|
# # Open Sender's Address DropDown
|
||||||
# After Click send, Screen is redirected to Inbox screen
|
# self.cli.wait_click('//Create//CustomSpinner[0]/ArrowImg[0]', timeout=5)
|
||||||
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5)
|
# # Checking the Address Dropdown is in open State
|
||||||
|
# is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
|
||||||
|
# # Select Sender's Address from Dropdown
|
||||||
|
# self.cli.wait_click('//ComposerSpinnerOption[0]', timeout=3)
|
||||||
|
# # Assert to check Sender's address dropdown is closed
|
||||||
|
# is_open = self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open')
|
||||||
|
# self.assertEqual(is_open, False)
|
||||||
|
|
||||||
|
|
||||||
|
# # Assert to check Sender's address dropdown open or not
|
||||||
|
# self.assertNotEqual('//DropDownWidget/ScrollView[0]//MDTextField[@text]', '')
|
||||||
|
|
||||||
|
# # RECEIVER FIELD
|
||||||
|
# # Checking Receiver Address Field
|
||||||
|
# self.assertExists('//DropDownWidget/ScrollView[0]//MyTextInput[@text=\"\"]', timeout=2)
|
||||||
|
# # Entering Receiver Address
|
||||||
|
# self.cli.setattr(
|
||||||
|
# '//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", 'BM-2cSsuH1bUWBski8bvdqnK2DivMqQCeQA1J')
|
||||||
|
# # Checking Receiver Address filled or not
|
||||||
|
# self.assertNotEqual('//DropDownWidget/ScrollView[0]//MyTextInput[@text]', '')
|
||||||
|
# # ADD SUBJECT
|
||||||
|
# self.cli.setattr('//DropDownWidget/ScrollView[0]//MyMDTextField[0]', 'text', 'Another Draft message')
|
||||||
|
# # Checking Subject Field is Entered
|
||||||
|
# self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"Another Draft message\"]', timeout=2)
|
||||||
|
# # CLICK BACK-BUTTON
|
||||||
|
# self.cli.wait_click('//MDToolbar//MDActionTopAppBarButton[@icon=\"arrow-left\"]', timeout=2)
|
||||||
|
# # Checking current screen(Login) after BACK Press
|
||||||
|
# self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
|
||||||
|
|
||||||
|
# @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
|
||||||
|
# # this is for opening Nav drawer
|
||||||
|
# self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
|
||||||
|
# # checking state of Nav drawer
|
||||||
|
# self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
|
||||||
|
# # Click to open Draft Screen
|
||||||
|
# self.cli.wait_click('//NavigationItem[@text=\"Draft\"]', timeout=2)
|
||||||
|
# # Checking Draft Screen
|
||||||
|
# self.assertExists("//Draft[@name~=\"draft\"]", timeout=2)
|
||||||
|
# # Due to animation and transition effect, it needed some halt otherwise it fails
|
||||||
|
# self.cli.sleep(1)
|
||||||
|
# # SHOW DRAFT MESSAGE AND SELECT FIRST MESSAGE
|
||||||
|
# self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=2)
|
||||||
|
# # Checking current screen Mail Detail
|
||||||
|
# self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=2)
|
||||||
|
# # CLICK EDIT BUTTON
|
||||||
|
# self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"pencil\"]', timeout=2)
|
||||||
|
# # Checking Current Screen 'Create'
|
||||||
|
# self.assertExists("//Create[@name~=\"create\"]", timeout=2)
|
||||||
|
# # ADD MESSAGE BODY
|
||||||
|
# self.cli.setattr('//DropDownWidget/ScrollView[0]/BoxLayout[0]/ScrollView[0]/MDTextField[@text]',
|
||||||
|
# 'text', 'Hey,This is draft Message Body')
|
||||||
|
# # Checking Message body is Entered
|
||||||
|
# self.assertNotEqual('//DropDownWidget/ScrollView[0]//ScrollView[0]/MDTextField[@text]', '')
|
||||||
|
# # Click on Send Icon
|
||||||
|
# self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=3)
|
||||||
|
# # After Click send, Screen is redirected to Inbox screen
|
||||||
|
# self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=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(2)
|
||||||
|
# # OPEN NAVIGATION-DRAWER
|
||||||
|
# # this is for opening Nav drawer
|
||||||
|
# self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
|
||||||
|
# # checking state of Nav drawer
|
||||||
|
# self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
|
||||||
|
# # Click to open Draft Screen
|
||||||
|
# self.cli.wait_click('//NavigationItem[@text=\"Draft\"]', timeout=2)
|
||||||
|
# # Checking Draft Screen
|
||||||
|
# self.assertExists("//Draft[@name~=\"draft\"]", timeout=2)
|
||||||
|
# self.cli.sleep(1)
|
||||||
|
# self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=3)
|
||||||
|
# # Checking Current screen is Mail Detail
|
||||||
|
# self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=3)
|
||||||
|
# # Click on trash-can icon to delete
|
||||||
|
# self.cli.wait_click('//MDToolbar//MDActionTopAppBarButton[@icon=\"delete-forever\"]', timeout=2)
|
||||||
|
# # After Deleting, Screen is redirected to Draft screen
|
||||||
|
# self.assertExists("//Draft[@name~=\"draft\"]", timeout=1)
|
||||||
|
|
||||||
@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(2)
|
|
||||||
# OPEN NAVIGATION-DRAWER
|
|
||||||
# this is for opening Nav drawer
|
|
||||||
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
|
|
||||||
# checking state of Nav drawer
|
|
||||||
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
|
|
||||||
# Click to open Draft Screen
|
|
||||||
self.cli.wait_click('//NavigationItem[@text=\"Draft\"]', timeout=2)
|
|
||||||
# Checking Draft Screen
|
|
||||||
self.assertExists("//Draft[@name~=\"draft\"]", timeout=2)
|
|
||||||
self.cli.sleep(1)
|
|
||||||
self.cli.wait_click('//SwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]', timeout=3)
|
|
||||||
# Checking Current screen is Mail Detail
|
|
||||||
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=3)
|
|
||||||
# Click on trash-can icon to delete
|
|
||||||
self.cli.wait_click('//MDToolbar//MDActionTopAppBarButton[@icon=\"delete-forever\"]', timeout=2)
|
|
||||||
# After Deleting, Screen is redirected to Draft screen
|
|
||||||
self.assertExists("//Draft[@name~=\"draft\"]", timeout=1)
|
|
||||||
|
|
|
@ -2,15 +2,15 @@ from telenium.client import TeleniumHttpException
|
||||||
from .telenium_process import TeleniumTestProcess
|
from .telenium_process import TeleniumTestProcess
|
||||||
from .common import ordered
|
from .common import ordered
|
||||||
|
|
||||||
test_address = {'receiver': 'BM-2cWmjntZ47WKEUtocrdvs19y5CivpKoi1h'}
|
test_address = {'autoresponder_address': 'BM-2cVWtdUzPwF7UNGDrZftWuHWiJ6xxBpiSP'}
|
||||||
|
|
||||||
class SendMessage(TeleniumTestProcess):
|
class SendMessage(TeleniumTestProcess):
|
||||||
"""Sent Screen Functionality Testing"""
|
"""Sent Screen Functionality Testing"""
|
||||||
test_subject = 'Test Subject'
|
test_subject = 'Test Subject'
|
||||||
test_body = 'Hello, \n Hope your are doing good.\n\t This is test message body'
|
test_body = 'Hello, \n Hope your are doing good.\n\t This is test message body'
|
||||||
|
popup_var = 'Please fill the form completely'
|
||||||
@ordered
|
@ordered
|
||||||
def test_send_message_and_validation(self):
|
def test_validate_empty_form(self):
|
||||||
"""
|
"""
|
||||||
Sending Message From Inbox Screen
|
Sending Message From Inbox Screen
|
||||||
opens a pop-up(screen) which send message from sender to reciever
|
opens a pop-up(screen) which send message from sender to reciever
|
||||||
|
@ -32,20 +32,28 @@ class SendMessage(TeleniumTestProcess):
|
||||||
# Checking State of Subject Input Field (Empty)
|
# Checking State of Subject Input Field (Empty)
|
||||||
self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"\"]', timeout=2)
|
self.assertExists('//DropDownWidget/ScrollView[0]//MyMDTextField[@text=\"\"]', timeout=2)
|
||||||
# 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)
|
||||||
|
# import pdb; pdb.set_trace()
|
||||||
# Checking validation Pop up is Opened
|
# Checking validation Pop up is Opened
|
||||||
self.assertExists('//MDDialog[@text=\"Please fill the form completely\"]', timeout=2)
|
self.assertExists('//MDDialog', timeout=5)
|
||||||
# Click on 'Ok' to dismiss the Popup
|
# Click to dismiss the Popup
|
||||||
self.cli.wait_click('//MDFlatButton[0]', timeout=2)
|
# self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=5)
|
||||||
# Checking Pop up is closed
|
self.cli.wait_click('//MDFlatButton[@text=\"Ok\"]', timeout=2)
|
||||||
self.assertExists("//ScreenManager[@current=\"create\"]", timeout=2)
|
# Checking current screen after dialog dismiss
|
||||||
|
self.assertExists("//ScreenManager[@current=\"create\"]", timeout=10)
|
||||||
|
|
||||||
|
@ordered
|
||||||
|
def test_validate_half_filled_form(self):
|
||||||
|
"""
|
||||||
|
Validation the half filled form and press back button to save message in draft box.
|
||||||
|
"""
|
||||||
|
# Checking current screen
|
||||||
|
self.assertExists("//ScreenManager[@current=\"create\"]", timeout=2)
|
||||||
# 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=2)
|
||||||
# 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')
|
self.assertEqual(self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open'), False)
|
||||||
self.assertEqual(is_open, False)
|
|
||||||
# Open Sender's Address DropDown
|
# Open Sender's Address DropDown
|
||||||
self.cli.wait_click('//Create//CustomSpinner[0]/ArrowImg[0]', timeout=5)
|
self.cli.wait_click('//Create//CustomSpinner[0]/ArrowImg[0]', timeout=5)
|
||||||
# Checking the Address Dropdown is in open State
|
# Checking the Address Dropdown is in open State
|
||||||
|
@ -55,8 +63,7 @@ class SendMessage(TeleniumTestProcess):
|
||||||
# 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=3)
|
||||||
# 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')
|
self.assertEqual(self.cli.getattr('//Create//CustomSpinner[@is_open]', 'is_open'), False)
|
||||||
self.assertEqual(is_open, False)
|
|
||||||
# Assert check for empty Subject Field
|
# Assert check for empty Subject Field
|
||||||
self.assertNotEqual('//DropDownWidget/ScrollView[0]//MDTextField[0]', '')
|
self.assertNotEqual('//DropDownWidget/ScrollView[0]//MDTextField[0]', '')
|
||||||
# ADD SUBJECT
|
# ADD SUBJECT
|
||||||
|
@ -73,15 +80,22 @@ class SendMessage(TeleniumTestProcess):
|
||||||
# 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
|
||||||
self.assertExists('//MDDialog[@text=\"Please fill the form completely\"]', timeout=2)
|
self.assertExists('//MDDialog', timeout=2)
|
||||||
# clicked on ok button to close popup
|
# clicked on ok button to close popup
|
||||||
self.cli.wait_click('//MDFlatButton[0]', timeout=2)
|
self.cli.wait_click('//MDFlatButton[@text=\"Ok\"]', timeout=2)
|
||||||
|
# self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"send\"]', timeout=2)
|
||||||
self.assertExists("//ScreenManager[@current=\"create\"]", timeout=5)
|
self.assertExists("//ScreenManager[@current=\"create\"]", timeout=5)
|
||||||
|
|
||||||
|
@ordered
|
||||||
|
def test_sending_msg_fully_filled_form(self):
|
||||||
|
"""
|
||||||
|
Sending message when all fields are filled
|
||||||
|
"""
|
||||||
# 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=2)
|
||||||
# Entering Receiver Address
|
# Entering Receiver Address
|
||||||
self.cli.setattr('//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", test_address['receiver'])
|
self.cli.setattr('//DropDownWidget/ScrollView[0]//MyTextInput[0]', "text", test_address['autoresponder_address'])
|
||||||
# Checking Receiver Address filled or not
|
# Checking Receiver Address filled or not
|
||||||
self.assertNotEqual('//DropDownWidget/ScrollView[0]//MyTextInput[text]', '')
|
self.assertNotEqual('//DropDownWidget/ScrollView[0]//MyTextInput[text]', '')
|
||||||
# Clicking on send icon
|
# Clicking on send icon
|
||||||
|
|
Reference in New Issue
Block a user