Fix for logcat verifications and connection status

Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
yevh-berdnyk 2018-07-11 16:14:39 +02:00
parent fa52958382
commit c0e5d24791
No known key found for this signature in database
GPG Key ID: E9B425FDFC4DEA9C
13 changed files with 43 additions and 20 deletions

View File

@ -68,7 +68,8 @@ class TestrailReport(BaseTestReport):
test_cases['smoke_phase_1'] = 157
test_cases['smoke_phase_2'] = 308
test_cases['upgrade'] = 309
test_cases['negative_tests'] = 458
test_cases['error_handling'] = 458
test_cases['logcat_verifications'] = 718
case_ids = list()
for phase in test_cases:
for case in self.get_cases(test_cases[phase]):

View File

@ -152,13 +152,24 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view.advanced_button.click()
profile_view.find_text_part('CUSTOM_ROPSTEN')
@marks.logcat
@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.backup_seed_phrase_button.click()
profile_view.ok_continue_button.click()
seed_phrase = profile_view.get_seed_phrase()
profile_view.next_button.click()
word_number = profile_view.seed_phrase_word_number.number
profile_view.seed_phrase_word_input.set_value(seed_phrase[word_number])
profile_view.next_button.click()
word_number_1 = profile_view.seed_phrase_word_number.number
profile_view.seed_phrase_word_input.set_value(seed_phrase[word_number_1])
profile_view.done_button.click()
profile_view.yes_button.click()
for i in seed_phrase[word_number], seed_phrase[word_number_1]:
profile_view.check_no_value_in_logcat(i, 'Passphrase')
@marks.testrail_id(3751)

View File

@ -54,6 +54,7 @@ class TestRecoverAccountSingleDevice(SingleDeviceTestCase):
if sign_in.get_public_key() == public_key:
pytest.fail('The same account is recovered with reversed passphrase')
@marks.logcat
@marks.testrail_id(3769)
def test_logcat_recovering_account(self):
sign_in = SignInView(self.driver)

View File

@ -38,6 +38,7 @@ class TestSignIn(SingleDeviceTestCase):
sign_in.sign_in_button.click()
sign_in.find_full_text('Wrong password')
@marks.logcat
@marks.testrail_id(3768)
def test_password_in_logcat_sign_in(self):
sign_in = SignInView(self.driver)

View File

@ -73,6 +73,7 @@ class TestChatManagement(SingleDeviceTestCase):
chat = home.join_public_chat(chat_name)
message = 'test message'
chat.reconnect()
chat_element = chat.chat_element_by_text(message)
chat_element.find_element()
username = chat_element.username.text

View File

@ -327,6 +327,7 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
self.errors.append('Token which is not enabled in wallet can be requested in 1-1 chat')
self.verify_no_errors()
@marks.logcat
@marks.testrail_id(3771)
def test_logcat_send_transaction_in_1_1_chat(self):
sender = transaction_users['C_USER']

View File

@ -22,20 +22,11 @@ class TestMessagesPublicChat(SingleDeviceTestCase):
console_chat = home_view.get_chat_with_user('Status Console')
console_view = console_chat.click()
console_view.send_faucet_request()
first_request_time = time.time()
console_view.chat_element_by_text('Faucet request has been received').wait_for_visibility_of_element()
console_view.send_faucet_request()
console_view.chat_element_by_text('Faucet request error').wait_for_visibility_of_element()
console_view.get_back_to_home_view()
wallet_view = profile_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.wait_balance_changed_on_wallet_screen()
wallet_view.home_button.click()
console_chat.click()
wait_time = 300 - (time.time() - first_request_time)
time.sleep(wait_time if wait_time > 0 else 0)
console_view.send_faucet_request()
console_view.chat_element_by_text('Faucet request has been received').wait_for_visibility_of_element()
@marks.testrail_id(1400)
@marks.smoke_1

View File

@ -53,8 +53,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1.set_network_connection(2) # turning on WiFi connection on primary device
if 'Tap to reconnect' in home_1.connection_status.text:
home_2.connection_status.click()
home_1.reconnect()
chat_element = home_1.get_chat_with_user(username_2)
chat_element.wait_for_visibility_of_element(20)
chat_1 = chat_element.click()
@ -101,8 +100,10 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
self.errors.append("'Delete message' button is not shown for not sent message")
chat_1.reconnect()
chat_1.element_by_text('Resend').click()
if chat_1.chat_element_by_text(message).status.text != 'Sent':
chat_element = chat_1.chat_element_by_text(message)
chat_1.element_by_text('Resend').click_until_presence_of_element(chat_element)
chat_element.status.wait_for_visibility_of_element()
if chat_element.status.text != 'Sent':
self.errors.append("Message status is not 'Sent' after resending the message")
chat_2 = home_2.get_chat_with_user(username_1).click()
@ -207,7 +208,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
chat_element.wait_for_visibility_of_element()
device_2_chat = chat_element.click()
if not device_2_chat.chat_element_by_text(message).is_element_displayed():
self.erros.append("Message with test '%s' was not received" % message)
self.erros.append("Message with text '%s' was not received" % message)
device_2_chat.reconnect()
device_2_chat.add_to_contacts.click()
device_2_chat.get_back_to_home_view()

View File

@ -36,6 +36,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
send_transaction_view.enter_password_input.send_keys(password)
send_transaction_view.sign_transaction_button.click()
@marks.logcat
@marks.testrail_id(3772)
def test_logcat_send_transaction_from_daap(self):
sender = transaction_users['B_USER']
@ -48,6 +49,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
send_transaction_view.sign_transaction(sender['password'])
send_transaction_view.check_no_value_in_logcat(sender['password'])
@marks.logcat
@marks.testrail_id(3775)
def test_logcat_sign_message_from_daap(self):
sign_in_view = SignInView(self.driver)

View File

@ -164,6 +164,7 @@ class TestTransactionWallet(SingleDeviceTestCase):
send_transaction.done_button.click()
send_transaction.find_text_part('Invalid address:', 20)
@marks.logcat
@marks.testrail_id(3770)
def test_logcat_send_transaction_from_wallet(self):
sender = transaction_users['E_USER']

View File

@ -17,3 +17,4 @@ wallet = pytest.mark.wallet
sign_in = pytest.mark.sign_in
skip = pytest.mark.skip
console = pytest.mark.console
logcat = pytest.mark.logcat

View File

@ -243,7 +243,12 @@ class BaseView(object):
@property
def logcat(self):
return str(self.driver.get_log("logcat"))
for i in range(30):
logcat = self.driver.get_log("logcat")
if len(logcat) > 1000:
return str([i for i in logcat if 'appium' not in str(i).lower()])
time.sleep(10)
raise TimeoutError('Logcat is empty after 300 sec')
def confirm(self):
info("Tap 'Confirm' on native keyboard")

View File

@ -1,3 +1,5 @@
from selenium.common.exceptions import NoSuchElementException
from tests import get_current_time, common_password
from views.base_element import BaseButton, BaseEditBox
from views.base_view import BaseView
@ -123,7 +125,7 @@ class SignInView(BaseView):
self.element_by_text_part('Display name').wait_for_element(30)
username = username if username else 'user_%s' % get_current_time()
self.name_input.send_keys(username)
self.name_input.set_value(username)
self.next_button.click()
self.do_not_share_button.wait_for_visibility_of_element(10)
@ -158,4 +160,7 @@ class SignInView(BaseView):
return self.sign_in_button.click()
def click_account_by_position(self, position: int):
self.account_button.find_elements()[position].click()
try:
self.account_button.find_elements()[position].click()
except IndexError:
raise NoSuchElementException('Unable to find account by position %s' % position)