added test: can proceed using dapp after transacting tokens

Signed-off-by: Oleksii Lymarenko <alexey.lymarenko@gmail.com>
This commit is contained in:
Oleksii Lymarenko 2018-10-19 17:16:29 +03:00
parent aa18cdc20e
commit 092da7ab9d
No known key found for this signature in database
GPG Key ID: 2007E841ECE4A02C
3 changed files with 30 additions and 6 deletions

View File

@ -38,3 +38,25 @@ class TestDApps(SingleDeviceTestCase):
status_test_dapp.allow_button.click() status_test_dapp.allow_button.click()
if not status_test_dapp.element_by_text(user['public_key']).is_element_displayed(): if not status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
pytest.fail('Public key is not returned') 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.')

View File

@ -41,6 +41,11 @@ class BaseElement(object):
def id(locator, value): def id(locator, value):
return locator(MobileBy.ID, 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): def __str__(self, *args, **kwargs):
return "%s:%s" % (self.by, self.value) return "%s:%s" % (self.by, self.value)

View File

@ -5,25 +5,22 @@ class AssetsButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(AssetsButton, self).__init__(driver) super(AssetsButton, self).__init__(driver)
self.locator = self.Locator.text_selector('Assets') self.locator = self.Locator.webview_selector('Assets')
class RequestETHButton(BaseButton): class RequestETHButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(AssetsButton.RequestETHButton, self).__init__(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): class RequestSTTButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(AssetsButton.RequestSTTButton, self).__init__(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): def navigate(self):
from views.send_transaction_view import SendTransactionView from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver) return SendTransactionView(self.driver)
def click(self):
self.click_until_presence_of_element(self.RequestSTTButton(self.driver))
class TransactionsButton(BaseButton): class TransactionsButton(BaseButton):