fixed swap to delete feature

This commit is contained in:
shekhar-cis 2021-07-20 18:57:22 +05:30
parent 86b772865b
commit 496ec73e34
Signed by untrusted user: shekhar-cis
GPG Key ID: 8B2A6C8D5F7F1635
4 changed files with 24 additions and 16 deletions

View File

@ -13,12 +13,11 @@ class AllMailMessage(TeleniumTestProcess):
# 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)
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=5)
# this is for opening All Mail screen
self.cli.wait_click('//NavigationItem[@text=\"All Mails\"]', timeout=2)
self.cli.sleep(3)
self.cli.wait_click('//NavigationItem[@text=\"All Mails\"]', timeout=5)
# Assert for checking Current Screen(All mail)
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=2)
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=5)
@ordered
def test_delete_message_from_allmail_list(self):
@ -28,10 +27,12 @@ class AllMailMessage(TeleniumTestProcess):
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)
'//MDList[0]/CutsomSwipeToDeleteItem[0]', timeout=3)
# Assert for checking Current Screen(Mail Detail)
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=2)
self.assertExists("//MailDetail[@name~=\"mailDetail\"]", timeout=3)
# CLicking on Trash-Can icon to delete Message
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[1]', timeout=2)
self.cli.wait_click('//MDToolbar/BoxLayout[2]/MDActionTopAppBarButton[@icon=\"delete-forever\"]', timeout=5)
# After deleting msg, screen is redirected to All mail screen
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=0)
self.assertExists("//Allmails[@name~=\"allmails\"]", timeout=5)

View File

@ -21,6 +21,6 @@ class NetwrokStatusScreen(TeleniumTestProcess):
# 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)
self.cli.wait_click('//NetworkStat/MDTabs[0]//MDTabsLabel[@text=\"Processes\"]', timeout=1)
# Checking for current screen (Network Status)
self.assertExists("//NetworkStat[@name~=\"networkstat\"]", timeout=2)

View File

@ -1,4 +1,6 @@
from time import time
from kivy.core.window import Animation
from .telenium_process import TeleniumTestProcess
@ -30,12 +32,10 @@ class PaymentScreen(TeleniumTestProcess):
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=3)
# Click on BUY Button
self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=2)
# Checking the pop up opend by clicking on BUY button
# self.assertExists('//PaymentMethodLayout/BoxLayout[0]/MDLabel[@text=\"Select Payment Method\"]', timeout=2)
# CLick on the Payment Method
self.cli.click_on('//ScrollView[0]/ListItemWithLabel[0]')
# Click checked
# self.assertExists('//PaymentMethodLayout/BoxLayout[0]/MDLabel[@text=\"Select Payment Method\"]', timeout=2)
# Check pop up is opened
self.assertEqual(self.cli.getattr('//PaymentMethodLayout/BoxLayout[0]/MDLabel[0]', 'text'), 'Select Payment Method')
# Click out side to dismiss the popup
self.cli.wait_click('//MDRaisedButton[3]', timeout=2)
# Checking Current screen(Payment screen)

View File

@ -28,12 +28,17 @@ class TrashMessage(TeleniumTestProcess):
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)
self.assertExists("//Trash[@name~=\"trash\"]", timeout=5)
# Transition Effect taking time, so halt is required
self.cli.sleep(2)
# Checking Popup is closed
self.assertEqual(self.cli.getattr('//MDList[0]/CutsomSwipeToDeleteItem[0]', '_opens_process'), False)
# This is for swiping message to activate delete icon.
self.drag(
'//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
'//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]')
# Checking Popup is Opened
self.assertEqual(self.cli.getattr('//MDList[0]/CutsomSwipeToDeleteItem[0]', '_opens_process'), True)
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)
@ -42,7 +47,9 @@ class TrashMessage(TeleniumTestProcess):
# 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.click_on('//MDFlatButton[@text=\"Yes\"]', seconds=1.1)
# Checking Pop is closed
self.assertEqual(self.cli.getattr('//MDList[0]/CutsomSwipeToDeleteItem[0]', '_opens_process'), False)
# Checking Trash Screen
self.assertExists("//Trash[@name~=\"trash\"]", timeout=2)
total_trash_msgs = len(self.cli.select("//CutsomSwipeToDeleteItem"))