This repository has been archived on 2025-02-03. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2025-02-03/src/bitmessagekivy/tests/test_payment_subscription.py

46 lines
2.4 KiB
Python
Raw Normal View History

from time import time
2021-07-20 15:27:22 +02:00
from kivy.core.window import Animation
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
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
self.cli.wait_click('//NavigationItem[@text=\"Purchase\"]', timeout=2)
# Assert for checking Current Screen
self.assertExists("//Payment[@name~=\"payment\"]", timeout=3)
# Scrolling Down Product list
self.cli.sleep(0.5)
self.drag(
'//ProductCategoryLayout[0]/ProductLayout[1]',
'//ProductCategoryLayout[0]/ProductLayout[0]')
2021-07-16 14:59:04 +02:00
# assert for checking scroll function
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)
# Click on BUY Button
self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=2)
# 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')
# Click out side to dismiss the popup
self.cli.wait_click('//MDRaisedButton[3]', timeout=2)
# Checking Current screen(Payment screen)
self.assertExists("//Payment[@name~=\"payment\"]", timeout=2)
2021-07-16 14:59:04 +02:00