Skip to content

Commit

Permalink
e2e about dapp popup, fix e2e for switching mailserver, skipped low-p…
Browse files Browse the repository at this point in the history
…rio blocked e2e

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
  • Loading branch information
churik committed Oct 21, 2019
1 parent c0945c4 commit dbb4dfa
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class TestCreateAccount(SingleDeviceTestCase):
@marks.critical
@marks.battery_consumption
@marks.skip
# skipped because it is a part of other tests
# obsolate
def test_create_account(self):
sign_in = SignInView(self.driver, skip_popups=False)
sign_in.accept_agreements()
Expand Down Expand Up @@ -53,7 +55,7 @@ def test_switch_users_and_add_new_account(self):
sign_in.next_button.click()

if sign_in.get_public_key() == public_key:
pytest.fail('New account was not created')
self.driver.fail('New account was not created')

@marks.testrail_id(5379)
@marks.high
Expand Down
24 changes: 15 additions & 9 deletions test/appium/tests/atomic/account_management/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def test_change_profile_picture_several_times(self):
profile_view.swipe_down()
if not profile_view.profile_picture.is_element_image_equals_template(
file_name.replace('.png', '_profile.png')):
pytest.fail('Profile picture was not updated')
self.driver.fail('Profile picture was not updated')

@marks.testrail_id(5329)
@marks.critical
Expand Down Expand Up @@ -342,7 +342,7 @@ def test_log_level_and_fleet(self):
profile_view = sign_in_view.profile_button.click()
profile_view.advanced_button.click()
if 'release' in str(pytest.config.getoption('apk')):
# should be edited after showing some text in setting when log in disabled
# TODO: should be edited after showing some text in setting when log in disabled
if profile_view.log_level_setting.is_element_displayed():
self.errors.append('Log is not disabled')
if not profile_view.element_by_text('eth.beta').is_element_displayed():
Expand Down Expand Up @@ -485,6 +485,8 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):

@marks.testrail_id(5432)
@marks.medium
@marks.skip
# TODO: e2e blocker: no force-logout after enabling bootnode (enable after fix)
def test_custom_bootnodes(self):
self.create_drivers(2)
sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
Expand Down Expand Up @@ -531,10 +533,13 @@ def test_switch_mailserver(self):
sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1, home_2 = sign_in_1.create_user(), sign_in_2.create_user()
public_key = home_2.get_public_key()
home_2.get_back_to_home_view()

profile_1 = home_1.profile_button.click()
username_1 = profile_1.default_username_text.text
profile_1.advanced_button.click()

profile_1.just_fyi('add custom mailserver and connect to it')
profile_1.sync_settings_button.click()
profile_1.mail_server_button.click()
profile_1.plus_button.click()
server_name = 'test'
Expand All @@ -548,6 +553,7 @@ def test_switch_mailserver(self):
profile_1.get_back_to_home_view()
profile_1.home_button.click()

profile_1.just_fyi('start chat with user2 and check that all messages are delivered')
chat_1 = home_1.add_contact(public_key)
message = 'test message'
chat_1.chat_message_input.send_keys(message)
Expand Down Expand Up @@ -641,7 +647,7 @@ def test_pair_devices_sync_name_photo_public_group_chats(self):
group_chat_name = 'group-%s' % device_1_home.get_public_chat_name()
message_after_sync = 'sent after sync'

# device 1: join public chat, create group chat, edit user picture
device_1.just_fyi('join public chat, create group chat, edit user picture')
device_1_public_chat = device_1_home.join_public_chat(public_chat_before_sync_name)
device_1_public_chat.back_button.click()
device_1_one_to_one = device_1_home.add_contact(basic_user['public_key'])
Expand All @@ -652,18 +658,18 @@ def test_pair_devices_sync_name_photo_public_group_chats(self):
device_1_profile = device_1_home.get_profile_view()
device_1_profile.edit_profile_picture('sauce_logo.png')

# device 2: go to profile > Devices, set device name, discover device 2 to device 1
device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1')
device_2_home = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
device_2_profile = device_2_home.get_profile_view()
device_2_profile.discover_and_advertise_device(device_2_name)

# device 1: enable pairing of `device 2` and sync
device_1.just_fyi('enable pairing of `device 2` and sync')
device_1_profile.discover_and_advertise_device(device_1_name)
device_1_profile.get_toggle_device_by_name(device_2_name).click()
device_1_profile.sync_all_button.click()
device_1_profile.sync_all_button.wait_for_visibility_of_element(15)

# device 2: check that public chat and profile details are updated
device_2.just_fyi('check that public chat and profile details are updated')
device_2_home = device_2_profile.get_back_to_home_view()
if not device_2_home.element_by_text('#%s' % public_chat_before_sync_name).is_element_displayed():
self.errors.append('Public chat "%s" doesn\'t appear after initial sync'
Expand All @@ -673,7 +679,7 @@ def test_pair_devices_sync_name_photo_public_group_chats(self):
if not device_2_profile.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
self.errors.append('Profile picture was not updated after initial sync')

# device 1: send message to group chat, edit profile details and join to new public chat
device_1.just_fyi('send message to group chat, edit profile details and join to new public chat')
device_1_home = device_1_profile.get_back_to_home_view()
device_1_public_chat = device_1_home.join_public_chat(public_chat_after_sync_name)
device_1_public_chat.back_button.click()
Expand All @@ -684,7 +690,7 @@ def test_pair_devices_sync_name_photo_public_group_chats(self):
device_1_profile = device_1_home.profile_button.click()
device_1_profile.edit_profile_picture('sauce_logo_red.png')

# device 2: check that message in group chat is shown, profile details and public chats are synced
device_2.just_fyi('check that message in group chat is shown, profile details and public chats are synced')
device_2_profile.home_button.click()
if not device_2_home.element_by_text('#%s' % public_chat_after_sync_name).is_element_displayed():
self.errors.append('Public chat "%s" doesn\'t appear on other device when devices are paired'
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 @@ -29,6 +29,8 @@ def test_no_backup_seedphrase_option_for_recovered_account(self):

@marks.skip
@marks.testrail_id(845)
# test doesn't exist in TestRail
# obsolate
def test_recover_account_with_incorrect_passphrase(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
Expand All @@ -42,7 +44,7 @@ def test_recover_account_with_incorrect_passphrase(self):
sign_in.accept_agreements()
sign_in.recover_access(passphrase=' '.join(list(recovery_phrase.values())[::-1]))
if sign_in.get_public_key() == public_key:
pytest.fail('The same account is recovered with reversed passphrase')
self.driver.fail('The same account is recovered with reversed passphrase')

@marks.logcat
@marks.testrail_id(5366)
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 @@ -27,6 +27,8 @@ def test_login_with_new_account(self):

@marks.testrail_id(5463)
@marks.medium
@marks.skip
# TODO: e2e blocker: 8567 (should be enabled after fix)
def test_login_with_incorrect_password(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
Expand Down Expand Up @@ -64,4 +66,4 @@ def test_offline_login(self):
home.home_button.wait_for_visibility_of_element()
connection_text = sign_in.connection_status.text
if connection_text != 'Offline':
pytest.fail("Connection status text '%s' doesn't match expected 'Offline'" % connection_text)
self.driver.fail("Connection status text '%s' doesn't match expected 'Offline'" % connection_text)
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_copy_transaction_hash(self):
public_chat = home_view.join_public_chat('testchat')
public_chat.chat_message_input.paste_text_from_clipboard()
if public_chat.chat_message_input.text != transaction_hash:
pytest.fail('Transaction hash was not copied')
self.driver.fail('Transaction hash was not copied')

@marks.testrail_id(5341)
@marks.critical
Expand All @@ -115,16 +115,8 @@ def test_backup_recovery_phrase_warning_from_wallet(self):
sign_in.create_user()
wallet = sign_in.wallet_button.click()
wallet.set_up_wallet()
# if wallet.backup_recovery_phrase.is_element_present():
# pytest.fail("'Backup your Recovery phrase' option is shown on Wallet for an account with no funds")
# wallet.receive_transaction_button.click()
# address = wallet.address_text.text[2:]
# wallet.get_back_to_home_view()
# home = wallet.home_button.click()
# self.network_api.get_donate(address)
# home.wallet_button.click()
if not wallet.backup_recovery_phrase_warning_text.is_element_present():
pytest.fail("'Back up your seed phrase' warning is not shown on Wallet")
self.driver.fail("'Back up your seed phrase' warning is not shown on Wallet")
wallet.multiaccount_more_options.click_until_presence_of_element(wallet.backup_recovery_phrase)
wallet.backup_recovery_phrase.click()
profile = wallet.get_profile_view()
Expand All @@ -145,7 +137,7 @@ def test_no_collectibles_to_send_from_wallet(self):
send_transaction = wallet.send_transaction_button.click()
send_transaction.select_asset_button.click()
if send_transaction.asset_by_name(asset_name).is_element_displayed():
pytest.fail('Collectibles can be sent from wallet')
self.driver.fail('Collectibles can be sent from wallet')

@marks.testrail_id(5467)
@marks.medium
Expand All @@ -168,6 +160,7 @@ def test_deny_camera_access_scanning_wallet_adders(self):
@marks.testrail_id(5435)
@marks.medium
@marks.skip
# TODO: e2e blocker: 9225 (should be updated and enabled)
def test_filter_transactions_history(self):
user = wallet_users['C']
sign_in_view = SignInView(self.driver)
Expand All @@ -184,7 +177,7 @@ def test_filter_transactions_history(self):
details = transaction_history.transactions_table.transaction_by_index(i).click()
if details.get_recipient_address() != '0x' + user['address'] \
or details.element_by_text('Failed').is_element_displayed():
pytest.fail('Incoming transactions are not filtered')
self.driver.fail('Incoming transactions are not filtered')
details.back_button.click()

transaction_history.filters_button.click()
Expand All @@ -195,7 +188,7 @@ def test_filter_transactions_history(self):
details = transaction_history.transactions_table.transaction_by_index(i).click()
if details.get_sender_address() != '0x' + user['address'] \
or details.element_by_text('Failed').is_element_displayed():
pytest.fail('Outgoing transactions are not filtered')
self.driver.fail('Outgoing transactions are not filtered')
details.back_button.click()

transaction_history.filters_button.click()
Expand All @@ -205,7 +198,7 @@ def test_filter_transactions_history(self):
for i in range(transaction_history.transactions_table.get_transactions_number()):
details = transaction_history.transactions_table.transaction_by_index(i).click()
if not details.element_by_text('Failed').is_element_displayed():
pytest.fail('Failed transactions are not filtered')
self.driver.fail('Failed transactions are not filtered')
details.back_button.click()
self.verify_no_errors()

Expand Down
14 changes: 7 additions & 7 deletions test/appium/tests/atomic/chats/test_chats_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def test_clear_history_one_to_one_chat(self):
chat_view.send_message_button.click()
chat_view.clear_history()
if not chat_view.no_messages_in_chat.is_element_present():
pytest.fail('Message history is shown')
self.driver.fail('Message history is shown')
home_view.relogin()
home_view.get_chat_with_user(basic_user['username']).click()
if not chat_view.no_messages_in_chat.is_element_present():
pytest.fail('Message history is shown after re-login')
self.driver.fail('Message history is shown after re-login')

@marks.testrail_id(5319)
@marks.critical
Expand All @@ -42,7 +42,7 @@ def test_long_press_to_delete_1_1_chat(self):
sign_in.accept_agreements()
sign_in.sign_in()
if home.get_chat_with_user(basic_user['username']).is_element_displayed():
pytest.fail('Deleted 1-1 chat is present after relaunch app')
self.driver.fail('Deleted 1-1 chat is present after relaunch app')

@marks.testrail_id(5343)
@marks.critical
Expand Down Expand Up @@ -84,11 +84,11 @@ def test_open_chat_by_pasting_public_key(self):
contacts_view = home.start_new_chat_button.click()
contacts_view.public_key_edit_box.paste_text_from_clipboard()
if contacts_view.public_key_edit_box.text != public_key:
pytest.fail('Public key is not pasted from clipboard')
self.driver.fail('Public key is not pasted from clipboard')
contacts_view.confirm()
contacts_view.get_back_to_home_view()
if not home.get_chat_with_user(basic_user['username']).is_element_present():
pytest.fail("No chat open in home view")
self.driver.fail("No chat open in home view")

@marks.testrail_id(5387)
@marks.high
Expand Down Expand Up @@ -135,7 +135,7 @@ def test_incorrect_contact_code_start_new_chat(self):
contacts_view.confirm()
warning_text = contacts_view.element_by_text('Please enter or scan a valid chat key or username')
if not warning_text.is_element_displayed():
pytest.fail('Error is not shown for invalid public key')
self.driver.fail('Error is not shown for invalid public key')

@marks.testrail_id(5466)
@marks.medium
Expand Down Expand Up @@ -217,7 +217,7 @@ def test_add_contact_from_public_chat(self):
chat_1.element_by_text(username, 'text'),
chat_1.add_to_contacts,
chat_1.profile_send_message,
# temporary skipped due to 8601
# TODO: temporary skipped due to 8601
# chat_1.profile_send_transaction,
chat_1.profile_address_text]:
if not element.scroll_to_element():
Expand Down
Loading

0 comments on commit dbb4dfa

Please sign in to comment.