Test Cases [reduced xpath]

This commit is contained in:
shekhar-cis 2021-07-13 13:23:53 +05:30
parent fddd054d56
commit 60b4f9a180
Signed by untrusted user: shekhar-cis
GPG Key ID: 8B2A6C8D5F7F1635
3 changed files with 40 additions and 21 deletions

15
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}

View File

@ -7,19 +7,19 @@ 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(4)
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[8]')
self.cli.sleep(10)
# this is for opening Nav drawer
self.click_on('//MDActionTopAppBarButton[@icon=\"menu\"]')
# Dragging from sent to inbox to get Payment tab.
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
# this is for opening Payment screen
self.click_on('//NavigationItem[@text=\"Purchase\"]', seconds=1)
self.assertExists("//Payment[@name~=\"payment\"]", timeout=2)
self.cli.sleep(3)
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.cli.click_on('//MDRaisedButton[3]')
self.click_on('//MDRaisedButton[3]')
self.cli.sleep(2)
self.cli.click_on('//ListItemWithLabel[0]')
self.cli.sleep(2)

View File

@ -7,21 +7,25 @@ class TrashMessage(TeleniumTestProcess):
def test_delete_trash_message(self):
"""Delete Trash message permanently from trash message listing"""
print("=====================Test -Delete Message From Trash Message Listing=====================")
self.cli.sleep(4)
self.cli.click_on('//MDToolbar/BoxLayout[0]/MDActionTopAppBarButton[0]')
self.cli.sleep(4)
self.cli.click_on('//NavigationItem[4]')
self.cli.sleep(8)
# this is for opening Nav drawer
self.click_on('//MDActionTopAppBarButton[@icon=\"menu\"]')
# checking state of Nav drawer
self.assertEqual(self.cli.getattr('//MDNavigationDrawer', 'state'), 'open')
# this is for opening Trash screen
self.click_on('//NavigationItem[@text=\"Trash\"]')
# self.cli.click_on('//NavigationItem[4]')
self.assertExists("//Trash[@name~=\"trash\"]", timeout=2)
self.cli.sleep(4)
self.cli.drag(
'//MDList[0]/CutsomSwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
'//MDList[0]/CutsomSwipeToDeleteItem[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]', 1)
self.cli.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]')
self.cli.sleep(4)
self.cli.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[0]')
self.cli.sleep(2)
self.cli.click_on('//MDDialog/MDCard[0]/AnchorLayout[0]/MDBoxLayout[0]/MDFlatButton[0]')
# This is for swiping message to activate delete icon.
self.drag(
'//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[1]',
'//Trash[0]//TwoLineAvatarIconListItem[0]/BoxLayout[2]')
self.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]', seconds=1)
# clicking on Trash Box icon to delete message.
self.click_on('//MDList[0]/CutsomSwipeToDeleteItem[0]//MDIconButton[0]', seconds=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]')
self.cli.sleep(2)
total_trash_msgs = len(self.cli.select("//CutsomSwipeToDeleteItem"))
self.assertEqual(total_trash_msgs, 1)