conflict resolved and fixed on_click in test cases

This commit is contained in:
shekhar-cis 2021-07-14 20:53:03 +05:30
parent a82bf19b94
commit 071454c68f
Signed by untrusted user: shekhar-cis
GPG Key ID: 8B2A6C8D5F7F1635
5 changed files with 86 additions and 44 deletions

View File

@ -1,3 +1,4 @@
from requests.packages.urllib3.util import Timeout, timeout
from .telenium_process import TeleniumTestProcess
from .common import ordered
@ -9,22 +10,29 @@ class AllMailMessage(TeleniumTestProcess):
def test_show_allmail_list(self):
"""Show All Messages on Mail Screen/Window"""
print("=====================Test -Show Messages Of Mail Screen=====================")
self.cli.sleep(10)
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
self.cli.click_on('//NavigationItem[5]')
self.cli.sleep(4)
self.cli.sleep(8)
# 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)
# this is for opening All Mail screen
self.cli.wait_click('//NavigationItem[@text=\"All Mails\"]', timeout=2)
self.cli.sleep(3)
# Assert for checking Current Screen(All mail)
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=2)
@ordered
def test_delete_message_from_allmail_list(self):
"""Delete Message From Message body of Mail Screen/Window"""
print("=====================Test -Delete Messages Of Mail Screen=====================")
self.cli.sleep(4)
self.cli.click_on(
'//Allmails[0]/BoxLayout[0]/BoxLayout[0]/ScrollView[0]/MDList[0]/CutsomSwipeToDeleteItem[0]')
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=0)
self.cli.sleep(5)
self.cli.click_on('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]')
self.cli.sleep(5)
# Assert for checking Current Screen(All mail)
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=2)
# click on a Message to get message details screen
self.cli.wait_click(
'//MDList[0]/CutsomSwipeToDeleteItem[0]', timeout=2)
# Assert for checking Current Screen(Mail Detail)
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=2)
# CLicking on Trash-Can icon to delete Message
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]', timeout=2)
# After deleting msg, screen is redirected to All mail screen
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=0)

View File

@ -1,3 +1,4 @@
from requests.packages.urllib3.util import timeout
from .telenium_process import TeleniumTestProcess
@ -6,14 +7,25 @@ class NetwrokStatusScreen(TeleniumTestProcess):
def test_network_status(self):
"""Show NetwrokStatus"""
print("=====================Test -Show Network Status=====================")
self.cli.sleep(10)
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(3)
self.cli.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]", 1)
self.cli.sleep(3)
self.cli.click_on('//NavigationItem[10]')
self.cli.sleep(4)
self.cli.click_on('//NetworkStat/MDTabs[0]/MDTabsBar[0]/MDTabsScrollView[0]/MDGridLayout[0]/MDTabsLabel[1]')
self.cli.sleep(4)
print("=====================Test -Show NetwrokStatus=====================")
self.cli.sleep(8)
# this is for opening Nav drawer
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=2)
# checking state of Nav drawer
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
# this is for scrolling Nav drawer
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
# Assert for checking scroller run till Network tab.
self.assertExists("//NavigationItem[@text=\"Network status\"]", timeout=2)
# assert for checking scroll function
scroll_distance = self.cli.getattr('//ContentNavigationDrawer//ScrollView[0]', 'scroll_y')
self.assertCheckScrollDown(scroll_distance, -0.0, timeout=2)
# Clicking on Network Status tab
self.click_on('//NavigationItem[@text=\"Network status\"]', seconds=1)
# Checking for current screen (Network Status)
self.assertExists("//NetworkStat[@name~=\"networkstat\"]", timeout=2)
# Clicking on Processes Tab
self.cli.wait_click('//NetworkStat/MDTabs[0]//MDTabsLabel[1]', timeout=1)
# Checking for current screen (Network Status)
self.assertExists("//NetworkStat[@name~=\"networkstat\"]", timeout=2)

View File

@ -1,3 +1,5 @@
from time import time
from requests.packages.urllib3.util import timeout
from .telenium_process import TeleniumTestProcess
@ -7,23 +9,36 @@ class PaymentScreen(TeleniumTestProcess):
def test_select_subscripton(self):
"""Select Subscripton From List of Subscriptons"""
print("=====================Test -Select Subscripton From List of Subscriptons=====================")
self.cli.sleep(10)
self.cli.sleep(7)
# this is for opening Nav drawer
self.click_on('//MDActionTopAppBarButton[@icon=\"menu\"]')
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
# checking state of Nav drawer
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
# Dragging from sent to inbox to get Payment tab.
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
self.assertExists('//NavigationItem[@text=\"Network status\"]', timeout=3)
# assert for checking scroll funcation
scroll_distance = self.cli.getattr('//ContentNavigationDrawer//ScrollView[0]', 'scroll_y')
self.assertCheckScrollDown(scroll_distance, 0.0, timeout=3)
self.assertExists('//NavigationItem[@text=\"Purchase\"]', timeout=3)
# this is for opening Payment screen
self.click_on('//NavigationItem[@text=\"Purchase\"]', seconds=1)
self.assertExists("//Payment[@name~=\"payment\"]", timeout=2)
self.cli.drag(
'//Payment/BoxLayout[0]/ScrollView[0]/BoxLayout[0]/ProductCategoryLayout[0]/ProductLayout[1]',
'//Payment/BoxLayout[0]/ScrollView[0]/BoxLayout[0]/ProductCategoryLayout[0]/ProductLayout[0]', 1)
self.cli.sleep(2)
self.click_on('//MDRaisedButton[3]')
self.cli.sleep(2)
self.cli.click_on('//ListItemWithLabel[0]')
self.cli.sleep(2)
self.cli.click_on('//MDRaisedButton[3]')
self.cli.sleep(2)
self.click_on('//NavigationItem[@text=\"Purchase\"]', seconds=2)
# Assert for checking Current Screen
self.assertExists("//Payment[@name~=\"payment\"]", timeout=4)
self.drag(
'//ProductCategoryLayout[0]/ProductLayout[1]',
'//ProductCategoryLayout[0]/ProductLayout[0]')
# assert for checking scroll funcation
scroll_distance = self.cli.getattr('//Payment//ScrollView[0]', 'scroll_y')
self.assertCheckScrollDown(scroll_distance, 0.0, timeout=3)
self.assertExists('//MDRaisedButton[3]', timeout=3)
self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=2)
self.click_on('//ScrollView[0]/ListItemWithLabel[0]', seconds=1)
self.click_on('//MDRaisedButton[3]', seconds=1)
self.assertExists("//Payment[@name~=\"payment\"]", timeout=2)

View File

@ -7,9 +7,9 @@ class SettingScreen(TeleniumTestProcess):
def test_setting_screen(self):
"""Show Setting Screen"""
print("=====================Test -Show Setting Screen=====================")
self.cli.sleep(3)
self.cli.sleep(12)
# this is for checking current screen
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=2)
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=3)
# this is for opening Nav drawer
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=2)
# checking state of Nav drawer

View File

@ -21,12 +21,13 @@ class TrashMessage(TeleniumTestProcess):
print("=====================Test -Delete Message From Trash Message Listing=====================")
self.cli.sleep(8)
# this is for opening Nav drawer
self.click_on('//MDActionTopAppBarButton[@icon=\"menu\"]')
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=5)
# checking state of Nav drawer
self.assertEqual(self.cli.getattr('//MDNavigationDrawer', 'state'), 'open')
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
# this is for opening Trash screen
self.click_on('//NavigationItem[@text=\"Trash\"]')
self.cli.wait_click('//NavigationItem[@text=\"Trash\"]', timeout=2)
# self.cli.click_on('//NavigationItem[4]')
# Checking Trash Screen
self.assertExists("//Trash[@name~=\"trash\"]", timeout=2)
self.cli.sleep(4)
# This is for swiping message to activate delete icon.
@ -34,10 +35,16 @@ class TrashMessage(TeleniumTestProcess):
'//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
'//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]')
self.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]', seconds=1)
# Checking the Trash Icon after swipe.
self.assertExists("//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[@icon~=\"trash-can\"]", timeout=2)
# clicking on Trash Box icon to delete message.
self.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[0]', seconds=2)
self.cli.wait_click('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[0]', timeout=2)
# Checking the popup box screen.
self.assertExists("//MDDialog//MDFlatButton[@text=\"Yes\"]", timeout=2)
# Clicking on 'Yes' Button on Popup to confirm delete.
self.click_on('//MDDialog//MDFlatButton[@text=\"Yes\"]', seconds=1.1)
# self.cli.click_on('//MDDialog/DialogFakeCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]')
# Checking Trash Screen
self.assertExists("//Trash[@name~=\"trash\"]", timeout=2)
total_trash_msgs = len(self.cli.select("//CutsomSwipeToDeleteItem"))
# Checking the number of messages after delete.
self.assertEqual(total_trash_msgs, 1)