From 5e2c192524e8b2cf2f9fe74df96a90efbe873fd3 Mon Sep 17 00:00:00 2001 From: Serhy Date: Thu, 8 Nov 2018 16:36:54 +0200 Subject: [PATCH] Add automated tests according to #6649 Signed-off-by: Serhy --- .../account_management/test_wallet_modal.py | 58 +++++++++++++++++++ test/appium/views/transactions_view.py | 7 +++ 2 files changed, 65 insertions(+) diff --git a/test/appium/tests/atomic/account_management/test_wallet_modal.py b/test/appium/tests/atomic/account_management/test_wallet_modal.py index bb2e8f23e1..1d89a3d6fb 100644 --- a/test/appium/tests/atomic/account_management/test_wallet_modal.py +++ b/test/appium/tests/atomic/account_management/test_wallet_modal.py @@ -110,3 +110,61 @@ class TestWalletModal(SingleDeviceTestCase): chat.wallet_modal_button.click() if not wallet_modal.usd_total_value.is_element_displayed(): pytest.fail("Wallet modal was not opened") + + + @marks.testrail_id(5484) + @marks.low + def test_close_wallet_modal_via_closs_icon(self): + sign_in_view = SignInView(self.driver) + home = sign_in_view.create_user() + start_new_chat = home.plus_button.click() + start_new_chat.open_d_app_button.click() + start_new_chat.element_by_text('Airswap').click() + web_view = start_new_chat.open_button.click() + web_view.web_view_menu_button.click() + wallet_modal = web_view.wallet_modal_button.click() + wallet_modal.cross_icon.click() + if not web_view.browser_previous_page_button.is_element_displayed(): + pytest.fail('Modal wallet was not closed') + + + @marks.testrail_id(5483) + @marks.low + def test_close_wallet_modal_via_device_back_button(self): + sign_in_view = SignInView(self.driver) + home = sign_in_view.create_user() + start_new_chat = home.plus_button.click() + start_new_chat.open_d_app_button.click() + start_new_chat.element_by_text('Airswap').click() + web_view = start_new_chat.open_button.click() + web_view.web_view_menu_button.click() + wallet_modal = web_view.wallet_modal_button.click() + transaction_history = wallet_modal.transaction_history_button.click() + transaction_history.click_system_back_button() + if not web_view.web_view_menu_button.is_element_displayed(): + pytest.fail('Transaction history screen from modal wallet was not closed') + else: + web_view.web_view_menu_button.click() + web_view.wallet_modal_button.click() + wallet_modal.click_system_back_button() + if not web_view.web_view_menu_button.is_element_displayed(): + pytest.fail('Modal wallet was not closed') + + @marks.testrail_id(5482) + @marks.low + def test_switch_between_main_and_history_in_wallet_modal(self): + sign_in_view = SignInView(self.driver) + home = sign_in_view.create_user() + start_new_chat = home.plus_button.click() + start_new_chat.open_d_app_button.click() + start_new_chat.element_by_text('Airswap').click() + web_view = start_new_chat.open_button.click() + web_view.web_view_menu_button.click() + wallet_modal = web_view.wallet_modal_button.click() + transaction_history = wallet_modal.transaction_history_button.click() + if not transaction_history.wallet_modal_switch_button.is_element_displayed(): + pytest.fail('No back to wallet button in modal transaction history') + else: + transaction_history.wallet_modal_switch_button.click() + if not wallet_modal.transaction_history_button.is_element_displayed(): + pytest.fail('Failed to switch back to wallet modal main screen') diff --git a/test/appium/views/transactions_view.py b/test/appium/views/transactions_view.py index 196cda253e..9b6c040fdc 100644 --- a/test/appium/views/transactions_view.py +++ b/test/appium/views/transactions_view.py @@ -120,12 +120,19 @@ class FilterCheckbox(BaseButton): "//*[@text='%s']/following-sibling::*[@content-desc='checkbox']" % filter_name) +class WalletModalSwitchButton(BaseButton): + def __init__(self, driver): + super(WalletModalSwitchButton, self).__init__(driver) + self.locator = self.Locator.accessibility_id('wallet-modal-button') + + class TransactionsView(BaseView): def __init__(self, driver): super(TransactionsView, self).__init__(driver) self.driver = driver self.filters_button = FiltersButton(self.driver) self.transactions_table = TransactionTable(self.driver) + self.wallet_modal_switch_button = WalletModalSwitchButton(self.driver) def filter_checkbox(self, filter_name): return FilterCheckbox(self.driver, filter_name)