False failures fix: assets, transaction users

Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
yevh-berdnyk 2018-08-16 19:47:13 +03:00
parent 169390d2c8
commit 53c9963a46
No known key found for this signature in database
GPG Key ID: E9B425FDFC4DEA9C
10 changed files with 39 additions and 22 deletions

View File

@ -129,8 +129,8 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view.get_back_to_home_view()
wallet_view = profile_view.wallet_button.click()
wallet_view.set_up_wallet()
assert '' in wallet_view.total_amount_text.text
assert 'EUR' == wallet_view.currency_text.text
if 'EUR' != wallet_view.currency_text.text:
pytest.fail('EUR currency is not displayed')
@marks.testrail_id(3707)
def test_add_custom_network(self):

View File

@ -1,3 +1,4 @@
import pytest
import random
from tests import marks, common_password
@ -68,4 +69,6 @@ class TestSignInOffline(MultipleDeviceTestCase):
sign_in.accept_agreements()
home = sign_in.sign_in()
home.home_button.wait_for_visibility_of_element()
assert home.connection_status.text == 'Offline'
connection_text = home.connection_status.text
if connection_text != 'Offline':
pytest.fail("Connection status text '%s' doesn't match expected 'Offline'" % connection_text)

View File

@ -87,6 +87,7 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.asset_checkbox_by_name(select_asset).click()
wallet.asset_checkbox_by_name(deselect_asset).click()
wallet.done_button.click()
wallet.asset_by_name(select_asset).scroll_to_element()
if not wallet.asset_by_name(select_asset).is_element_displayed():
self.errors.append('%s asset is not shown in wallet' % select_asset)
if wallet.asset_by_name(deselect_asset).is_element_displayed():

View File

@ -129,7 +129,8 @@ class TestChatManagement(SingleDeviceTestCase):
start_new_chat.start_new_chat_button.click()
start_new_chat.public_key_edit_box.set_value(group_chat_users['B_USER']['public_key'][:-1])
start_new_chat.confirm()
if not start_new_chat.element_by_text('Please scan a valid contact code').is_element_displayed():
warning_text = start_new_chat.element_by_text('Please enter or scan a valid contact code or username')
if not warning_text.is_element_displayed():
pytest.fail('Error is not shown for invalid public key')
@marks.testrail_id(2175)

View File

@ -1,4 +1,5 @@
import pytest
import random
from _pytest.outcomes import Failed
from decimal import Decimal as d
from selenium.common.exceptions import TimeoutException
@ -357,14 +358,15 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
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'])
password = random.randint(100000, 1000000)
home = sign_in.recover_access(passphrase=sender['passphrase'], password=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_values_in_logcat(password=sender['password'])
chat.send_transaction_in_1_1_chat('ETH', amount, password)
chat.check_no_values_in_logcat(password=password)
@marks.testrail_id(3736)
@marks.smoke_1
@ -466,6 +468,7 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
send_transaction.back_button.click()
chat_view.commands_button.click()
chat_view.send_command.click()
chat_view.asset_by_name('STT').scroll_to_element()
chat_view.asset_by_name('STT').click()
chat_view.send_as_keyevent(str(round(stt_value + 1)))
chat_view.send_message_button.click()

View File

@ -1,3 +1,4 @@
import pytest
import random
import string
import emoji
@ -499,7 +500,9 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
message_input.send_keys(message_text)
message_input.delete_last_symbols(2)
assert message_input.text == message_text[:-2]
current_text = message_input.text
if current_text != message_text[:-2]:
pytest.fail("Message input text '%s' doesn't match expected '%s'" % (current_text, message_text[:-2]))
message_input.cut_text()

View File

@ -92,7 +92,7 @@ class TestBrowsing(SingleDeviceTestCase):
start_new_chat.confirm()
browsing_view = start_new_chat.get_base_web_view()
browsing_view.wait_for_d_aap_to_load()
assert browsing_view.element_by_text('Google').is_element_displayed()
browsing_view.element_by_text('Google').find_element()
@marks.testrail_id(1397)
@marks.smoke_1

View File

@ -1,6 +1,7 @@
import pytest
import random
from tests import transaction_users, marks, common_password
from tests import transaction_users, marks
from tests.base_test_case import SingleDeviceTestCase
from views.sign_in_view import SignInView
@ -64,30 +65,32 @@ class TestTransactionDApp(SingleDeviceTestCase):
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'])
password = random.randint(100000, 1000000)
sign_in_view.recover_access(sender['passphrase'], password)
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
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_values_in_logcat(password=sender['password'])
send_transaction_view.sign_transaction(password)
send_transaction_view.check_no_values_in_logcat(password=password)
@marks.logcat
@marks.testrail_id(3775)
def test_logcat_sign_message_from_daap(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
password = random.randint(100000, 1000000)
sign_in_view.create_user(password=password)
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.enter_password_input.send_keys(password)
send_transaction_view.sign_transaction_button.click()
send_transaction_view.check_no_values_in_logcat(password=common_password)
send_transaction_view.check_no_values_in_logcat(password=password)
@marks.testrail_id(1380)
@marks.smoke_1

View File

@ -160,7 +160,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
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'])
password = random.randint(100000, 1000000)
sign_in_view.recover_access(sender['passphrase'], password)
home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
@ -173,8 +174,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
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(sender['password'])
send_transaction.check_no_values_in_logcat(password=sender['password'])
send_transaction.sign_transaction(password)
send_transaction.check_no_values_in_logcat(password=password)
@marks.testrail_id(3746)
@marks.smoke_1
@ -242,7 +243,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(1405)
def test_send_valid_amount_after_insufficient_funds_error(self):
sender = transaction_users['H_USER']
sender = transaction_users['G_USER']
sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(sender['passphrase'], sender['password'])
wallet_view = sign_in_view.wallet_button.click()
@ -260,7 +261,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(transaction_users['G_USER']['address'])
send_transaction.enter_recipient_address_input.set_value(transaction_users['H_USER']['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction(sender['password'])
self.network_api.find_transaction_by_unique_amount(sender['address'], valid_amount)
@ -302,6 +303,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
"'Insufficient funds' error is now shown when sending %s ETH from wallet with balance %s" % (
round(eth_value + 1), eth_value))
send_transaction.select_asset_button.click()
send_transaction.asset_by_name('STT').scroll_to_element()
send_transaction.asset_by_name('STT').click()
send_transaction.amount_edit_box.set_value(round(stt_value + 1))
if not error_text.is_element_displayed():

View File

@ -211,12 +211,13 @@ class WalletView(BaseView):
def get_usd_total_value(self):
import re
return float(re.sub('[$,]', '', self.usd_total_value.text))
return float(re.sub('[~,]', '', self.usd_total_value.text))
def get_eth_value(self):
return float(self.eth_asset_value.text)
def get_stt_value(self):
self.stt_asset_value.scroll_to_element()
return float(self.stt_asset_value.text)
def verify_currency_balance(self, expected_rate: int, errors: list):