2018-07-13 10:56:36 +00:00
|
|
|
import pytest
|
|
|
|
|
2018-07-09 19:47:50 +00:00
|
|
|
from tests import transaction_users, marks, common_password
|
2018-06-30 12:17:38 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
|
|
|
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):
|
|
|
|
sender = transaction_users['B_USER']
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.recover_access(sender['passphrase'], sender['password'])
|
|
|
|
address = transaction_users['B_USER']['address']
|
|
|
|
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-06-30 12:17:38 +00:00
|
|
|
send_transaction_view.sign_transaction(sender['password'])
|
|
|
|
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):
|
|
|
|
sender = transaction_users['E_USER']
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.recover_access(sender['passphrase'], sender['password'])
|
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()
|
|
|
|
send_transaction_view.sign_transaction(sender['password'])
|
|
|
|
status_test_dapp.element_starts_with_text('Mining new contract in tx:').wait_for_visibility_of_element()
|
|
|
|
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):
|
|
|
|
sender = transaction_users['B_USER']
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.recover_access(sender['passphrase'], sender['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()
|
|
|
|
send_transaction_view.sign_transaction(sender['password'])
|
2018-07-17 16:27:00 +00:00
|
|
|
send_transaction_view.check_no_values_in_logcat(password=sender['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)
|
|
|
|
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.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)
|
|
|
|
send_transaction_view.enter_password_input.send_keys(common_password)
|
|
|
|
send_transaction_view.sign_transaction_button.click()
|
2018-07-17 16:27:00 +00:00
|
|
|
send_transaction_view.check_no_values_in_logcat(password=common_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()
|
|
|
|
status_test_dapp.browser_cross_icon.click()
|
|
|
|
wallet_view = sign_in_view.wallet_button.click()
|
|
|
|
wallet_view.set_up_wallet()
|
|
|
|
wallet_view.wait_balance_changed_on_wallet_screen()
|