2021-07-14 17:23:03 +02:00
|
|
|
from time import time
|
2021-06-10 17:14:19 +02:00
|
|
|
from .telenium_process import TeleniumTestProcess
|
2021-03-06 00:14:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
class PaymentScreen(TeleniumTestProcess):
|
|
|
|
"""SubscriptionPayment Screen Functionality Testing"""
|
|
|
|
|
|
|
|
def test_select_subscripton(self):
|
|
|
|
"""Select Subscripton From List of Subscriptons"""
|
|
|
|
print("=====================Test -Select Subscripton From List of Subscriptons=====================")
|
2021-07-14 17:23:03 +02:00
|
|
|
self.cli.sleep(7)
|
2021-07-13 09:53:53 +02:00
|
|
|
# this is for opening Nav drawer
|
2021-07-14 17:23:03 +02:00
|
|
|
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
|
|
|
|
# checking state of Nav drawer
|
|
|
|
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
|
2021-07-13 09:53:53 +02:00
|
|
|
# Dragging from sent to inbox to get Payment tab.
|
|
|
|
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
|
2021-07-14 17:23:03 +02:00
|
|
|
self.assertExists('//NavigationItem[@text=\"Network status\"]', timeout=3)
|
2021-07-16 14:59:04 +02:00
|
|
|
# assert for checking scroll function
|
2021-07-14 17:23:03 +02:00
|
|
|
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)
|
2021-07-13 09:53:53 +02:00
|
|
|
# this is for opening Payment screen
|
2021-07-14 17:23:03 +02:00
|
|
|
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]')
|
2021-07-16 14:59:04 +02:00
|
|
|
# assert for checking scroll function
|
2021-07-14 17:23:03 +02:00
|
|
|
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)
|
2021-07-01 18:27:38 +02:00
|
|
|
self.assertExists("//Payment[@name~=\"payment\"]", timeout=2)
|
2021-07-16 14:59:04 +02:00
|
|
|
|