mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-13 17:17:08 +00:00
Fix for profile and chats tests
Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
parent
2b6ee450ae
commit
13c8cbf253
@ -57,13 +57,14 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
||||
profile_view.share_my_contact_key_button.click()
|
||||
public_key = profile_view.public_key_text.text
|
||||
profile_view.public_key_text.long_press_element()
|
||||
self.driver.press_keycode(278)
|
||||
profile_view.copy_text()
|
||||
profile_view.cross_icon.click()
|
||||
home = profile_view.home_button.click()
|
||||
chat = home.add_contact(group_chat_users['A_USER']['public_key'])
|
||||
chat.chat_message_input.click()
|
||||
self.driver.press_keycode(279)
|
||||
if chat.chat_message_input.text != public_key:
|
||||
chat.paste_text()
|
||||
input_text = chat.chat_message_input.text
|
||||
if input_text not in public_key or len(input_text) < 1:
|
||||
self.errors.append('Public key was not copied')
|
||||
chat.chat_message_input.clear()
|
||||
chat.get_back_to_home_view()
|
||||
@ -73,12 +74,12 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
||||
wallet.receive_transaction_button.click()
|
||||
address = wallet.address_text.text
|
||||
wallet.address_text.long_press_element()
|
||||
self.driver.press_keycode(278)
|
||||
wallet.copy_text()
|
||||
wallet.get_back_to_home_view()
|
||||
wallet.home_button.click()
|
||||
home.get_chat_with_user(group_chat_users['A_USER']['username']).click()
|
||||
chat.chat_message_input.click()
|
||||
self.driver.press_keycode(279)
|
||||
chat.paste_text()
|
||||
if chat.chat_message_input.text != address:
|
||||
self.errors.append('Wallet address was not copied')
|
||||
self.verify_no_errors()
|
||||
|
@ -62,7 +62,6 @@ class TestCommands(MultipleDeviceTestCase):
|
||||
self.errors.append("Request funds message doesn't contain text 'Transaction Request'")
|
||||
except TimeoutException:
|
||||
self.errors.append('Request funds message was not received')
|
||||
|
||||
self.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(765)
|
||||
@ -126,11 +125,9 @@ class TestCommands(MultipleDeviceTestCase):
|
||||
home_2.wallet_button.click()
|
||||
try:
|
||||
wallet_2.wait_balance_changed_on_wallet_screen(expected_balance=init_balance + float(amount))
|
||||
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount)
|
||||
except Failed as e:
|
||||
self.errors.append(e.msg)
|
||||
|
||||
self.network_api.verify_balance_is(expected_balance=init_balance + float(amount),
|
||||
recipient_address=recipient['address'], errors=self.errors)
|
||||
self.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(1391)
|
||||
@ -166,11 +163,9 @@ class TestCommands(MultipleDeviceTestCase):
|
||||
home_2.wallet_button.click()
|
||||
try:
|
||||
wallet_2.wait_balance_changed_on_wallet_screen(expected_balance=init_balance + float(amount))
|
||||
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount)
|
||||
except Failed as e:
|
||||
self.errors.append(e.msg)
|
||||
|
||||
self.network_api.verify_balance_is(expected_balance=init_balance + float(amount),
|
||||
recipient_address=recipient['address'], errors=self.errors)
|
||||
self.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(1429)
|
||||
|
@ -1,5 +1,7 @@
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from tests import marks
|
||||
from tests.base_test_case import SingleDeviceTestCase
|
||||
from views.sign_in_view import SignInView
|
||||
@ -44,5 +46,10 @@ class TestMessagesPublicChat(SingleDeviceTestCase):
|
||||
home_view = profile_view.home_button.click()
|
||||
chat_view = home_view.get_chat_with_user('Status Console').click()
|
||||
chat_view.chat_message_input.send_keys('web3.eth.blockNumber')
|
||||
block_number = self.network_api.get_latest_block_number()
|
||||
chat_view.send_message_button.click()
|
||||
chat_view.wait_for_element_starts_with_text(str(self.network_api.get_latest_block_number()), 10)
|
||||
for number in block_number, block_number + 1:
|
||||
if chat_view.chat_element_by_text(str(number)).is_element_displayed():
|
||||
break
|
||||
else:
|
||||
pytest.fail('Actual block number is not shown')
|
||||
|
@ -28,9 +28,10 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
|
||||
device_1_chat.send_message_button.click()
|
||||
|
||||
device_2_home.element_by_text(message, 'button').click()
|
||||
device_2_home.connection_status.wait_for_invisibility_of_element(30)
|
||||
|
||||
if device_1_chat.chat_element_by_text(message).status.text != 'Seen':
|
||||
pytest.fail("'Seen' status is shown under the sent text message")
|
||||
pytest.fail("'Seen' status is not shown under the sent text message")
|
||||
|
||||
@marks.testrail_id(772)
|
||||
def test_offline_messaging_1_1_chat(self):
|
||||
|
@ -236,6 +236,14 @@ class BaseView(object):
|
||||
info('Click system back button')
|
||||
self.driver.press_keycode(4)
|
||||
|
||||
def copy_text(self):
|
||||
info('Copy text')
|
||||
self.driver.press_keycode(278)
|
||||
|
||||
def paste_text(self):
|
||||
info('Paste text')
|
||||
self.driver.press_keycode(279)
|
||||
|
||||
def send_as_keyevent(self, string):
|
||||
keys = {'0': 7, '1': 8, '2': 9, '3': 10, '4': 11, '5': 12, '6': 13, '7': 14, '8': 15, '9': 16,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user