e2e refactoring

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-10-30 15:40:14 +01:00
parent cf4bef8268
commit 3ac8f0c5fd
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
13 changed files with 180 additions and 202 deletions

View File

@ -118,15 +118,6 @@ class TestCreateAccount(SingleDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(5414)
@marks.critical
def test_password_in_logcat_creating_account(self):
sign_in = SignInView(self.driver)
sign_in.create_user(password=unique_password)
values_in_logcat = sign_in.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)
@marks.testrail_id(5718)
@marks.medium
def test_special_characters_in_password_when_creating_new_account(self):

View File

@ -393,7 +393,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
users = {
'scanning_ens_with_stateofus_domain_deep_link': {
'contact_code': 'https://join.status.im/u/%s.stateofus.eth' % ens_user_ropsten['ens'],
'username': ens_user_ropsten['username'],
'username': ens_user_ropsten['username']
},
'scanning_public_key': {
'contact_code': transaction_senders['A']['public_key'],
@ -403,15 +403,17 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
'contact_code': basic_user['public_key'],
'username': basic_user['username'],
},
'pasting_ens_ahother_domain': {
'pasting_ens_another_domain': {
'contact_code': ens_user['ens_another_domain'],
'username': '@%s' % ens_user['ens_another_domain'],
'nickname': 'my_dear_friend'
},
}
home.just_fyi('Add contact and check that they appear in Contacts view')
from views.chat_view import ChatView
chat_view = ChatView(self.driver)
for key in users:
profile.plus_button.click()
sign_in_view.just_fyi('Checking %s case' % key)
@ -421,21 +423,24 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
contact_view.scan_contact_code_button.click()
if contact_view.allow_button.is_element_displayed():
contact_view.allow_button.click()
contact_view.enter_qr_edit_box.set_value(users[key]['contact_code'])
contact_view.ok_button.click()
contact_view.enter_qr_edit_box.scan_qr(users[key]['contact_code'])
else:
contact_view.public_key_edit_box.click()
contact_view.public_key_edit_box.send_keys(users[key]['contact_code'])
if 'nickname' in users[key]:
chat_view.nickname_input_field.set_value(users[key]['nickname'])
contact_view.confirm_until_presence_of_element(profile.settings_button)
if not profile.element_by_text(users[key]['username']).is_element_displayed():
self.errors.append('In %s case username not found in contact view after scanning' % key)
if 'nickname' in users[key]:
if not profile.element_by_text(users[key]['nickname']).is_element_displayed():
self.errors.append('In %s case nickname %s not found in contact view after scanning' % (key, users[key]['nickname']))
home.just_fyi('Remove contact and check that it disappeared')
user_to_remove = '@%s' % ens_user['ens_another_domain']
profile.element_by_text(user_to_remove).click()
profile_user_to_remove = ChatView(self.driver)
profile_user_to_remove.remove_from_contacts.click()
profile_user_to_remove.back_button.click()
chat_view.remove_from_contacts.click()
chat_view.back_button.click()
if profile.element_by_text(user_to_remove).is_element_displayed():
self.errors.append('Removed user is still shown in contact view')
self.errors.verify_no_errors()
@ -498,21 +503,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view.request_a_feature_button.click()
profile_view.find_full_text('#status')
@marks.testrail_id(5382)
@marks.high
def test_contact_profile_view(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
home_view = sign_in_view.get_home_view()
home_view.add_contact(basic_user['public_key'])
chat_view = home_view.get_chat_view()
chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button)
chat_view.view_profile_button.click()
for element in (chat_view.profile_block_contact, chat_view.remove_from_contacts, chat_view.profile_send_message):
if not element.is_element_displayed():
self.errors.append('Expected %s is not visible' % element.locator)
self.errors.verify_no_errors()
@marks.testrail_id(5368)
@marks.high
def test_log_level_and_fleet(self):
@ -956,28 +946,34 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
device_1.just_fyi('join public chat')
device_1_chat.get_back_to_home_view()
device_1_public_chat = device_1_home.join_public_chat(public_chat_before_sync)
device_2_home = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
device_1_profile, device_2_profile = device_1_home.profile_button.click(), device_2_home.profile_button.click()
device_2.just_fyi('go to profile and set nickname for contact')
device_1_profile.open_contact_from_profile(basic_user['username'])
nickname = 'my_basic_user'
device_1_chat.set_nickname(nickname)
device_1_profile.back_button.click()
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_profile.discover_and_advertise_device(device_1_name)
device_1_profile.get_toggle_device_by_name(device_2_name).wait_and_click()
device_1_profile.sync_all_button.click()
device_1_profile.sync_all_button.wait_for_visibility_of_element(15)
device_2.just_fyi('check that contact is appeared in Contact list')
device_2_profile.back_button.click()
device_2_profile.back_button.click()
device_2.just_fyi('check that contact with nickname is appeared in Contact list')
[device.back_button.click(2) for device in (device_1_profile, device_2_profile)]
device_2_profile.contacts_button.scroll_to_element(9, 'up')
device_2_profile.contacts_button.click()
if not device_2_profile.element_by_text(basic_user['username']).is_element_displayed():
self.errors.append('"%s" is not found in Contacts after initial sync' % basic_user['username'])
for name in (basic_user['username'], nickname):
if not device_2_profile.element_by_text(name).is_element_displayed():
self.errors.append('"%s" is not found in Contacts after initial sync' % name)
device_1.just_fyi('send message to 1-1 chat with basic user and add another contact')
device_1_profile.home_button.click()
device_1_profile.home_button.click(desired_view='chat')
device_1_public_chat.back_button.click()
device_1_home.get_chat(basic_user['username']).click()
device_1_home.get_chat(nickname).click()
device_1_chat.chat_message_input.send_keys(message_after_sync)
device_1_chat.send_message_button.click()
device_1_chat.back_button.click()
@ -989,11 +985,23 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
'"%s" is not found in Contacts after adding when devices are paired' % transaction_senders['A'][
'username'])
device_1.just_fyi('Set nickname for added contact and check that it will be synced')
device_1_home.profile_button.click()
device_1_profile.open_contact_from_profile(transaction_senders['A']['username'])
nickname_after_sync = 'my_transaction sender'
device_1_chat.set_nickname(nickname_after_sync)
device_1_profile.back_button.click()
device_1.home_button.click(desired_view='chat')
if not device_2_profile.element_by_text(nickname_after_sync).is_element_displayed(60):
self.errors.append(
'"%s" is not updated in Contacts after setting nickname when devices are paired' % nickname_after_sync)
device_2_profile.home_button.click()
if not device_2_home.element_by_text_part(public_chat_before_sync).is_element_displayed():
self.errors.append(
'"%s" is not found in Home after initial sync when devices are paired' % public_chat_before_sync)
chat = device_2_home.get_chat(basic_user['username']).click()
chat = device_2_home.get_chat(nickname).click()
if chat.chat_element_by_text(message_before_sync).is_element_displayed():
self.errors.append('"%s" message sent before pairing is synced' % message_before_sync)
if not chat.chat_element_by_text(message_after_sync).is_element_displayed(60):

View File

@ -10,6 +10,25 @@ from views.recover_access_view import RecoverAccessView
class TestRecoverAccountSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(5394)
@marks.high
def test_account_recovery_with_uppercase_recovery_phrase_logcat(self):
user = transaction_senders['A']
passphrase = user['passphrase']
password = unique_password
capitalized_passphrase = passphrase.upper()
signin_view = SignInView(self.driver)
signin_view.recover_access(capitalized_passphrase, password=password)
profile_view = signin_view.profile_button.click()
username = profile_view.default_username_text.text
public_key = signin_view.get_public_key_and_username()
if username != user['username'] or public_key != user['public_key']:
self.driver.fail('Incorrect user was recovered')
values_in_logcat = signin_view.find_values_in_logcat(passphrase=capitalized_passphrase, password=password)
if values_in_logcat:
self.driver.fail(values_in_logcat)
@marks.testrail_id(6231)
@marks.medium
def test_no_backup_seedphrase_option_for_recovered_account(self):
@ -24,19 +43,6 @@ class TestRecoverAccountSingleDevice(SingleDeviceTestCase):
profile_view.backup_recovery_phrase_button.click()
if not profile_view.backup_recovery_phrase_button.is_element_displayed():
self.errors.append('Back up seed phrase option is active for recovered account!')
self.errors.verify_no_errors()
@marks.testrail_id(5366)
@marks.critical
def test_logcat_recovering_account(self):
sign_in = SignInView(self.driver)
sign_in.recover_access(passphrase=basic_user['passphrase'], password=unique_password)
values_in_logcat = sign_in.find_values_in_logcat(passphrase=basic_user['passphrase'], password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)
class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
@marks.testrail_id(5363)
@marks.high
@ -133,19 +139,6 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
if not home_view.profile_button.is_element_displayed():
self.driver.fail('Something went wrong. Probably, could not reach the home screen out.')
@marks.testrail_id(5394)
@marks.high
def test_account_recovery_with_uppercase_recovery_phrase(self):
user = transaction_senders['A']
passphrase = user['passphrase']
capitalized_passphrase = passphrase.upper()
signin_view = SignInView(self.driver)
signin_view.recover_access(capitalized_passphrase)
profile_view = signin_view.profile_button.click()
username = profile_view.default_username_text.text
public_key = signin_view.get_public_key_and_username()
if username != user['username'] or public_key != user['public_key']:
self.driver.fail('Incorrect user was recovered')
@marks.testrail_id(5719)
@marks.medium

View File

@ -9,27 +9,15 @@ class TestSignIn(SingleDeviceTestCase):
@marks.testrail_id(5312)
@marks.critical
def test_login_with_new_account(self):
def test_login_with_new_account_logcat(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
password = unique_password
sign_in.create_user(password=password)
profile = sign_in.profile_button.click()
default_username = profile.default_username_text.text
self.driver.close_app()
self.driver.launch_app()
# sign_in.accept_agreements()
if not sign_in.element_by_text(default_username).is_element_displayed():
self.driver.fail('Username is not shown while login')
sign_in.sign_in()
if not sign_in.home_button.is_element_displayed():
self.driver.fail('User is not logged in')
@marks.testrail_id(5463)
@marks.medium
def test_login_with_incorrect_password(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
profile = sign_in.profile_button.click()
profile.logout()
sign_in.just_fyi('Check that cannot login with incorrect password')
if sign_in.ok_button.is_element_displayed():
sign_in.ok_button.click()
sign_in.multi_account_on_login_button.click()
@ -37,28 +25,15 @@ class TestSignIn(SingleDeviceTestCase):
sign_in.sign_in_button.click()
sign_in.find_full_text("Wrong password")
@marks.testrail_id(5415)
@marks.critical
def test_password_in_logcat_sign_in(self):
sign_in = SignInView(self.driver)
sign_in.create_user(password=unique_password)
profile = sign_in.profile_button.click()
profile.logout()
sign_in.sign_in()
values_in_logcat = sign_in.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)
sign_in.just_fyi('Checking username and login')
if not sign_in.element_by_text(default_username).is_element_displayed():
self.driver.fail('Username is not shown while login')
sign_in.password_input.set_value(password)
sign_in.sign_in_button.click()
@marks.testrail_id(5327)
@marks.medium
def test_offline_login(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
self.driver.close_app()
sign_in.toggle_airplane_mode()
self.driver.launch_app()
home = sign_in.sign_in()
home.home_button.wait_for_visibility_of_element()
connection_text = sign_in.connection_status.text
if connection_text != 'Offline':
self.driver.fail("Connection status text '%s' doesn't match expected 'Offline'" % connection_text)
sign_in.just_fyi('Checking logcat that no password during creating new user and login')
if not sign_in.home_button.is_element_displayed(10):
self.driver.fail('User is not logged in')
values_in_logcat = sign_in.find_values_in_logcat(password=password)
if values_in_logcat:
self.driver.fail(values_in_logcat)

View File

@ -95,43 +95,46 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
@marks.testrail_id(5310)
@marks.critical
def test_offline_messaging_1_1_chat(self):
def test_offline_is_shown_messaging_1_1_chat(self):
self.create_drivers(2)
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()
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
public_key_1 = home_1.get_public_key_and_username()
home_1.home_button.click()
home_1.toggle_airplane_mode() # airplane mode on primary device
home_1.just_fyi('turn on airplane mode and check that offline status is shown on home view')
home_1.toggle_airplane_mode()
home_1.connection_status.wait_for_visibility_of_element(15)
if home_1.connection_status.text != 'Offline':
self.errors.append('Offline status is not shown in home screen')
profile_2 = home_2.profile_button.click()
username_2 = profile_2.default_username_text.text
profile_2.get_back_to_home_view()
chat_2 = home_2.add_contact(public_key_1)
message_1 = 'test message'
chat_2.chat_message_input.send_keys(message_1)
chat_2.send_message_button.click()
chat_2.toggle_airplane_mode() # airplane mode on secondary device
chat_2.send_message(message_1)
home_1.toggle_airplane_mode() # turning on WiFi connection on primary device
home_2.just_fyi('turn on airplane mode and check that offline status is shown on chat view')
chat_2.toggle_airplane_mode()
chat_2.element_by_text('Offline').wait_for_visibility_of_element(15)
if chat_2.connection_status.text != 'Offline':
self.errors.append('Offline status is not shown in 1-1 chat')
home_1.just_fyi('go back online and check that 1-1 chat will be fetched')
home_1.toggle_airplane_mode()
home_1.connection_status.wait_for_invisibility_of_element(30)
chat_element = home_1.get_chat(username_2)
chat_element.wait_for_visibility_of_element(30)
chat_1 = chat_element.click()
chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element(2)
chat_2.toggle_airplane_mode() # turning on WiFi connection on secondary device
home_1.toggle_airplane_mode() # airplane mode on primary device
home_1.just_fyi('checking offline fetching for another message')
chat_2.toggle_airplane_mode()
home_1.toggle_airplane_mode()
chat_2.element_by_text('Connecting to peers...').wait_for_invisibility_of_element(60)
chat_2.connection_status.wait_for_invisibility_of_element(60)
message_2 = 'one more message'
chat_2.chat_message_input.send_keys(message_2)
chat_2.send_message_button.click_until_absense_of_element(chat_2.send_message_button)
home_1.toggle_airplane_mode() # turning on WiFi connection on primary device
chat_2.send_message(message_2)
home_1.toggle_airplane_mode()
chat_1 = chat_element.click()
chat_1.chat_element_by_text(message_2).wait_for_visibility_of_element(180)
@ -737,41 +740,45 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
@marks.testrail_id(5403)
@marks.critical
def test_start_chat_with_ens(self):
sign_in = SignInView(self.driver)
home = sign_in.create_user()
profile = home.profile_button.click()
profile.switch_network('Mainnet with upstream RPC')
chat = home.add_contact(ens_user['ens'])
if not chat.element_by_text("@" + ens_user['ens']).is_element_displayed():
self.driver.fail('Wrong user is resolved from username when starting 1-1 chat.')
def test_start_chat_with_ens_mention_in_one_to_one(self):
home = SignInView(self.driver).create_user()
@marks.testrail_id(5326)
@marks.critical
def test_offline_status(self):
sign_in = SignInView(self.driver)
home_view = sign_in.create_user()
home_view.airplane_mode_button.click()
chat = home_view.add_contact(transaction_senders['C']['public_key'])
chat.element_by_text('Offline').wait_for_visibility_of_element(15)
if chat.connection_status.text != 'Offline':
self.errors.append('Offline status is not shown in 1-1 chat')
home.just_fyi('Start new chat with public key and check user profile from 1-1 header > options')
chat = home.add_contact(ens_user_ropsten['public_key'])
chat.chat_options.click_until_presence_of_element(chat.view_profile_button)
chat.view_profile_button.click()
for element in (chat.profile_block_contact, chat.remove_from_contacts, chat.profile_send_message):
if not element.is_element_displayed():
self.errors.append('Expected %s is not visible' % element.locator)
chat.get_back_to_home_view()
if home_view.connection_status.text != 'Offline':
self.errors.append('Offline status is not shown in home screen')
home.just_fyi('Start new chat with ENS and check that ENS is resolved')
ens = ens_user_ropsten['ens']
home.add_contact(ens, add_in_contacts=False)
if not chat.element_by_text("@" + ens).is_element_displayed():
self.driver.fail('Wrong user is resolved from username when starting 1-1 chat.')
public_chat = home_view.join_public_chat(home_view.get_random_chat_name())
if public_chat.connection_status.text != 'Offline':
self.errors.append('Offline status is not shown in a public chat')
home.just_fyi('Mention user by ENS in 1-1 chat')
message = '@%s hey!' % ens
chat.send_message(message)
chat.chat_element_by_text(message).click()
if not chat.profile_block_contact.is_element_displayed():
self.errors.append('No redirect to user profile after tapping on message with mention (ENS) in 1-1 chat')
home.just_fyi('Set nickname and mention user by nickname in 1-1 chat')
russian_nickname = 'МОЙ дорогой ДРУх'
chat.set_nickname(russian_nickname)
chat.back_button.click()
chat.select_mention_from_suggestion_list(russian_nickname + ' @' + ens)
chat.chat_element_by_text('%s hey!' % russian_nickname).click()
if not chat.profile_block_contact.is_element_displayed():
self.errors.append('No redirect to user profile after tapping on message with mention (nickname) in 1-1 chat')
self.errors.verify_no_errors()
@marks.testrail_id(6298)
@marks.medium
def test_can_scan_qr_with_chat_key_from_new_contact_view(self):
def test_can_scan_qr_with_chat_key_from_home_start_chat(self):
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.recover_access(basic_user['passphrase'])
profile = home_view.profile_button.click()
@ -828,12 +835,11 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
for key in url_data:
home_view.plus_button.click_until_presence_of_element(home_view.start_new_chat_button)
contact_view = home_view.start_new_chat_button.click()
sign_in_view.just_fyi('Checking %s case' % key)
sign_in_view.just_fyi('Checking scanning qr for "%s" case' % key)
contact_view.scan_contact_code_button.click()
if contact_view.allow_button.is_element_displayed():
contact_view.allow_button.click()
contact_view.enter_qr_edit_box.set_value(url_data[key]['url'])
contact_view.ok_button.click()
contact_view.enter_qr_edit_box.scan_qr(url_data[key]['url'])
from views.chat_view import ChatView
chat_view = ChatView(self.driver)
if url_data[key].get('error'):
@ -842,11 +848,10 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
chat_view.ok_button.click()
if url_data[key].get('username'):
if not chat_view.chat_message_input.is_element_displayed():
self.errors.append('In %s case chat input is not found after scanning' % key)
self.errors.append('In "%s" case chat input is not found after scanning, so no redirect to 1-1' % key)
if not chat_view.element_by_text(url_data[key]['username']).is_element_displayed():
self.errors.append('In %s case username not found after scanning' % key)
self.errors.append('In "%s" case "%s" not found after scanning' % (key, url_data[key]['username']))
chat_view.back_button.click()
self.errors.verify_no_errors()
@marks.testrail_id(6322)
@ -921,8 +926,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
home_view.universal_qr_scanner_button.click()
if home_view.allow_button.is_element_displayed():
home_view.allow_button.click()
home_view.enter_qr_edit_box.set_value(url_data[key]['url'])
home_view.ok_button.click()
home_view.enter_qr_edit_box.scan_qr(url_data[key]['url'])
from views.chat_view import ChatView
chat_view = ChatView(self.driver)
if url_data[key].get('error'):

View File

@ -37,7 +37,6 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
self.errors.append('No redirect to chat if tap on #status chat')
status_chat.get_back_to_home_view()
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)

View File

@ -69,10 +69,11 @@ class TestBrowsing(SingleDeviceTestCase):
@marks.testrail_id(6210)
@marks.high
def test_open_blocked_site(self):
def test_open_blocked_secure_not_secure_sites(self):
home_view = SignInView(self.driver).create_user()
daap_view = home_view.dapp_tab_button.click()
for url in ('metamask.site', 'https://www.cryptokitties.domainname'):
daap_view.just_fyi('Checking blocked website %s' % url)
dapp_detail = daap_view.open_url(url)
dapp_detail.find_text_part('This site is blocked')
if dapp_detail.browser_refresh_page_button.is_element_displayed():
@ -83,6 +84,21 @@ class TestBrowsing(SingleDeviceTestCase):
if dapp_detail.element_by_text('This site is blocked').is_element_displayed():
self.errors.append("Failed to open Dapp after 'Continue anyway' tapped for %s" % url)
daap_view.cross_icon.click()
daap_view.just_fyi('Checking connection is not secure warning')
browsing_view = daap_view.open_url('http://www.dvwa.co.uk')
browsing_view.url_edit_box_lock_icon.click_until_presence_of_element(
browsing_view.element_by_text(connection_not_secure_text))
browsing_view.cross_icon.click()
for url in ('https://www.bbc.com', 'https://instant.airswap.io'):
daap_view.just_fyi('Checking connection is secure for %s' % url)
browsing_view = daap_view.open_url(url)
browsing_view.wait_for_d_aap_to_load()
browsing_view.url_edit_box_lock_icon.click_until_presence_of_element(
browsing_view.element_by_text(connection_is_secure_text))
browsing_view.cross_icon.click()
self.errors.verify_no_errors()
@ -126,30 +142,6 @@ class TestBrowsing(SingleDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(5430)
@marks.medium
def test_connection_is_not_secure(self):
sign_in = SignInView(self.driver)
home_view = sign_in.create_user()
daap_view = home_view.dapp_tab_button.click()
browsing_view = daap_view.open_url('http://www.dvwa.co.uk')
browsing_view.url_edit_box_lock_icon.click_until_presence_of_element(browsing_view.element_by_text(connection_not_secure_text))
@marks.testrail_id(5402)
@marks.high
def test_connection_is_secure(self):
sign_in = SignInView(self.driver)
home_view = sign_in.create_user()
daap_view = home_view.dapp_tab_button.click()
browsing_view = daap_view.open_url('https://www.bbc.com')
browsing_view.wait_for_d_aap_to_load()
browsing_view.url_edit_box_lock_icon.click_until_presence_of_element(browsing_view.element_by_text(connection_is_secure_text))
browsing_view.cross_icon.click()
browsing_view = daap_view.open_url('https://instant.airswap.io')
browsing_view.wait_for_d_aap_to_load()
browsing_view.url_edit_box_lock_icon.click_until_presence_of_element(browsing_view.element_by_text(connection_is_secure_text))
@marks.testrail_id(5390)
@marks.high
def test_long_press_delete_clear_all_dapps(self):

View File

@ -1,5 +1,4 @@
import pytest
from tests import marks, test_dapp_url, test_dapp_name
from tests import marks, test_dapp_name
from tests.base_test_case import SingleDeviceTestCase
from tests.users import basic_user
from views.sign_in_view import SignInView

View File

@ -216,20 +216,26 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(5407)
@marks.medium
def test_cant_send_transaction_in_offline_mode(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.toggle_airplane_mode()
wallet_view.accounts_status_account.click_until_presence_of_element(wallet_view.send_transaction_button)
send_transaction = wallet_view.send_transaction_button.click()
def test_offline_can_login_cant_send_transaction(self):
home = SignInView(self.driver).create_user()
wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.toggle_airplane_mode()
wallet.accounts_status_account.click_until_presence_of_element(wallet.send_transaction_button)
send_transaction = wallet.send_transaction_button.click()
send_transaction.set_recipient_address('0x%s' % basic_user['address'])
send_transaction.amount_edit_box.set_value("0")
send_transaction.confirm()
send_transaction.sign_transaction_button.click()
if send_transaction.sign_with_password.is_element_displayed():
self.driver.fail("Sign transaction button is active in offline mode")
self.driver.close_app()
self.driver.launch_app()
SignInView(self.driver).sign_in()
home.home_button.wait_for_visibility_of_element()
connection_text = home.connection_status.text
if connection_text != 'Offline':
self.driver.fail("Connection status text '%s' doesn't match expected 'Offline'" % connection_text)
@marks.testrail_id(6225)
@marks.medium
@ -403,8 +409,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.scan_qr_button.click()
if wallet_view.allow_button.is_element_displayed():
wallet_view.allow_button.click()
wallet_view.enter_qr_edit_box.set_value(url_data[key]['url'])
wallet_view.ok_button.click()
wallet_view.enter_qr_edit_box.scan_qr(url_data[key]['url'])
if url_data[key].get('error'):
if not wallet_view.element_by_text_part(url_data[key]['error']).is_element_displayed():
self.errors.append('Expected error %s is not shown' % url_data[key]['error'])
@ -520,11 +525,17 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.add_to_favorites(recent_add_to_fav_name)
wallet_view.element_by_text('Recent').click()
send_transaction.just_fyi('Scan code, add it to favorites and recheck that it is preserved')
send_transaction.just_fyi('Scan invalid QR')
send_transaction.scan_qr_code_button.click()
send_transaction.allow_button.click(1)
wallet_view.enter_qr_edit_box.set_value(basic_user['address'])
wallet_view.enter_qr_edit_box.scan_qr('something%s' % basic_user['address'])
if not send_transaction.element_by_text_part('Invalid address').is_element_displayed(10):
self.driver.fail('No error is shown at attempt to scan invalid address')
wallet_view.ok_button.click()
send_transaction.just_fyi('Scan code, add it to favorites and recheck that it is preserved')
send_transaction.scan_qr_code_button.click()
wallet_view.enter_qr_edit_box.scan_qr(basic_user['address'])
send_transaction.add_to_favorites(basic_add_to_fav_name)
send_transaction.element_by_text('Favourites').scroll_and_click()
for name in (recent_add_to_fav_name, basic_add_to_fav_name):

View File

@ -19,6 +19,8 @@ ens_user_ropsten = dict()
ens_user_ropsten['ens'] = 'nastya'
ens_user_ropsten['username'] = 'Thoughtful Stupendous Graywolf'
ens_user_ropsten['address'] = '0x58d8c3D70ce4FA4b9fb10a665C8712238746F2ff'
ens_user_ropsten['public_key'] = '0x045efbcc044e5ae21ac3cf111ea6df6186e0cc50a2cd747f52a56d19ce516e683c66cb47f4b0a211108' \
'59aea9592dfba1e0bf4af11ff3eab995f844b3673643bf1'
dummy_user = dict()
dummy_user['username'] = "Vain Wordy Hagfish"

View File

@ -332,14 +332,19 @@ class StatusInBackgroundButton(BaseButton):
super(StatusInBackgroundButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[contains(@content-desc,"Status")]')
class EnterQRcodeEditBox(BaseEditBox):
def __init__(self, driver):
super(EnterQRcodeEditBox, self).__init__(driver)
self.locator = self.Locator.text_selector('Message')
def scan_qr(self, value):
self.set_value(value)
OkButton(self.driver).click()
class OkGotItButton(BaseButton):
def __init__(self,driver):
def __init__(self, driver):
super(OkGotItButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='Okay, got it']")
@ -354,6 +359,7 @@ class AirplaneModeButton(BaseButton):
self.locator = self.Locator.xpath_selector("//*[@content-desc='Airplane mode']")
def click(self):
self.driver.info('Turning on airplane mode')
action = TouchAction(self.driver)
action.press(None, 50, 0).move_to(None, 50, 300).perform()
super(AirplaneModeButton, self).click()

View File

@ -808,7 +808,6 @@ class ProfileView(BaseView):
return SyncedDeviceToggle(self.driver, device_name)
def discover_and_advertise_device(self, device_name):
self.profile_button.click()
self.settings_button.click()
self.sync_settings_button.click()
self.devices_button.scroll_to_element()

View File

@ -307,7 +307,6 @@ class SignInView(BaseView):
return self.get_home_view()
def sign_in(self, password=common_password, keycard=False, position=1):
# self.rooted_device_continue()
self.multi_account_on_login_button.wait_for_visibility_of_element(30)
self.get_multiaccount_by_position(position).click()