Skip to content

Commit

Permalink
Update logcat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhy committed Sep 24, 2019
1 parent 2c56de0 commit 27b36d1
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def test_create_account_short_and_mismatch_password(self):
def test_password_in_logcat_creating_account(self):
sign_in = SignInView(self.driver)
sign_in.create_user(password=unique_password)
sign_in.check_no_values_in_logcat(password=unique_password)
values_in_logcat = sign_in.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)

@marks.testrail_id(5718)
@marks.medium
Expand Down
5 changes: 4 additions & 1 deletion test/appium/tests/atomic/account_management/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def test_add_custom_network(self):
profile_view.find_text_part('custom_ropsten')

@marks.logcat
@marks.critical
@marks.testrail_id(5419)
def test_logcat_backup_recovery_phrase(self):
sign_in_view = SignInView(self.driver)
Expand All @@ -211,8 +212,10 @@ def test_logcat_backup_recovery_phrase(self):
profile_view.recovery_phrase_word_input.set_value(recovery_phrase[word_number_1])
profile_view.done_button.click()
profile_view.yes_button.click()
profile_view.check_no_values_in_logcat(passphrase1=recovery_phrase[word_number],
values_in_logcat = profile_view.find_values_in_logcat(passphrase1=recovery_phrase[word_number],
passphrase2=recovery_phrase[word_number_1])
if len(values_in_logcat) == 2:
self.driver.fail(values_in_logcat)

@marks.testrail_id(5391)
@marks.high
Expand Down
4 changes: 3 additions & 1 deletion test/appium/tests/atomic/account_management/test_recover.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def test_recover_account_with_incorrect_passphrase(self):
def test_logcat_recovering_account(self):
sign_in = SignInView(self.driver)
sign_in.recover_access(passphrase=basic_user['passphrase'], password=unique_password)
sign_in.check_no_values_in_logcat(passphrase=basic_user['passphrase'], password=unique_password)
values_in_logcat = sign_in.find_values_in_logcat(passphrase=basic_user['passphrase'], password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)


class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
Expand Down
4 changes: 3 additions & 1 deletion test/appium/tests/atomic/account_management/test_sign_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def test_password_in_logcat_sign_in(self):
profile = sign_in.profile_button.click()
profile.logout()
sign_in.sign_in()
sign_in.check_no_values_in_logcat(password=unique_password)
values_in_logcat = sign_in.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)


@marks.all
Expand Down
4 changes: 3 additions & 1 deletion test/appium/tests/atomic/chats/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ def test_logcat_send_transaction_in_1_1_chat(self):
chat = home.add_contact(basic_user['public_key'])
amount = chat.get_unique_amount()
chat.send_transaction_in_1_1_chat('ETHro', amount, unique_password)
chat.check_no_values_in_logcat(password=unique_password)
values_in_logcat = chat.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)

@marks.testrail_id(5347)
@marks.high
Expand Down
1 change: 1 addition & 0 deletions test/appium/tests/atomic/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def setup_method(self, method, **kwargs):

@marks.testrail_id(5713)
@marks.upgrade
@marks.skip
def test_apk_upgrade(self):
sign_in = SignInView(self.driver)
home = sign_in.create_user()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ def test_logcat_send_transaction_from_daap(self):
status_test_dapp.assets_button.click()
send_transaction_view = status_test_dapp.request_stt_button.click()
send_transaction_view.sign_transaction(unique_password)
send_transaction_view.check_no_values_in_logcat(password=unique_password)
values_in_logcat = send_transaction_view.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)


@marks.logcat
@marks.testrail_id(5420)
Expand All @@ -148,7 +151,9 @@ def test_logcat_sign_message_from_daap(self):
send_transaction_view.enter_password_input)
send_transaction_view.enter_password_input.send_keys(unique_password)
send_transaction_view.sign_button.click()
send_transaction_view.check_no_values_in_logcat(password=unique_password)
values_in_logcat = send_transaction_view.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)

@marks.testrail_id(5372)
@marks.high
Expand Down
9 changes: 7 additions & 2 deletions test/appium/tests/atomic/transactions/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def test_transaction_wrong_password_wallet(self):
self.driver.fail('Transaction was sent with a wrong password')

@marks.testrail_id(1452)

def test_transaction_appears_in_history(self):
recipient = basic_user
sign_in_view = SignInView(self.driver)
Expand Down Expand Up @@ -169,7 +170,9 @@ def test_send_eth_from_wallet_incorrect_address(self):
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['public_key'])
send_transaction.done_button.click()
send_transaction.find_text_part('Invalid address:', 20)
if not send_transaction.find_text_part('Invalid address'):
self.driver.fail("Invalid address accepted for input as recipient!")
send_transaction.ok_button.click()

@marks.logcat
@marks.testrail_id(5416)
Expand All @@ -194,7 +197,9 @@ def test_logcat_send_transaction_from_wallet(self):
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction(unique_password)
send_transaction.check_no_values_in_logcat(password=unique_password)
values_in_logcat = send_transaction.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)

@marks.testrail_id(5350)
@marks.critical
Expand Down
6 changes: 4 additions & 2 deletions test/appium/views/base_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,11 +592,13 @@ def reconnect(self):
e.msg = "Device %s: Can't reconnect to mail server after 3 attempts" % self.driver.number
raise e

def check_no_values_in_logcat(self, **kwargs):
def find_values_in_logcat(self, **kwargs):
logcat = self.logcat
items_in_logcat = list()
for key, value in kwargs.items():
if re.findall('\W%s$|\W%s\W' % (value, value), logcat):
pytest.fail('%s in logcat!!!' % key.capitalize(), pytrace=False)
items_in_logcat.append('%s in logcat!!!' % key.capitalize())
return items_in_logcat

def asset_by_name(self, asset_name):
return AssetButton(self.driver, asset_name)
Expand Down

0 comments on commit 27b36d1

Please sign in to comment.