2021-07-14 17:23:03 +02:00
from time import time
2021-07-20 15:27:22 +02:00
from kivy . core . window import Animation
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-19 10:21:48 +02:00
self . cli . sleep ( 10 )
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-16 14:59:04 +02:00
# assert for checking scroll function
2021-07-19 10:21:48 +02:00
self . assertCheckScrollDown ( ' //ContentNavigationDrawer//ScrollView[0] ' , timeout = 3 )
2021-07-13 09:53:53 +02:00
# this is for opening Payment screen
2021-07-19 17:01:05 +02:00
self . cli . wait_click ( ' //NavigationItem[@text= \" Purchase \" ] ' , timeout = 2 )
2021-07-14 17:23:03 +02:00
# Assert for checking Current Screen
2021-07-19 17:01:05 +02:00
self . assertExists ( " //Payment[@name~= \" payment \" ] " , timeout = 3 )
# Scrolling Down Product list
self . cli . sleep ( 0.5 )
2021-07-14 17:23:03 +02:00
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-19 17:01:05 +02:00
self . assertCheckScrollDown ( ' //Payment//ScrollView[0] ' , timeout = 3 )
2021-07-22 12:04:32 +02:00
self . cli . sleep ( 2 )
print ( self . cli . getattr ( ' //Payment//MDCustomBottomSheet//MDBottomSheet[0] ' , ' animation ' ) , ' pop is open or not ----------------------------------------------````````````````````````````````````````````````````````````~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' )
self . cli . sleep ( 2 )
2021-07-19 17:01:05 +02:00
# Click on BUY Button
2021-07-14 17:23:03 +02:00
self . cli . wait_click ( ' //MDRaisedButton[@text= \" BUY \" ] ' , timeout = 2 )
2021-07-19 17:01:05 +02:00
# CLick on the Payment Method
self . cli . click_on ( ' //ScrollView[0]/ListItemWithLabel[0] ' )
2021-07-20 15:27:22 +02:00
# Check pop up is opened
self . assertEqual ( self . cli . getattr ( ' //PaymentMethodLayout/BoxLayout[0]/MDLabel[0] ' , ' text ' ) , ' Select Payment Method ' )
2021-07-19 17:01:05 +02:00
# Click out side to dismiss the popup
self . cli . wait_click ( ' //MDRaisedButton[3] ' , timeout = 2 )
# Checking Current screen(Payment screen)
2021-07-01 18:27:38 +02:00
self . assertExists ( " //Payment[@name~= \" payment \" ] " , timeout = 2 )
2021-07-16 14:59:04 +02:00