Added tests for logcat verification

Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
yevh-berdnyk 2018-07-09 21:47:50 +02:00
parent 14398e33cb
commit fcb68e7713
No known key found for this signature in database
GPG Key ID: E9B425FDFC4DEA9C
9 changed files with 107 additions and 9 deletions

View File

@ -65,7 +65,6 @@ class TestCreateAccount(SingleDeviceTestCase):
@marks.testrail_id(844) @marks.testrail_id(844)
def test_create_account_short_and_mismatch_password(self): def test_create_account_short_and_mismatch_password(self):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sign_in.create_account_button.click() sign_in.create_account_button.click()
sign_in.password_input.set_value('12345') sign_in.password_input.set_value('12345')
@ -84,3 +83,9 @@ class TestCreateAccount(SingleDeviceTestCase):
if not sign_in.find_text_part(mismatch_error): if not sign_in.find_text_part(mismatch_error):
self.errors.append("'%s' is not shown") self.errors.append("'%s' is not shown")
self.verify_no_errors() self.verify_no_errors()
@marks.testrail_id(3767)
def test_password_in_logcat_creating_account(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
sign_in.check_no_value_in_logcat(common_password)

View File

@ -146,3 +146,12 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
profile_view.advanced_button.click() profile_view.advanced_button.click()
profile_view.find_text_part('CUSTOM_ROPSTEN') profile_view.find_text_part('CUSTOM_ROPSTEN')
@marks.testrail_id(3774)
def test_logcat_backup_seed_phrase(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
profile_view = sign_in_view.profile_button.click()
seed_phrase = profile_view.backup_seed_phrase()
for i in seed_phrase.values():
profile_view.check_no_value_in_logcat(i, 'Passphrase')

View File

@ -1,6 +1,6 @@
import pytest import pytest
from tests import marks, common_password from tests import marks, common_password, basic_user
from tests.base_test_case import SingleDeviceTestCase from tests.base_test_case import SingleDeviceTestCase
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -52,3 +52,10 @@ class TestRecoverAccountSingleDevice(SingleDeviceTestCase):
sign_in.recover_access(passphrase=' '.join(list(seed_phrase.values())[::-1]), password=common_password) sign_in.recover_access(passphrase=' '.join(list(seed_phrase.values())[::-1]), password=common_password)
if sign_in.get_public_key() == public_key: if sign_in.get_public_key() == public_key:
pytest.fail('The same account is recovered with reversed passphrase') pytest.fail('The same account is recovered with reversed passphrase')
@marks.testrail_id(3769)
def test_logcat_recovering_account(self):
sign_in = SignInView(self.driver)
sign_in.recover_access(basic_user['passphrase'], basic_user['password'])
sign_in.check_no_value_in_logcat(basic_user['passphrase'], 'Passphrase')
sign_in.check_no_value_in_logcat(basic_user['password'])

View File

@ -37,6 +37,16 @@ class TestSignIn(SingleDeviceTestCase):
sign_in.sign_in_button.click() sign_in.sign_in_button.click()
sign_in.find_full_text('Wrong password') sign_in.find_full_text('Wrong password')
@marks.testrail_id(3768)
def test_password_in_logcat_sign_in(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
profile = sign_in.profile_button.click()
profile.logout()
sign_in.click_account_by_position(0)
sign_in.sign_in()
sign_in.check_no_value_in_logcat(common_password)
@marks.all @marks.all
@marks.sign_in @marks.sign_in

View File

@ -1,5 +1,3 @@
import random
from _pytest.outcomes import Failed from _pytest.outcomes import Failed
from decimal import Decimal as d from decimal import Decimal as d
from selenium.common.exceptions import TimeoutException from selenium.common.exceptions import TimeoutException
@ -322,3 +320,16 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
if chat.asset_by_name('MDS').is_element_displayed(): if chat.asset_by_name('MDS').is_element_displayed():
self.errors.append('Token which is not enabled in wallet can be requested in 1-1 chat') self.errors.append('Token which is not enabled in wallet can be requested in 1-1 chat')
self.verify_no_errors() self.verify_no_errors()
@marks.testrail_id(3771)
def test_logcat_send_transaction_in_1_1_chat(self):
sender = transaction_users['C_USER']
sign_in = SignInView(self.driver)
home = sign_in.recover_access(passphrase=sender['passphrase'], password=sender['password'])
wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.home_button.click()
chat = home.add_contact(transaction_users['D_USER']['public_key'])
amount = chat.get_unique_amount()
chat.send_transaction_in_1_1_chat('ETH', amount, sender['password'])
chat.check_no_value_in_logcat(sender['password'])

View File

@ -48,8 +48,8 @@ class TestMessagesPublicChat(SingleDeviceTestCase):
chat_view.chat_message_input.send_keys('web3.eth.blockNumber') chat_view.chat_message_input.send_keys('web3.eth.blockNumber')
block_number = self.network_api.get_latest_block_number() block_number = self.network_api.get_latest_block_number()
chat_view.send_message_button.click() chat_view.send_message_button.click()
for number in block_number, block_number + 1: for i in range(4):
if chat_view.chat_element_by_text(str(number)).is_element_displayed(): if chat_view.chat_element_by_text(str(block_number + i)).is_element_displayed():
break break
else: else:
pytest.fail('Actual block number is not shown') pytest.fail('Actual block number is not shown')

View File

@ -1,4 +1,4 @@
from tests import transaction_users, marks from tests import transaction_users, marks, common_password
from tests.base_test_case import SingleDeviceTestCase from tests.base_test_case import SingleDeviceTestCase
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -23,7 +23,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
def test_sign_message_from_daap(self): def test_sign_message_from_daap(self):
password = 'password_for_daap' password = 'password_for_daap'
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user(password) sign_in_view.create_user(password=password)
status_test_dapp = sign_in_view.open_status_test_dapp() status_test_dapp = sign_in_view.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load() status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click() status_test_dapp.transactions_button.click()
@ -33,3 +33,29 @@ class TestTransactionDApp(SingleDeviceTestCase):
send_transaction_view.enter_password_input) send_transaction_view.enter_password_input)
send_transaction_view.enter_password_input.send_keys(password) send_transaction_view.enter_password_input.send_keys(password)
send_transaction_view.sign_transaction_button.click() send_transaction_view.sign_transaction_button.click()
@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'])
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'])
send_transaction_view.check_no_value_in_logcat(sender['password'])
@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()
send_transaction_view.check_no_value_in_logcat(common_password)

View File

@ -160,3 +160,28 @@ class TestTransactionWallet(SingleDeviceTestCase):
send_transaction.enter_recipient_address_input.set_value(recipient['public_key']) send_transaction.enter_recipient_address_input.set_value(recipient['public_key'])
send_transaction.done_button.click() send_transaction.done_button.click()
send_transaction.find_text_part('Invalid address:', 20) send_transaction.find_text_part('Invalid address:', 20)
@marks.testrail_id(3770)
def test_logcat_send_transaction_from_wallet(self):
sender = transaction_users['E_USER']
recipient = transaction_users['F_USER']
sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(sender['passphrase'], sender['password'])
home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
send_transaction = wallet_view.send_transaction_button.click()
send_transaction.amount_edit_box.click()
transaction_amount = send_transaction.get_unique_amount()
send_transaction.amount_edit_box.set_value(transaction_amount)
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.enter_password_input.click()
send_transaction.send_as_keyevent(sender['password'])
send_transaction.sign_transaction_button.click()
send_transaction.got_it_button.click()
send_transaction.check_no_value_in_logcat(sender['password'])

View File

@ -2,6 +2,7 @@ import random
import string import string
import time import time
import base64 import base64
import pytest
import zbarlight import zbarlight
from tests import info, common_password from tests import info, common_password
from eth_keys import datatypes from eth_keys import datatypes
@ -226,7 +227,7 @@ class BaseView(object):
@property @property
def logcat(self): def logcat(self):
return self.driver.get_log("logcat") return str(self.driver.get_log("logcat"))
def confirm(self): def confirm(self):
info("Tap 'Confirm' on native keyboard") info("Tap 'Confirm' on native keyboard")
@ -407,3 +408,7 @@ class BaseView(object):
if i == 2: if i == 2:
e.msg = "Can't reconnect to mail server after 3 attempts" e.msg = "Can't reconnect to mail server after 3 attempts"
raise e raise e
def check_no_value_in_logcat(self, exp_value: str, value_name: str = 'Password'):
if exp_value in self.logcat:
pytest.fail('%s in logcat!!!' % value_name, pytrace=False)