2018-07-13 10:56:36 +00:00
|
|
|
import pytest
|
|
|
|
|
2018-09-17 08:50:01 +00:00
|
|
|
from tests import marks, unique_password
|
2018-06-30 12:17:38 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
2018-09-17 08:50:01 +00:00
|
|
|
from tests.users import transaction_senders
|
2018-06-30 12:17:38 +00:00
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
|
|
|
class TestTransactionDApp(SingleDeviceTestCase):
|
|
|
|
|
|
|
|
@marks.testrail_id(769)
|
2018-07-06 11:10:48 +00:00
|
|
|
@marks.smoke_1
|
2018-06-30 12:17:38 +00:00
|
|
|
def test_send_transaction_from_daap(self):
|
2018-09-17 08:50:01 +00:00
|
|
|
sender = transaction_senders['K']
|
2018-06-30 12:17:38 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-09-17 08:50:01 +00:00
|
|
|
sign_in_view.recover_access(sender['passphrase'])
|
|
|
|
address = sender['address']
|
2018-06-30 12:17:38 +00:00
|
|
|
initial_balance = self.network_api.get_balance(address)
|
|
|
|
status_test_dapp = sign_in_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()
|
2018-07-30 17:35:57 +00:00
|
|
|
wallet_view = send_transaction_view.get_wallet_view()
|
|
|
|
wallet_view.done_button.click()
|
|
|
|
wallet_view.yes_button.click()
|
2018-09-17 08:50:01 +00:00
|
|
|
send_transaction_view.sign_transaction()
|
2018-06-30 12:17:38 +00:00
|
|
|
self.network_api.verify_balance_is_updated(initial_balance, address)
|
|
|
|
|
|
|
|
@marks.testrail_id(3716)
|
2018-07-06 11:10:48 +00:00
|
|
|
@marks.smoke_1
|
2018-06-30 12:17:38 +00:00
|
|
|
def test_sign_message_from_daap(self):
|
|
|
|
password = 'password_for_daap'
|
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-07-09 19:47:50 +00:00
|
|
|
sign_in_view.create_user(password=password)
|
2018-06-30 12:17:38 +00:00
|
|
|
status_test_dapp = sign_in_view.open_status_test_dapp()
|
|
|
|
status_test_dapp.wait_for_d_aap_to_load()
|
|
|
|
status_test_dapp.transactions_button.click()
|
|
|
|
send_transaction_view = status_test_dapp.sign_message_button.click()
|
|
|
|
send_transaction_view.find_full_text('Test message')
|
|
|
|
send_transaction_view.sign_transaction_button.click_until_presence_of_element(
|
|
|
|
send_transaction_view.enter_password_input)
|
|
|
|
send_transaction_view.enter_password_input.send_keys(password)
|
|
|
|
send_transaction_view.sign_transaction_button.click()
|
2018-07-09 19:47:50 +00:00
|
|
|
|
2018-07-13 10:56:36 +00:00
|
|
|
@marks.testrail_id(3696)
|
|
|
|
@marks.smoke_1
|
|
|
|
def test_deploy_contract_from_daap(self):
|
2018-09-17 08:50:01 +00:00
|
|
|
sender = transaction_senders['L']
|
2018-07-13 10:56:36 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-09-17 08:50:01 +00:00
|
|
|
sign_in_view.recover_access(sender['passphrase'])
|
2018-07-30 17:35:57 +00:00
|
|
|
wallet_view = sign_in_view.wallet_button.click()
|
|
|
|
wallet_view.set_up_wallet()
|
2018-07-13 10:56:36 +00:00
|
|
|
status_test_dapp = sign_in_view.open_status_test_dapp()
|
|
|
|
status_test_dapp.wait_for_d_aap_to_load()
|
|
|
|
status_test_dapp.transactions_button.click()
|
|
|
|
send_transaction_view = status_test_dapp.deploy_contract_button.click()
|
2018-09-17 08:50:01 +00:00
|
|
|
send_transaction_view.sign_transaction()
|
2018-07-13 10:56:36 +00:00
|
|
|
for text in 'Contract deployed at: ', 'Call contract get function', \
|
|
|
|
'Call contract set function', 'Call function 2 times in a row':
|
2018-07-25 11:09:45 +00:00
|
|
|
if not status_test_dapp.element_by_text(text).is_element_displayed(120):
|
2018-07-13 10:56:36 +00:00
|
|
|
pytest.fail('Contract was not created')
|
|
|
|
|
2018-07-11 14:14:39 +00:00
|
|
|
@marks.logcat
|
2018-07-09 19:47:50 +00:00
|
|
|
@marks.testrail_id(3772)
|
|
|
|
def test_logcat_send_transaction_from_daap(self):
|
2018-09-17 08:50:01 +00:00
|
|
|
sender = transaction_senders['M']
|
2018-07-09 19:47:50 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-08-23 13:50:19 +00:00
|
|
|
sign_in_view.recover_access(sender['passphrase'], unique_password)
|
2018-07-30 17:35:57 +00:00
|
|
|
wallet_view = sign_in_view.wallet_button.click()
|
|
|
|
wallet_view.set_up_wallet()
|
2018-07-09 19:47:50 +00:00
|
|
|
status_test_dapp = sign_in_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()
|
2018-08-23 13:50:19 +00:00
|
|
|
send_transaction_view.sign_transaction(unique_password)
|
|
|
|
send_transaction_view.check_no_values_in_logcat(password=unique_password)
|
2018-07-09 19:47:50 +00:00
|
|
|
|
2018-07-11 14:14:39 +00:00
|
|
|
@marks.logcat
|
2018-07-09 19:47:50 +00:00
|
|
|
@marks.testrail_id(3775)
|
|
|
|
def test_logcat_sign_message_from_daap(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-08-23 13:50:19 +00:00
|
|
|
sign_in_view.create_user(password=unique_password)
|
2018-07-09 19:47:50 +00:00
|
|
|
status_test_dapp = sign_in_view.open_status_test_dapp()
|
|
|
|
status_test_dapp.wait_for_d_aap_to_load()
|
|
|
|
status_test_dapp.transactions_button.click()
|
|
|
|
send_transaction_view = status_test_dapp.sign_message_button.click()
|
|
|
|
send_transaction_view.sign_transaction_button.click_until_presence_of_element(
|
|
|
|
send_transaction_view.enter_password_input)
|
2018-08-23 13:50:19 +00:00
|
|
|
send_transaction_view.enter_password_input.send_keys(unique_password)
|
2018-07-09 19:47:50 +00:00
|
|
|
send_transaction_view.sign_transaction_button.click()
|
2018-08-23 13:50:19 +00:00
|
|
|
send_transaction_view.check_no_values_in_logcat(password=unique_password)
|
2018-07-23 11:38:47 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(1380)
|
|
|
|
@marks.smoke_1
|
|
|
|
def test_request_eth_in_status_test_dapp(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
status_test_dapp = sign_in_view.open_status_test_dapp()
|
|
|
|
status_test_dapp.wait_for_d_aap_to_load()
|
|
|
|
status_test_dapp.assets_button.click()
|
|
|
|
status_test_dapp.request_eth_button.click()
|
|
|
|
status_test_dapp.element_by_text('Faucet request recieved').wait_for_visibility_of_element()
|
|
|
|
status_test_dapp.ok_button.click()
|
2018-08-01 00:16:33 +00:00
|
|
|
status_test_dapp.cross_icon.click()
|
2018-07-23 11:38:47 +00:00
|
|
|
wallet_view = sign_in_view.wallet_button.click()
|
|
|
|
wallet_view.set_up_wallet()
|
|
|
|
wallet_view.wait_balance_changed_on_wallet_screen()
|