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-11-07 13:09:23 +00:00
|
|
|
from tests.users import transaction_senders, transaction_recipients
|
2018-06-30 12:17:38 +00:00
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
|
|
|
class TestTransactionDApp(SingleDeviceTestCase):
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5309)
|
|
|
|
@marks.critical
|
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)
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5342)
|
|
|
|
@marks.critical
|
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-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5333)
|
|
|
|
@marks.critical
|
2018-07-13 10:56:36 +00:00
|
|
|
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-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5418)
|
|
|
|
@marks.critical
|
2018-07-09 19:47:50 +00:00
|
|
|
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-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5420)
|
|
|
|
@marks.critical
|
2018-07-09 19:47:50 +00:00
|
|
|
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
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5372)
|
|
|
|
@marks.high
|
2018-07-23 11:38:47 +00:00
|
|
|
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()
|
2018-10-07 15:12:21 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(5355)
|
|
|
|
@marks.critical
|
2018-11-07 15:50:08 +00:00
|
|
|
def test_onboarding_screen_when_requesting_tokens_for_new_account(self):
|
2018-10-07 15:12:21 +00:00
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
home_view = signin_view.create_user()
|
|
|
|
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()
|
|
|
|
if not send_transaction_view.onboarding_message.is_element_displayed():
|
2018-11-07 15:50:08 +00:00
|
|
|
self.driver.fail('It seems onboarding screen is not shown.')
|
2018-10-07 15:12:21 +00:00
|
|
|
|
2018-11-07 15:50:08 +00:00
|
|
|
@marks.testrail_id(5677)
|
|
|
|
@marks.high
|
|
|
|
def test_onboarding_screen_when_requesting_tokens_for_recovered_account(self):
|
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
home_view = signin_view.recover_access(passphrase=transaction_senders['U']['passphrase'])
|
2018-10-07 15:12:21 +00:00
|
|
|
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()
|
|
|
|
if not send_transaction_view.onboarding_message.is_element_displayed():
|
2018-11-07 15:50:08 +00:00
|
|
|
self.driver.fail('It seems onboarding screen is not shown.')
|
2018-11-07 13:09:23 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(5380)
|
|
|
|
@marks.high
|
|
|
|
def test_user_can_complete_tx_to_dapp_when_onboarding_via_dapp_completed(self):
|
|
|
|
user = transaction_recipients['G']
|
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
home_view = signin_view.recover_access(passphrase=user['passphrase'])
|
|
|
|
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()
|
|
|
|
if not send_transaction_view.onboarding_message.is_element_displayed():
|
|
|
|
self.driver.fail('It seems onborading screen is not shown.')
|
|
|
|
send_transaction_view.complete_onboarding()
|
|
|
|
|
|
|
|
if not send_transaction_view.sign_transaction_button.is_element_displayed():
|
|
|
|
self.driver.fail('It seems transaction sign screen is not shown.')
|
|
|
|
|
|
|
|
send_transaction_view.sign_transaction()
|
|
|
|
|
|
|
|
if not status_test_dapp.assets_button.is_element_displayed():
|
|
|
|
self.driver.fail('It seems users was not redirected to Status DAPP screen.')
|