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

46 lines
2.2 KiB
Python
Raw Normal View History

2021-08-18 12:03:35 +02:00
from .telenium_process import TeleniumTestProcess
from .common import skip_screen_checks
class PaymentScreen(TeleniumTestProcess):
"""SubscriptionPayment Screen Functionality Testing"""
@skip_screen_checks
def test_select_subscription(self):
"""Select Subscription From List of Subscriptions"""
# This is for checking Current screen
self.assert_wait_no_except('//ScreenManager[@current]', timeout=15, value='inbox')
2021-11-03 12:10:42 +01:00
# Method to open the side navbar
self.open_side_navbar()
2021-08-18 12:03:35 +02:00
# Dragging from sent to inbox to get Payment tab
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
# assert for checking scroll function
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=3)
# this is for opening Payment screen
2021-08-25 09:44:49 +02:00
self.cli.wait_click('//NavigationItem[@text=\"Purchase\"]', timeout=5)
2021-08-18 12:03:35 +02:00
# Assert for checking Current Screen
2021-08-25 09:44:49 +02:00
self.assertExists("//ScreenManager[@current=\"payment\"]", timeout=5)
2021-08-18 12:03:35 +02:00
# Scrolling Down Product list
2021-08-25 09:44:49 +02:00
self.drag(
'//ProductCategoryLayout[0]/ProductLayout[0]',
'//ProductCategoryLayout[0]/ProductLayout[1]')
# assert for checking scroll function
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=3)
# Scrolling Up Product list
2021-08-18 12:03:35 +02:00
self.drag(
'//ProductCategoryLayout[0]/ProductLayout[1]',
'//ProductCategoryLayout[0]/ProductLayout[0]')
# assert for checking scroll function
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=3)
# Click on BUY Button
self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=2)
2021-08-25 09:44:49 +02:00
# self.assertEqual('//PaymentMethodLayout[@disabled]', 'True') #Returns None when condition True
2021-08-18 12:03:35 +02:00
# CLick on the Payment Method
self.cli.click_on('//ScrollView[0]/ListItemWithLabel[0]')
# Check pop up is opened
2021-08-25 09:44:49 +02:00
self.assertTrue('//PaymentMethodLayout[@disabled]', 'False')
2021-08-18 12:03:35 +02:00
# Click out side to dismiss the popup
self.cli.wait_click('//MDRaisedButton[3]', timeout=2)
# Checking Current screen(Payment screen)
self.assertExists("//ScreenManager[@current=\"payment\"]", timeout=3)