diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py b/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py index 26354b9c21..66d4d4de21 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py @@ -38,3 +38,25 @@ class TestDApps(SingleDeviceTestCase): status_test_dapp.allow_button.click() if not status_test_dapp.element_by_text(user['public_key']).is_element_displayed(): pytest.fail('Public key is not returned') + + @marks.testrail_id(5654) + @marks.low + def test_can_proceed_dapp_usage_after_transacting_it(self): + user = basic_user + sign_in_view = SignInView(self.driver) + home_view = sign_in_view.recover_access(passphrase=user['passphrase']) + chat = home_view.join_public_chat(home_view.get_public_chat_name()) + chat.back_button.click() + status_test_dapp = home_view.open_status_test_dapp() + status_test_dapp.wait_for_d_aap_to_load() + status_test_dapp.assets_button.click() + send_transaction_view = status_test_dapp.request_stt_button.click() + wallet_view = send_transaction_view.get_wallet_view() + wallet_view.done_button.click() + wallet_view.yes_button.click() + send_transaction_view.advanced_button.click() + send_transaction_view.transaction_fee_button.click() + send_transaction_view.done_button.click() + send_transaction_view.sign_transaction() + if not status_test_dapp.assets_button.is_element_displayed(): + self.driver.fail('Oops! Cannot proceed to use Status Test Dapp.') diff --git a/test/appium/views/base_element.py b/test/appium/views/base_element.py index 5c604b6ab1..1b58fcb4f5 100644 --- a/test/appium/views/base_element.py +++ b/test/appium/views/base_element.py @@ -41,6 +41,11 @@ class BaseElement(object): def id(locator, value): return locator(MobileBy.ID, value) + @classmethod + def webview_selector(cls, value): + xpath_expression = '//*[@text="{0}"] | //*[@content-desc="{desc}"]'.format(value, desc=value) + return cls(MobileBy.XPATH, xpath_expression) + def __str__(self, *args, **kwargs): return "%s:%s" % (self.by, self.value) diff --git a/test/appium/views/web_views/status_test_dapp.py b/test/appium/views/web_views/status_test_dapp.py index 2ad0445d08..928e80d553 100644 --- a/test/appium/views/web_views/status_test_dapp.py +++ b/test/appium/views/web_views/status_test_dapp.py @@ -5,25 +5,22 @@ class AssetsButton(BaseButton): def __init__(self, driver): super(AssetsButton, self).__init__(driver) - self.locator = self.Locator.text_selector('Assets') + self.locator = self.Locator.webview_selector('Assets') class RequestETHButton(BaseButton): def __init__(self, driver): super(AssetsButton.RequestETHButton, self).__init__(driver) - self.locator = self.Locator.text_selector('Request Ropsten ETH') + self.locator = self.Locator.webview_selector('Ropsten ETH') class RequestSTTButton(BaseButton): def __init__(self, driver): super(AssetsButton.RequestSTTButton, self).__init__(driver) - self.locator = self.Locator.text_selector('Request STT') + self.locator = self.Locator.webview_selector('Request STT') def navigate(self): from views.send_transaction_view import SendTransactionView return SendTransactionView(self.driver) - def click(self): - self.click_until_presence_of_element(self.RequestSTTButton(self.driver)) - class TransactionsButton(BaseButton):