mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-12 17:54:32 +00:00
e2e: merge too granular e2e
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
2618201bb3
commit
b6623ae1c3
@ -396,13 +396,21 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
|
||||
home_1 = profile_1.get_back_to_home_view()
|
||||
public_key_2 = home_2.get_public_key_and_username()
|
||||
home_2.home_button.click()
|
||||
chat_1 = home_1.add_contact(public_key_2)
|
||||
|
||||
home_1.just_fyi("Check that can send emoji in 1-1 chat")
|
||||
emoji_name = random.choice(list(emoji.EMOJI_UNICODE))
|
||||
emoji_unicode = emoji.EMOJI_UNICODE[emoji_name]
|
||||
chat_1.send_message(emoji.emojize(emoji_name))
|
||||
chat_2 = home_2.get_chat(default_username_1).click()
|
||||
for chat in chat_1, chat_2:
|
||||
if not chat.chat_element_by_text(emoji_unicode).is_element_displayed():
|
||||
self.errors.append('Message with emoji was not sent or received in 1-1 chat')
|
||||
|
||||
home_1.just_fyi("Check that link can be opened from 1-1 chat")
|
||||
chat_1 = home_1.add_contact(public_key_2)
|
||||
url_message = 'http://status.im'
|
||||
chat_1.send_message(url_message)
|
||||
chat_1.home_button.double_click()
|
||||
chat_2 = home_2.get_chat(default_username_1).click()
|
||||
chat_2.element_starts_with_text(url_message, 'button').click()
|
||||
web_view = chat_2.open_in_status_button.click()
|
||||
try:
|
||||
@ -618,30 +626,6 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
|
||||
|
||||
chat.chat_element_by_text(message_text[:-2]).wait_for_visibility_of_element(2)
|
||||
|
||||
@marks.testrail_id(5328)
|
||||
@marks.critical
|
||||
def test_send_emoji(self):
|
||||
sign_in = SignInView(self.driver)
|
||||
home = sign_in.create_user()
|
||||
|
||||
home.join_public_chat(home.get_random_chat_name())
|
||||
chat = sign_in.get_chat_view()
|
||||
emoji_name = random.choice(list(emoji.EMOJI_UNICODE))
|
||||
emoji_unicode = emoji.EMOJI_UNICODE[emoji_name]
|
||||
chat.chat_message_input.send_keys(emoji.emojize(emoji_name))
|
||||
chat.send_message_button.click()
|
||||
|
||||
if not chat.chat_element_by_text(emoji_unicode).is_element_displayed():
|
||||
self.errors.append('Message with emoji was not sent in public chat')
|
||||
|
||||
chat.get_back_to_home_view()
|
||||
home.add_contact(transaction_senders['O']['public_key'])
|
||||
chat.chat_message_input.send_keys(emoji.emojize(emoji_name))
|
||||
chat.send_message_button.click()
|
||||
|
||||
if not chat.chat_element_by_text(emoji_unicode).is_element_displayed():
|
||||
self.errors.append('Message with emoji was not sent in 1-1 chat')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(5783)
|
||||
@marks.critical
|
||||
|
@ -11,35 +11,35 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
|
||||
|
||||
@marks.testrail_id(5313)
|
||||
@marks.critical
|
||||
def test_public_chat_messaging(self):
|
||||
def test_public_chat_messaging_emojis_timestamps(self):
|
||||
self.create_drivers(2)
|
||||
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
|
||||
home_1, home_2 = device_1.create_user(), device_2.create_user()
|
||||
profile_1 = home_1.profile_button.click()
|
||||
default_username_1 = profile_1.default_username_text.text
|
||||
profile_1.home_button.click()
|
||||
public_key_2 = home_2.get_public_key_and_username()
|
||||
home_2.home_button.click()
|
||||
|
||||
home_1.add_contact(public_key_2)
|
||||
home_1.get_back_to_home_view()
|
||||
|
||||
home_1.just_fyi("Check preselected chats, redirect to status chat")
|
||||
home_1.plus_button.click_until_presence_of_element(home_1.join_public_chat_button)
|
||||
home_1.join_public_chat_button.click()
|
||||
preselected_chats = ['#status', '#chitchat', '#defi', '#crypto', '#markets', '#dap-ps']
|
||||
for chat in preselected_chats:
|
||||
if not home_1.element_by_text(chat).is_element_displayed():
|
||||
self.errors.append("'%s' text is not in the list of preselected chats" % chat)
|
||||
home_1.element_by_text('#status').click()
|
||||
home_1.element_by_text(preselected_chats[0]).click()
|
||||
status_chat = home_1.get_chat_view()
|
||||
if not status_chat.chat_message_input.is_element_displayed():
|
||||
if not status_chat.user_name_text != preselected_chats[0]:
|
||||
self.errors.append('No redirect to chat if tap on #status chat')
|
||||
status_chat.get_back_to_home_view()
|
||||
status_chat.home_button.click()
|
||||
|
||||
public_chat_name = home_1.get_random_chat_name()
|
||||
chat_1, chat_2 = home_1.join_public_chat(public_chat_name), home_2.join_public_chat(public_chat_name)
|
||||
|
||||
message = 'hello'
|
||||
home_1.just_fyi("Check sending text messages, emojis, usernames and timestamps on messages")
|
||||
emoji_name = random.choice(list(emoji.EMOJI_UNICODE))
|
||||
emoji_unicode = emoji.EMOJI_UNICODE[emoji_name]
|
||||
message, emoji_message = 'hello', emoji.emojize(emoji_name)
|
||||
chat_1.send_message(message)
|
||||
|
||||
sent_time_variants = chat_1.convert_device_time_to_chat_timestamp()
|
||||
@ -51,6 +51,11 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
|
||||
if chat_2.chat_element_by_text(message).username.text != default_username_1:
|
||||
self.errors.append("Default username '%s' is not shown next to the received message" % default_username_1)
|
||||
|
||||
chat_1.send_message(emoji_message)
|
||||
for chat in chat_1, chat_2:
|
||||
if not chat.chat_element_by_text(emoji_unicode).is_element_displayed():
|
||||
self.errors.append('Message with emoji was not sent or received in public chat')
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(5360)
|
||||
@ -167,36 +172,38 @@ class TestPublicChatSingleDevice(SingleDeviceTestCase):
|
||||
|
||||
@marks.testrail_id(5675)
|
||||
@marks.high
|
||||
def test_redirect_to_public_chat_tapping_tag_message(self):
|
||||
def test_redirect_to_public_chat_tapping_tag_message_fetch_more_history(self):
|
||||
signin = SignInView(self.driver)
|
||||
home_view = signin.create_user()
|
||||
chat = home_view.join_public_chat('montagne-angerufen')
|
||||
chat_name = 'montagne-angerufen'
|
||||
chat = home_view.join_public_chat(chat_name)
|
||||
tag_message = '#spectentur'
|
||||
|
||||
signin.just_fyi("Check that will be redirected to chat view on tap on tag message")
|
||||
chat.send_message(tag_message)
|
||||
chat.element_starts_with_text(tag_message).click()
|
||||
chat.element_by_text_part('montagne-angerufen').wait_for_invisibility_of_element()
|
||||
chat.element_by_text_part(chat_name).wait_for_invisibility_of_element()
|
||||
if not chat.user_name_text.text == tag_message:
|
||||
self.driver.fail('Could not redirect a user to a public chat tapping the tag message.')
|
||||
home_view = chat.get_back_to_home_view()
|
||||
if not home_view.element_by_text(tag_message).is_element_displayed():
|
||||
self.driver.fail('Could not find the public chat in user chat list.')
|
||||
self.errors.append('Could not redirect a user to a public chat tapping the tag message.')
|
||||
|
||||
@marks.testrail_id(6205)
|
||||
@marks.high
|
||||
def test_fetch_more_history_in_empty_chat(self):
|
||||
signin = SignInView(self.driver)
|
||||
signin.just_fyi("Check that can fetch previous history")
|
||||
device_time = parser.parse(signin.driver.device_time)
|
||||
yesterday = (device_time - timedelta(days=1)).strftime("%b %-d, %Y")
|
||||
before_yesterday = (device_time - timedelta(days=2)).strftime("%b %-d, %Y")
|
||||
quiet_time_yesterday, quiet_time_before_yesterday = '24 hours', '2 days'
|
||||
home_view = signin.create_user()
|
||||
chat = home_view.join_public_chat('montagne-angerufen-two')
|
||||
fetch_more = signin.get_translation_by_key("load-more-messages")
|
||||
for message in (yesterday, quiet_time_yesterday):
|
||||
if not chat.element_by_text_part(message).is_element_displayed():
|
||||
self.driver.fail('"%s" is not shown' % message)
|
||||
chat.element_by_text_part("↓ Fetch more messages").wait_and_click(120)
|
||||
chat.element_by_text_part("↓ Fetch more messages").wait_for_visibility_of_element(180)
|
||||
chat.element_by_text_part(fetch_more).wait_and_click(120)
|
||||
chat.element_by_text_part(fetch_more).wait_for_visibility_of_element(180)
|
||||
for message in (before_yesterday, quiet_time_before_yesterday):
|
||||
if not chat.element_by_text_part(message).is_element_displayed():
|
||||
self.driver.fail('"%s" is not shown' % message)
|
||||
|
||||
signin.just_fyi("Check that chat is added to home view")
|
||||
home_view = chat.get_back_to_home_view()
|
||||
if not home_view.element_by_text(tag_message).is_element_displayed():
|
||||
self.errors.append('Could not find the public chat in user chat list.')
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
@ -6,37 +6,6 @@ from views.sign_in_view import SignInView
|
||||
|
||||
class TestDApps(SingleDeviceTestCase):
|
||||
|
||||
@marks.testrail_id(5353)
|
||||
@marks.critical
|
||||
def test_filters_from_daap(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.create_user()
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
status_test_dapp.wait_for_d_aap_to_load()
|
||||
status_test_dapp.transactions_button.click()
|
||||
status_test_dapp.test_filters_button.scroll_and_click()
|
||||
for element in status_test_dapp.element_by_text('eth_uninstallFilter'), status_test_dapp.ok_button:
|
||||
if element.is_element_displayed(10):
|
||||
self.driver.fail("'Test filters' button produced an error")
|
||||
|
||||
@marks.testrail_id(5397)
|
||||
@marks.high
|
||||
def test_request_public_key_status_test_daap(self):
|
||||
user = basic_user
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(passphrase=user['passphrase'])
|
||||
status_test_dapp = home_view.open_status_test_dapp(allow_all=False)
|
||||
status_test_dapp.status_api_button.click_until_presence_of_element(status_test_dapp.request_contact_code_button)
|
||||
status_test_dapp.request_contact_code_button.click_until_presence_of_element(status_test_dapp.deny_button)
|
||||
status_test_dapp.deny_button.click()
|
||||
if status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
|
||||
self.driver.fail('Public key is returned but access was not allowed')
|
||||
status_test_dapp.request_contact_code_button.click_until_presence_of_element(status_test_dapp.deny_button)
|
||||
status_test_dapp.allow_button.click()
|
||||
if not status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
|
||||
self.driver.fail('Public key is not returned')
|
||||
|
||||
|
||||
@marks.testrail_id(6635)
|
||||
@marks.medium
|
||||
def test_webview_camera_permission(self):
|
||||
|
@ -11,134 +11,116 @@ class TestTransactionDApp(SingleDeviceTestCase):
|
||||
@marks.critical
|
||||
def test_request_stt_from_daap(self):
|
||||
sender = transaction_senders['K']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'], unique_password)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
initial_amount_STT = wallet_view.get_asset_amount_by_name('STT')
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
home = SignInView(self.driver).recover_access(sender['passphrase'], unique_password)
|
||||
status_test_dapp = home.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(unique_password)
|
||||
send_transaction = status_test_dapp.request_stt_button.click()
|
||||
|
||||
if not send_transaction.onboarding_message.is_element_displayed():
|
||||
self.driver.fail('It seems onboarding screen is not shown.')
|
||||
home.ok_got_it_button.click()
|
||||
home.cancel_button.click()
|
||||
wallet = home.wallet_button.click()
|
||||
initial_amount_STT = wallet.get_asset_amount_by_name('STT')
|
||||
wallet.dapp_tab_button.click(desired_element_text='Request STT')
|
||||
send_transaction = status_test_dapp.request_stt_button.click()
|
||||
send_transaction.sign_transaction(unique_password)
|
||||
status_test_dapp.wallet_button.click()
|
||||
|
||||
send_transaction_view.just_fyi('Verify that wallet balance is updated')
|
||||
wallet_view.wait_balance_is_changed('STT', initial_amount_STT, scan_tokens=True)
|
||||
send_transaction.just_fyi('Verify that wallet balance is updated')
|
||||
wallet.wait_balance_is_changed('STT', initial_amount_STT, scan_tokens=True)
|
||||
|
||||
send_transaction_view.just_fyi('Check logcat for sensitive data')
|
||||
values_in_logcat = send_transaction_view.find_values_in_logcat(password=unique_password)
|
||||
send_transaction.just_fyi('Check logcat for sensitive data')
|
||||
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(5342)
|
||||
@marks.critical
|
||||
def test_sign_message_from_daap(self):
|
||||
def test_sign_message_and_transactions_filters_from_daap(self):
|
||||
password = 'password_for_daap'
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.create_user(password=password)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
home = SignInView(self.driver).recover_access(passphrase=transaction_senders['W']['passphrase'],
|
||||
password=password)
|
||||
wallet = home.wallet_button.click()
|
||||
wallet.set_up_wallet()
|
||||
status_test_dapp = home.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()
|
||||
if not send_transaction_view.element_by_text("Test message").is_element_displayed():
|
||||
self.driver.fail("No message shown when signing!")
|
||||
send_transaction_view.enter_password_input.send_keys(password)
|
||||
send_transaction_view.sign_button.click()
|
||||
if not status_test_dapp.element_by_text_part('Signed message').is_element_displayed():
|
||||
self.driver.fail('Message was not signed')
|
||||
send_transaction_view.just_fyi('Check logcat for sensitive data')
|
||||
values_in_logcat = send_transaction_view.find_values_in_logcat(password=password)
|
||||
if values_in_logcat:
|
||||
self.driver.fail(values_in_logcat)
|
||||
|
||||
@marks.testrail_id(5333)
|
||||
@marks.low
|
||||
def test_deploy_contract_from_daap(self):
|
||||
sender = transaction_senders['L']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'])
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_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.deploy_contract_button.click()
|
||||
send_transaction_view.sign_transaction(default_gas_price=False)
|
||||
for text in 'Contract deployed at: ', 'Call contract get function', \
|
||||
'Call contract set function', 'Call function 2 times in a row':
|
||||
if not status_test_dapp.element_by_text(text).is_element_displayed(180):
|
||||
self.driver.fail('Contract was not created')
|
||||
wallet.just_fyi("Checking signing message")
|
||||
send_transaction = status_test_dapp.sign_message_button.click()
|
||||
if not send_transaction.element_by_text("Test message").is_element_displayed():
|
||||
self.errors.append("No message shown when signing!")
|
||||
send_transaction.enter_password_input.send_keys(password)
|
||||
send_transaction.sign_button.click()
|
||||
if not status_test_dapp.element_by_text_part('Signed message').is_element_displayed():
|
||||
self.errors.append('Message was not signed')
|
||||
send_transaction.just_fyi('Check logcat for sensitive data')
|
||||
values_in_logcat = send_transaction.find_values_in_logcat(password=password)
|
||||
if values_in_logcat:
|
||||
self.errors.append("When signing message from dapp: %s" % values_in_logcat)
|
||||
|
||||
wallet.just_fyi("Checking send 2 txs in batch")
|
||||
status_test_dapp.send_two_tx_in_batch_button.scroll_to_element()
|
||||
send_transaction = status_test_dapp.send_two_tx_in_batch_button.click()
|
||||
send_transaction.sign_transaction(password)
|
||||
if not send_transaction.sign_with_password.is_element_displayed(10):
|
||||
self.driver.fail('Second send transaction screen did not appear!')
|
||||
send_transaction.sign_transaction(password)
|
||||
|
||||
wallet.just_fyi("Checking send 2 txs one after another")
|
||||
status_test_dapp.send_two_tx_one_by_one_button.scroll_to_element()
|
||||
send_transaction = status_test_dapp.send_two_tx_one_by_one_button.click()
|
||||
send_transaction.sign_transaction(password)
|
||||
if not send_transaction.sign_with_password.is_element_displayed(20):
|
||||
self.driver.fail('Second send transaction screen did not appear!')
|
||||
send_transaction.sign_transaction(password)
|
||||
|
||||
wallet.just_fyi("Checking test filters")
|
||||
status_test_dapp.test_filters_button.scroll_and_click()
|
||||
for element in status_test_dapp.element_by_text('eth_uninstallFilter'), status_test_dapp.ok_button:
|
||||
if element.is_element_displayed(10):
|
||||
self.driver.fail("'Test filters' button produced an error")
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
||||
@marks.testrail_id(5784)
|
||||
@marks.medium
|
||||
def test_sign_typed_message(self):
|
||||
sender = transaction_senders['W']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'])
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
status_test_dapp.wait_for_d_aap_to_load()
|
||||
def test_sign_typed_message_deply_simple_contract_request_pub_key_from_dapp(self):
|
||||
user = transaction_senders['W']
|
||||
home = SignInView(self.driver).recover_access(passphrase=user['passphrase'])
|
||||
|
||||
home.just_fyi("Checking requesting public key from dapp")
|
||||
status_test_dapp = home.open_status_test_dapp(allow_all=False)
|
||||
status_test_dapp.status_api_button.click_until_presence_of_element(status_test_dapp.request_contact_code_button)
|
||||
status_test_dapp.request_contact_code_button.click_until_presence_of_element(status_test_dapp.deny_button)
|
||||
status_test_dapp.deny_button.click()
|
||||
if status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
|
||||
self.errors.append('Public key is returned but access was not allowed')
|
||||
status_test_dapp.request_contact_code_button.click_until_presence_of_element(status_test_dapp.deny_button)
|
||||
status_test_dapp.allow_button.click()
|
||||
if not status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
|
||||
self.errors.append('Public key is not returned')
|
||||
status_test_dapp.dapp_tab_button.double_click()
|
||||
wallet = home.wallet_button.click()
|
||||
wallet.set_up_wallet()
|
||||
|
||||
home.just_fyi("Checking sign typed message")
|
||||
home.open_status_test_dapp(allow_all=True)
|
||||
status_test_dapp.transactions_button.click_until_presence_of_element(status_test_dapp.sign_typed_message_button)
|
||||
send_transaction_view = status_test_dapp.sign_typed_message_button.click()
|
||||
send_transaction_view.enter_password_input.send_keys(common_password)
|
||||
send_transaction_view.sign_button.click_until_absense_of_element(send_transaction_view.sign_button)
|
||||
|
||||
status_test_dapp.element_by_text_part('0xde3048417e5881acc9ca8466ab0b3e2f9f965a70acabbda2d140e95a28b13d2d2d38eba'
|
||||
'6c0a5bfdc50e5d59e0ed3226c749732fd4a9374b57f34121eaff2a5081c').wait_for_element(30)
|
||||
|
||||
@marks.testrail_id(5743)
|
||||
@marks.high
|
||||
def test_send_two_transactions_in_batch_in_dapp(self):
|
||||
sender = transaction_senders['W']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'])
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
status_test_dapp.wait_for_d_aap_to_load()
|
||||
status_test_dapp.transactions_button.click_until_presence_of_element(status_test_dapp.send_two_tx_in_batch_button)
|
||||
send_transaction_view = status_test_dapp.send_two_tx_in_batch_button.click()
|
||||
send_transaction_view.sign_transaction()
|
||||
|
||||
wallet_view.just_fyi('Check that second "Send transaction" screen appears')
|
||||
if not send_transaction_view.sign_with_password.is_element_displayed(10):
|
||||
self.driver.fail('Second send transaction screen did not appear!')
|
||||
|
||||
send_transaction_view.sign_transaction()
|
||||
|
||||
@marks.testrail_id(5744)
|
||||
@marks.critical
|
||||
def test_send_two_transactions_one_after_another_in_dapp(self):
|
||||
sender = transaction_senders['Z']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'])
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_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.send_two_tx_one_by_one_button.click()
|
||||
send_transaction_view.sign_transaction()
|
||||
|
||||
send_transaction_view.just_fyi('Check that second "Send transaction" screen appears')
|
||||
if not send_transaction_view.sign_with_password.is_element_displayed(20):
|
||||
self.driver.fail('Second send transaction screen did not appear!')
|
||||
|
||||
send_transaction_view.sign_transaction()
|
||||
|
||||
@marks.testrail_id(5677)
|
||||
@marks.high
|
||||
def test_onboarding_screen_when_requesting_tokens_for_recovered_account(self):
|
||||
signin_view = SignInView(self.driver)
|
||||
home_view = signin_view.recover_access(passphrase=transaction_senders['U']['passphrase'])
|
||||
status_test_dapp = home_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()
|
||||
if not send_transaction_view.onboarding_message.is_element_displayed():
|
||||
self.driver.fail('It seems onboarding screen is not shown.')
|
||||
send_transaction = status_test_dapp.sign_typed_message_button.click()
|
||||
send_transaction.enter_password_input.send_keys(common_password)
|
||||
send_transaction.sign_button.click_until_absense_of_element(send_transaction.sign_button)
|
||||
if not status_test_dapp.element_by_text_part('0xde3048417e5881acc9ca8466ab0b3e2f9f96').is_element_displayed(30):
|
||||
self.errors.append("Hash of signed typed message is not shown!")
|
||||
|
||||
home.just_fyi("Checking deploy simple contract")
|
||||
send_transaction = status_test_dapp.deploy_contract_button.click()
|
||||
send_transaction.sign_transaction(default_gas_price=False)
|
||||
if not status_test_dapp.element_by_text('Contract deployed at: ').is_element_displayed(180):
|
||||
self.errors.append('Contract was not created')
|
||||
for text in ['Call contract get function',
|
||||
'Call contract set function', 'Call function 2 times in a row']:
|
||||
status_test_dapp.element_by_text(text).scroll_to_element()
|
||||
self.errors.verify_no_errors()
|
||||
|
@ -36,102 +36,75 @@ class TestTransactionDApp(SingleDeviceTestCase):
|
||||
|
||||
@marks.testrail_id(6251)
|
||||
@marks.critical
|
||||
def test_keycard_sign_message_from_daap(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.create_user(keycard=True)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
def test_keycard_sign_message_and_transactions_from_daap(self):
|
||||
home = SignInView(self.driver).recover_access(passphrase=transaction_senders['Z']['passphrase'],
|
||||
keycard=True)
|
||||
wallet = home.wallet_button.click()
|
||||
wallet.set_up_wallet()
|
||||
status_test_dapp = home.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()
|
||||
if not send_transaction_view.element_by_text("Test message").is_element_displayed():
|
||||
self.driver.fail("No message shown when signing!")
|
||||
keycard_view = send_transaction_view.sign_with_keycard_button.click()
|
||||
keycard_view.enter_default_pin()
|
||||
if not keycard_view.element_by_text_part('Signed message').is_element_displayed():
|
||||
self.driver.fail('Message was not signed')
|
||||
keycard_view.just_fyi('Check logcat for sensitive data')
|
||||
values_in_logcat = send_transaction_view.find_values_in_logcat(pin=pin,
|
||||
puk=puk,
|
||||
password=pair_code)
|
||||
if values_in_logcat:
|
||||
self.driver.fail(values_in_logcat)
|
||||
|
||||
@marks.testrail_id(5333)
|
||||
@marks.medium
|
||||
def test_keycard_deploy_contract_from_daap(self):
|
||||
sender = transaction_senders['L']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_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.deploy_contract_button.click()
|
||||
send_transaction_view.sign_transaction(keycard=True, default_gas_price=False)
|
||||
for text in 'Contract deployed at: ', 'Call contract get function', \
|
||||
'Call contract set function', 'Call function 2 times in a row':
|
||||
if not status_test_dapp.element_by_text(text).is_element_displayed(180):
|
||||
self.driver.fail('Contract was not created')
|
||||
wallet.just_fyi("Checking signing message")
|
||||
send_transaction = status_test_dapp.sign_message_button.click()
|
||||
if not send_transaction.element_by_text("Test message").is_element_displayed():
|
||||
self.errors.append("No message shown when signing!")
|
||||
keycard = send_transaction.sign_with_keycard_button.click()
|
||||
keycard.enter_default_pin()
|
||||
if not keycard.element_by_text_part('Signed message').is_element_displayed():
|
||||
self.errors.append('Message was not signed')
|
||||
keycard.just_fyi('Check logcat for sensitive data')
|
||||
values_in_logcat = send_transaction.find_values_in_logcat(pin=pin, puk=puk, password=pair_code)
|
||||
if values_in_logcat:
|
||||
self.driver.fail("After signing message: %s" % values_in_logcat)
|
||||
|
||||
wallet.just_fyi("Checking send 2 txs in batch")
|
||||
status_test_dapp.send_two_tx_in_batch_button.scroll_to_element()
|
||||
send_transaction = status_test_dapp.send_two_tx_in_batch_button.click()
|
||||
send_transaction.sign_transaction(keycard=True)
|
||||
if not send_transaction.sign_with_keycard_button.is_element_displayed(10):
|
||||
self.driver.fail('Second send transaction screen did not appear!')
|
||||
send_transaction.sign_transaction(keycard=True)
|
||||
|
||||
wallet.just_fyi("Checking send 2 txs one after another")
|
||||
status_test_dapp.send_two_tx_one_by_one_button.scroll_to_element()
|
||||
send_transaction = status_test_dapp.send_two_tx_one_by_one_button.click()
|
||||
send_transaction.sign_transaction(keycard=True)
|
||||
if not send_transaction.sign_with_keycard_button.is_element_displayed(20):
|
||||
self.driver.fail('Second send transaction screen did not appear!')
|
||||
send_transaction.sign_transaction(keycard=True)
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
||||
@marks.testrail_id(6310)
|
||||
@marks.medium
|
||||
def test_keycard_sign_typed_message(self):
|
||||
def test_keycard_sign_typed_message_deploy_simple_contract(self):
|
||||
sender = transaction_senders['W']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
home = SignInView(self.driver).recover_access(sender['passphrase'], keycard=True)
|
||||
wallet = home.wallet_button.click()
|
||||
wallet.set_up_wallet()
|
||||
status_test_dapp = home.open_status_test_dapp()
|
||||
status_test_dapp.wait_for_d_aap_to_load()
|
||||
status_test_dapp.transactions_button.click_until_presence_of_element(status_test_dapp.sign_typed_message_button)
|
||||
send_transaction_view = status_test_dapp.sign_typed_message_button.click()
|
||||
send_transaction_view.sign_with_keycard_button.click()
|
||||
keycard_view = send_transaction_view.sign_with_keycard_button.click()
|
||||
|
||||
wallet.just_fyi("Checking sign typed message")
|
||||
send_transaction = status_test_dapp.sign_typed_message_button.click()
|
||||
send_transaction.sign_with_keycard_button.click()
|
||||
keycard_view = send_transaction.sign_with_keycard_button.click()
|
||||
keycard_view.enter_default_pin()
|
||||
if not keycard_view.element_by_text_part('0xde3048417').is_element_displayed():
|
||||
self.driver.fail('Typed message was not signed')
|
||||
self.errors.append('Typed message was not signed')
|
||||
|
||||
wallet.just_fyi("Checking deploy simple contract")
|
||||
send_transaction_view = status_test_dapp.deploy_contract_button.click()
|
||||
send_transaction_view.sign_transaction(keycard=True, default_gas_price=False)
|
||||
if not status_test_dapp.element_by_text('Contract deployed at: ').is_element_displayed(180):
|
||||
self.errors.append('Contract was not created')
|
||||
for text in ['Call contract get function',
|
||||
'Call contract set function', 'Call function 2 times in a row']:
|
||||
status_test_dapp.element_by_text(text).scroll_to_element()
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6287)
|
||||
@marks.high
|
||||
def test_keycard_send_two_transactions_in_batch_in_dapp(self):
|
||||
sender = transaction_senders['W']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
status_test_dapp.wait_for_d_aap_to_load()
|
||||
status_test_dapp.transactions_button.click_until_presence_of_element(status_test_dapp.send_two_tx_in_batch_button)
|
||||
send_transaction_view = status_test_dapp.send_two_tx_in_batch_button.click()
|
||||
send_transaction_view.sign_transaction(keycard=True)
|
||||
|
||||
wallet_view.just_fyi('Check that second "Send transaction" screen appears')
|
||||
if not send_transaction_view.sign_with_keycard_button.is_element_displayed(10):
|
||||
self.driver.fail('Second send transaction screen did not appear!')
|
||||
|
||||
send_transaction_view.sign_transaction(keycard=True)
|
||||
|
||||
@marks.testrail_id(6288)
|
||||
@marks.critical
|
||||
def test_keycard_send_two_transactions_one_after_another_in_dapp(self):
|
||||
sender = transaction_senders['Z']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
status_test_dapp = home_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.send_two_tx_one_by_one_button.click()
|
||||
send_transaction_view.sign_transaction(keycard=True)
|
||||
|
||||
wallet_view.just_fyi('Check that second "Send transaction" screen appears')
|
||||
if not send_transaction_view.sign_with_keycard_button.is_element_displayed(20):
|
||||
self.driver.fail('Second send transaction screen did not appear!')
|
||||
|
||||
send_transaction_view.sign_transaction(keycard=True)
|
||||
|
||||
|
||||
|
@ -150,11 +150,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||
self.network_api.wait_for_confirmation_of_transaction(sub_account_address, transaction_amount_1)
|
||||
wallet_view.find_transaction_in_history(amount=transaction_amount)
|
||||
wallet_view.find_transaction_in_history(amount=format(float(transaction_amount_1),'.11f').rstrip('0'))
|
||||
#transactions_view = wallet_view.transaction_history_button.click()
|
||||
|
||||
wallet_view.just_fyi("Check transactions on subaccount")
|
||||
#transactions_view.transactions_table.find_transaction(amount=transaction_amount)
|
||||
#transactions_view.transactions_table.find_transaction(amount=format(float(transaction_amount_1),'.11f').rstrip('0'))
|
||||
self.network_api.verify_balance_is_updated(updated_balance, status_account_address)
|
||||
|
||||
wallet_view.just_fyi("Verify total ETH on main wallet view")
|
||||
|
@ -14,43 +14,19 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||
|
||||
@marks.testrail_id(5308)
|
||||
@marks.critical
|
||||
def test_send_eth_from_wallet_to_address(self):
|
||||
def test_send_eth_from_wallet_to_address_incorrect_password(self):
|
||||
recipient = basic_user
|
||||
sender = transaction_senders['P']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.recover_access(sender['passphrase'], password=unique_password)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
wallet_view.accounts_status_account.click()
|
||||
transaction_amount = wallet_view.get_unique_amount()
|
||||
wallet_view.send_transaction(amount=transaction_amount,
|
||||
sign_transaction=True,
|
||||
recipient='0x%s' % recipient['address'],
|
||||
sender_password=unique_password )
|
||||
sign_in = SignInView(self.driver)
|
||||
home = sign_in.recover_access(sender['passphrase'], password=unique_password)
|
||||
wallet = home.wallet_button.click()
|
||||
wallet.set_up_wallet()
|
||||
wallet.accounts_status_account.click()
|
||||
transaction_amount = wallet.get_unique_amount()
|
||||
|
||||
wallet_view.just_fyi('Check that transaction is appeared in transaction history')
|
||||
wallet_view.find_transaction_in_history(amount=transaction_amount)
|
||||
|
||||
wallet_view.just_fyi('Check logcat for sensitive data')
|
||||
values_in_logcat = wallet_view.find_values_in_logcat(password=unique_password)
|
||||
if values_in_logcat:
|
||||
self.driver.fail(values_in_logcat)
|
||||
|
||||
|
||||
@marks.testrail_id(5408)
|
||||
@marks.high
|
||||
def test_transaction_wrong_password_wallet(self):
|
||||
recipient = basic_user
|
||||
sender = wallet_users['A']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
sign_in_view.recover_access(sender['passphrase'])
|
||||
home_view = sign_in_view.get_home_view()
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
wallet_view.accounts_status_account.click()
|
||||
send_transaction = wallet_view.send_transaction_button.click()
|
||||
wallet.just_fyi("Checking that can't send transaction with wrong password")
|
||||
send_transaction = wallet.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.set_recipient_address('0x%s' % recipient['address'])
|
||||
send_transaction.sign_transaction_button.click()
|
||||
@ -61,6 +37,20 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||
if send_transaction.element_by_text_part('Transaction sent').is_element_displayed():
|
||||
self.driver.fail('Transaction was sent with a wrong password')
|
||||
|
||||
wallet.just_fyi("Fix password and sign transaction")
|
||||
send_transaction.enter_password_input.clear()
|
||||
send_transaction.enter_password_input.send_keys(unique_password)
|
||||
send_transaction.sign_button.click()
|
||||
wallet.ok_button.wait_and_click()
|
||||
|
||||
wallet.just_fyi('Check that transaction is appeared in transaction history')
|
||||
wallet.find_transaction_in_history(amount=transaction_amount)
|
||||
|
||||
wallet.just_fyi('Check logcat for sensitive data')
|
||||
values_in_logcat = wallet.find_values_in_logcat(password=unique_password)
|
||||
if values_in_logcat:
|
||||
self.driver.fail(values_in_logcat)
|
||||
|
||||
@marks.testrail_id(6237)
|
||||
@marks.high
|
||||
def test_fetching_balance_after_offline(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user