new e2e and fixes

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-08-11 18:10:53 +02:00
parent 7d19de4e69
commit f128c0ceed
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
10 changed files with 156 additions and 48 deletions

View File

@ -23,6 +23,7 @@
(i18n/label :t/open-home)] (i18n/label :t/open-home)]
[quo/button {:type :icon [quo/button {:type :icon
:theme :icon :theme :icon
:accessibility-label :universal-qr-scanner
:on-press #(hide-sheet-and-dispatch :on-press #(hide-sheet-and-dispatch
[::qr-scanner/scan-code [::qr-scanner/scan-code
{:handler ::qr-scanner/on-scan-success}])} {:handler ::qr-scanner/on-scan-success}])}

View File

@ -52,6 +52,7 @@ camera_access_error_text = "To grant the required camera permission, please go t
photos_access_error_text = "To grant the required photos permission, please go to your system settings " \ photos_access_error_text = "To grant the required photos permission, please go to your system settings " \
"and make sure that Status > Photos is selected." "and make sure that Status > Photos is selected."
delete_alert_text = "Warning: If you dont have your seed phrase written down, you will lose access to your funds after you delete your profile"
connection_not_secure_text = "Connection is not secure! " \ connection_not_secure_text = "Connection is not secure! " \
"Do not sign transactions or send personal data on this site." "Do not sign transactions or send personal data on this site."

View File

@ -2,7 +2,7 @@ import re
from tests import marks, bootnode_address, mailserver_address, camera_access_error_text, \ from tests import marks, bootnode_address, mailserver_address, camera_access_error_text, \
photos_access_error_text, test_dapp_url, test_dapp_name, mailserver_ams, mailserver_gc, \ photos_access_error_text, test_dapp_url, test_dapp_name, mailserver_ams, mailserver_gc, \
mailserver_hk, used_fleet, common_password mailserver_hk, used_fleet, common_password, delete_alert_text
from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase
from tests.users import transaction_senders, basic_user, ens_user, ens_user_ropsten from tests.users import transaction_senders, basic_user, ens_user, ens_user_ropsten
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -26,6 +26,55 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
if not profile_view.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'): if not profile_view.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
self.driver.fail('Profile picture was not updated') self.driver.fail('Profile picture was not updated')
@marks.testrail_id(6318)
@marks.medium
def test_can_delete_several_multiaccounts(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
profile = sign_in.profile_button.click()
profile.logout()
if sign_in.ok_button.is_element_displayed():
sign_in.ok_button.click()
sign_in.your_keys_more_icon.click()
sign_in.generate_new_key_button.click()
sign_in.generate_key_button.click()
sign_in.next_button.click()
sign_in.next_button.click()
sign_in.create_password_input.set_value(common_password)
sign_in.next_button.click()
sign_in.confirm_your_password_input.set_value(common_password)
sign_in.next_button.click()
sign_in.maybe_later_button.click_until_presence_of_element(sign_in.lets_go_button)
sign_in.lets_go_button.click()
sign_in.just_fyi('Delete 2nd multiaccount')
public_key, username = sign_in.get_public_key_and_username(return_username=True)
profile.privacy_and_security_button.click()
profile.delete_my_profile_button.click()
for element in (username, delete_alert_text):
if not profile.element_by_text(delete_alert_text).is_element_displayed():
self.errors.append('Required %s is not shown when deleting multiaccount' % element)
profile.delete_profile_button.click()
if profile.element_by_text('Profile deleted').is_element_displayed():
self.driver.fail('Profile is deleted without confirmation with password')
profile.delete_my_profile_password_input.set_value(common_password)
profile.delete_profile_button.click_until_presence_of_element(profile.element_by_text('Profile deleted'))
profile.ok_button.click()
sign_in.just_fyi('Delete last multiaccount')
sign_in.sign_in()
sign_in.profile_button.click()
profile.privacy_and_security_button.click()
profile.delete_my_profile_button.click()
profile.delete_my_profile_password_input.set_value(common_password)
profile.delete_profile_button.click()
profile.ok_button.click()
if not sign_in.get_started_button.is_element_displayed():
self.errors.append('No redirected to carousel view after deleting last multiaccount')
self.errors.verify_no_errors()
@marks.testrail_id(5741) @marks.testrail_id(5741)
@marks.high @marks.high
def test_mobile_data_usage_popup_continue_syncing(self): def test_mobile_data_usage_popup_continue_syncing(self):

View File

@ -156,22 +156,6 @@ class TestWalletManagement(SingleDeviceTestCase):
self.errors.append('Collectibles can be sent from wallet') self.errors.append('Collectibles can be sent from wallet')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5467)
@marks.medium
def test_deny_camera_access_scanning_wallet_adders(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
wallet = sign_in.wallet_button.click()
wallet.set_up_wallet()
wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click()
send_transaction.chose_recipient_button.click()
send_transaction.scan_qr_code_button.click()
send_transaction.deny_button.click()
send_transaction.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
send_transaction.ok_button.click()
send_transaction.scan_qr_code_button.click()
send_transaction.deny_button.wait_for_visibility_of_element(2)
@marks.testrail_id(5435) @marks.testrail_id(5435)
@marks.medium @marks.medium
@ -248,6 +232,7 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet_view.set_up_wallet() wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click() wallet_view.accounts_status_account.click()
wallet_view.collectibles_button.click() wallet_view.collectibles_button.click()
wallet_view.cryptokitties_in_collectibles_button.wait_for_element(60)
wallet_view.cryptokitties_in_collectibles_button.click() wallet_view.cryptokitties_in_collectibles_button.click()
web_view = wallet_view.view_in_cryptokitties_button.click() web_view = wallet_view.view_in_cryptokitties_button.click()
web_view.element_by_text('cryptokitties.co').click() web_view.element_by_text('cryptokitties.co').click()

View File

@ -1,6 +1,6 @@
import time import time
from tests import marks, camera_access_error_text from tests import marks, camera_access_error_text, photos_access_error_text
from tests.users import basic_user, dummy_user, ens_user_ropsten from tests.users import basic_user, dummy_user, ens_user_ropsten
from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -188,19 +188,80 @@ class TestChatManagement(SingleDeviceTestCase):
if not warning_text.is_element_displayed(): if not warning_text.is_element_displayed():
self.driver.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.testrail_id(6319)
@marks.medium @marks.medium
def test_deny_camera_access_scanning_contact_code(self): def test_deny_access_camera_and_gallery(self):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
home = sign_in.create_user() home = sign_in.create_user()
home.just_fyi("Denying access to camera in universal qr code scanner")
home.plus_button.click()
home.universal_qr_scanner_button.click()
home.deny_button.click()
home.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
home.ok_button.click()
home.get_back_to_home_view()
home.just_fyi("Denying access to camera in scan chat key view")
home.plus_button.click() home.plus_button.click()
contacts_view = home.start_new_chat_button.click() contacts_view = home.start_new_chat_button.click()
contacts_view.scan_contact_code_button.click() contacts_view.scan_contact_code_button.click()
contacts_view.deny_button.click() contacts_view.deny_button.click()
contacts_view.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3) contacts_view.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
contacts_view.ok_button.click() contacts_view.ok_button.click()
contacts_view.scan_contact_code_button.click() home.get_back_to_home_view()
contacts_view.deny_button.wait_for_visibility_of_element(2)
home.just_fyi("Denying access to gallery at attempt to send image")
chat = home.add_contact(basic_user['public_key'])
chat.show_images_button.click()
chat.deny_button.click()
chat.image_from_gallery_button.click()
chat.deny_button.click()
contacts_view.element_by_text(photos_access_error_text).wait_for_visibility_of_element(3)
contacts_view.ok_button.click()
home.get_back_to_home_view()
home.just_fyi("Denying access to camera in wallet view")
wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.scan_qr_button.click()
wallet.deny_button.click()
wallet.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
wallet.ok_button.click()
home.just_fyi("Denying access to camera in send transaction > scan address view")
wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click()
send_transaction.chose_recipient_button.click()
send_transaction.scan_qr_code_button.click()
send_transaction.deny_button.click()
send_transaction.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
send_transaction.ok_button.click()
wallet.back_button.click()
home.just_fyi("Allow access to camera in universal qr code scanner and check it in other views")
wallet.home_button.click()
home.plus_button.click()
home.universal_qr_scanner_button.click()
home.allow_button.click()
if not home.element_by_text('Scan QR code').is_element_displayed():
self.errors.append('Scan QR code is not opened after denying and allowing permission to the camera')
home.cancel_button.click()
wallet = home.wallet_button.click()
wallet.scan_qr_button.click()
if not home.element_by_text('Scan QR code').is_element_displayed():
self.errors.append('Scan QR code is not opened after allowing permission to the camera from univesal QR code'
' scanner view')
wallet.cancel_button.click()
wallet.home_button.click()
home.get_chat(basic_user['username']).click()
chat.show_images_button.click()
chat.allow_button.click()
if not chat.first_image_from_gallery.is_element_displayed():
self.errors.append('Image previews are not shown after denying and allowing access to gallery')
self.errors.verify_no_errors()
@marks.testrail_id(5757) @marks.testrail_id(5757)
@marks.medium @marks.medium
@ -590,10 +651,9 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
device_1.just_fyi("check that PNs are still enabled in profile after closing 'background notification centre' " device_1.just_fyi("check that PNs are still enabled in profile after closing 'background notification centre' "
"message and relogin") "message and relogin")
home_1.profile_button.click() device_1.open_notification_bar()
profile_1.push_notification_toggle.scroll_to_element() if not device_1.element_by_text_part("Background notification service").is_element_displayed():
if not profile_1.push_notification_toggle.is_element_image_equals_template('enabled_toggle.png'): self.errors.append("Background notification service is not started after relogin")
self.errors.append('Toggle is not enabled')
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -230,5 +230,6 @@ class TestBrowsing(SingleDeviceTestCase):
dapp_view.confirm() dapp_view.confirm()
dapp_view.progress_bar.wait_for_invisibility_of_element(20) dapp_view.progress_bar.wait_for_invisibility_of_element(20)
if not dapp_view.web_page.is_element_image_equals_template(urls[url]): if not dapp_view.web_page.is_element_image_equals_template(urls[url]):
self.driver.fail('Web page does not match expected template %s' % urls[url]) self.errors.append('Web page does not match expected template %s' % urls[url])
dapp_view.cross_icon.click() dapp_view.cross_icon.click()
self.errors.verify_no_errors()

View File

@ -105,19 +105,3 @@ class TestDApps(SingleDeviceTestCase):
self.errors.append("Subaccount is not selected after relogin in Dapps!") self.errors.append("Subaccount is not selected after relogin in Dapps!")
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5654)
@marks.low
def test_can_proceed_dapp_usage_after_transacting_it(self):
user = basic_user
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.recover_access(passphrase=user['passphrase'])
chat = home_view.join_public_chat(home_view.get_random_chat_name())
chat.back_button.click()
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()
send_transaction_view.ok_got_it_button.click()
send_transaction_view.sign_transaction()
if not status_test_dapp.assets_button.is_element_displayed():
self.driver.fail('Oops! Cannot proceed to use Status Test Dapp.')

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -22,6 +22,11 @@ class DeleteChatButton(BaseButton):
super(DeleteChatButton, self).__init__(driver) super(DeleteChatButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("delete-chat-button") self.locator = self.Locator.accessibility_id("delete-chat-button")
class UniversalQrCodeScannerButton(BaseButton):
def __init__(self, driver):
super(UniversalQrCodeScannerButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("universal-qr-scanner")
class ClearHistoryButton(BaseButton): class ClearHistoryButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
@ -174,6 +179,7 @@ class HomeView(BaseView):
self.chat_url_text = ChatUrlText(self.driver) self.chat_url_text = ChatUrlText(self.driver)
self.start_new_chat_button = StartNewChatButton(self.driver) self.start_new_chat_button = StartNewChatButton(self.driver)
self.universal_qr_scanner_button = UniversalQrCodeScannerButton(self.driver)
self.new_group_chat_button = NewGroupChatButton(self.driver) self.new_group_chat_button = NewGroupChatButton(self.driver)
self.join_public_chat_button = JoinPublicChatButton(self.driver) self.join_public_chat_button = JoinPublicChatButton(self.driver)
self.invite_friends_button = InviteFriendsButton(self.driver) self.invite_friends_button = InviteFriendsButton(self.driver)

View File

@ -557,6 +557,24 @@ class PrivacyAndSecurityButton(BaseButton):
super(PrivacyAndSecurityButton, self).__init__(driver) super(PrivacyAndSecurityButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('privacy-and-security-settings-button') self.locator = self.Locator.accessibility_id('privacy-and-security-settings-button')
class DeleteMyProfileButton(BaseButton):
def __init__(self, driver):
super(DeleteMyProfileButton, self).__init__(driver)
self.locator = self.Locator.text_selector('Delete my profile')
class DeleteMyProfilePasswordInput(BaseEditBox):
def __init__(self, driver):
super(DeleteMyProfilePasswordInput, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//android.widget.EditText')
class DeleteProfileButton(BaseButton):
def __init__(self, driver):
super(DeleteProfileButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('(//*[@text="Delete profile"])[2]')
class UseMobileDataToggle(BaseButton): class UseMobileDataToggle(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(UseMobileDataToggle, self).__init__(driver) super(UseMobileDataToggle, self).__init__(driver)
@ -629,6 +647,9 @@ class ProfileView(BaseView):
self.dapp_permissions_button = DappPermissionsButton(self.driver) self.dapp_permissions_button = DappPermissionsButton(self.driver)
self.revoke_access_button = RevokeAccessButton(self.driver) self.revoke_access_button = RevokeAccessButton(self.driver)
self.privacy_and_security_button = PrivacyAndSecurityButton(self.driver) self.privacy_and_security_button = PrivacyAndSecurityButton(self.driver)
self.delete_my_profile_button = DeleteMyProfileButton(self.driver)
self.delete_my_profile_password_input = DeleteMyProfilePasswordInput(self.driver)
self.delete_profile_button = DeleteProfileButton(self.driver)
# Backup recovery phrase # Backup recovery phrase
self.backup_recovery_phrase_button = BackupRecoveryPhraseButton(self.driver) self.backup_recovery_phrase_button = BackupRecoveryPhraseButton(self.driver)