e2e: fixes

This commit is contained in:
Churikova Tetiana 2021-07-12 16:44:51 +02:00
parent b0457f594b
commit 4d5857dd01
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
7 changed files with 41 additions and 46 deletions

View File

@ -96,7 +96,8 @@ class TestCreateAccount(SingleDeviceTestCase):
if sign_in.generate_key_button.is_element_displayed(): if sign_in.generate_key_button.is_element_displayed():
self.errors.append("Agree with ToS is not mandatory to proceed onboarding!") self.errors.append("Agree with ToS is not mandatory to proceed onboarding!")
sign_in.accept_tos_checkbox.click() sign_in.accept_tos_checkbox.click()
sign_in.get_started_button.click() sign_in.get_started_button.click_until_presence_of_element(sign_in.generate_key_button)
sign_in.generate_key_button.click()
from views.sign_in_view import MultiAccountButton from views.sign_in_view import MultiAccountButton
account_button = sign_in.get_multiaccount_by_position(position=random.randint(1, 4), element_class=MultiAccountButton) account_button = sign_in.get_multiaccount_by_position(position=random.randint(1, 4), element_class=MultiAccountButton)
username = account_button.username.text username = account_button.username.text

View File

@ -333,37 +333,25 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(5453) @marks.testrail_id(5453)
@marks.medium @marks.medium
@marks.flaky # @marks.flaky
def test_privacy_policy_terms_of_use_node_version_need_help_in_profile(self): def test_privacy_policy_terms_of_use_node_version_need_help_in_profile(self):
signin = SignInView(self.driver) signin = SignInView(self.driver)
no_link_found_error_msg = 'Could not find privacy policy link at' no_link_found_error_msg = 'Could not find privacy policy link at'
no_link_open_error_msg = 'Could not open our privacy policy from' no_link_open_error_msg = 'Could not open our privacy policy from'
no_link_tos_error_msg = 'Could not open Terms of Use from' no_link_tos_error_msg = 'Could not open Terms of Use from'
signin.just_fyi("Checking privacy policy from sign in") signin.just_fyi("Checking privacy policy and TOS links")
if not signin.privacy_policy_link.is_element_present(): if not signin.privacy_policy_link.is_element_present():
self.driver.fail('%s Sign in view!' % no_link_found_error_msg) self.errors.append('%s Sign in view!' % no_link_found_error_msg)
web_page = signin.privacy_policy_link.click()
web_page.open_in_webview()
if not web_page.policy_summary.is_element_displayed():
self.errors.append('%s Sign in view!' % no_link_open_error_msg)
web_page.close_privacy_policy_button.click()
signin.just_fyi("Checking Terms of Use from sign")
if not signin.terms_of_use_link.is_element_displayed(): if not signin.terms_of_use_link.is_element_displayed():
self.driver.fail("No Terms of Use link on Sign in view!") self.driver.fail("No Terms of Use link on Sign in view!")
web_page = signin.terms_of_use_link.click()
web_page.open_in_webview()
web_page.wait_for_d_aap_to_load()
web_page.swipe_by_custom_coordinates(0.5,0.8,0.5,0.4)
if not web_page.terms_of_use_summary.is_element_displayed():
self.errors.append('%s Sign in view!' % no_link_tos_error_msg)
web_page.close_privacy_policy_button.click()
home = signin.create_user() home = signin.create_user()
profile = home.profile_button.click() profile = home.profile_button.click()
profile.about_button.click() profile.about_button.click()
profile.privacy_policy_button.click() profile.privacy_policy_button.click()
from views.web_views.base_web_view import BaseWebView
web_page = BaseWebView(self.driver)
if not web_page.policy_summary.is_element_displayed(): if not web_page.policy_summary.is_element_displayed():
self.errors.append('%s Profile about view!' % no_link_open_error_msg) self.errors.append('%s Profile about view!' % no_link_open_error_msg)
web_page.click_system_back_button() web_page.click_system_back_button()
@ -896,26 +884,27 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
public_chat_1 = home_1.join_public_chat(public_chat_name) public_chat_1 = home_1.join_public_chat(public_chat_name)
public_chat_1.relogin() public_chat_1.relogin()
profile_1.just_fyi('check that still connected to custom mailserver after relogin') # TODO: blocked due to 11786
home_1.profile_button.click() # profile_1.just_fyi('check that still connected to custom mailserver after relogin')
profile_1.sync_settings_button.click() # home_1.profile_button.click()
if not profile_1.element_by_text(server_name).is_element_displayed(): # profile_1.sync_settings_button.click()
self.drivers[0].fail("Not connected to custom mailserver after re-login") # if not profile_1.element_by_text(server_name).is_element_displayed():
# self.drivers[0].fail("Not connected to custom mailserver after re-login")
profile_1.just_fyi('check that can RETRY to connect') #
profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60) # profile_1.just_fyi('check that can RETRY to connect')
public_chat_1.element_by_translation_id(id='mailserver-retry', uppercase=True).wait_and_click(60) # profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60)
# public_chat_1.element_by_translation_id(id='mailserver-retry', uppercase=True).wait_and_click(60)
profile_1.just_fyi('check that can pick another mailserver and receive messages') #
profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60) # profile_1.just_fyi('check that can pick another mailserver and receive messages')
profile_1.element_by_translation_id(id='mailserver-pick-another', uppercase=True).wait_and_click(120) # profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60)
mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet) # profile_1.element_by_translation_id(id='mailserver-pick-another', uppercase=True).wait_and_click(120)
profile_1.element_by_text(mailserver).click() # mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet)
profile_1.confirm_button.click() # profile_1.element_by_text(mailserver).click()
profile_1.home_button.click() # profile_1.confirm_button.click()
home_1.get_chat('#%s' % public_chat_name).click() # profile_1.home_button.click()
if not public_chat_1.chat_element_by_text(message).is_element_displayed(60): # home_1.get_chat('#%s' % public_chat_name).click()
self.errors.append("Chat history wasn't fetched") # if not public_chat_1.chat_element_by_text(message).is_element_displayed(60):
# self.errors.append("Chat history wasn't fetched")
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -55,7 +55,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_2.just_fyi('Join to group chat, check system messages and send messages to group chat, check message status is delivered') device_2.just_fyi('Join to group chat, check system messages and send messages to group chat, check message status is delivered')
device_2_chat.join_chat_button.click() device_2_chat.join_chat_button.click()
for chat in (device_1_chat, device_2_chat): for chat in (device_1_chat, device_2_chat):
if not chat.chat_element_by_text(join_system_message).is_element_displayed(): if not chat.chat_element_by_text(join_system_message).is_element_displayed(30):
self.drivers[0].fail('System message after joining group chat is not shown') self.drivers[0].fail('System message after joining group chat is not shown')
device_2_chat.home_button.click(desired_view="home") device_2_chat.home_button.click(desired_view="home")
message_1 = "Message from device: %s" % device_1_chat.driver.number message_1 = "Message from device: %s" % device_1_chat.driver.number

View File

@ -32,7 +32,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(6290) @marks.testrail_id(6290)
@marks.high @marks.high
def test_keycard_fetching_balance_after_offline(self): def test_keycard_fetching_balance_after_offline(self):
sender = wallet_users['A'] sender = transaction_senders['F']
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.just_fyi('Restore account with funds offline') sign_in_view.just_fyi('Restore account with funds offline')

View File

@ -119,7 +119,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.recover_access(sender['passphrase']) sign_in_view.recover_access(sender['passphrase'])
home_view = sign_in_view.get_home_view() home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet() wallet_view.wait_balance_is_changed(asset='ADI', scan_tokens=True)
wallet_view.accounts_status_account.click() wallet_view.accounts_status_account.click()
amount = '0.000%s' % str(random.randint(100, 999)) + '1' amount = '0.000%s' % str(random.randint(100, 999)) + '1'
wallet_view.send_transaction(amount=amount, wallet_view.send_transaction(amount=amount,
@ -137,6 +137,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.recover_access(sender['passphrase']) sign_in_view.recover_access(sender['passphrase'])
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet() wallet_view.set_up_wallet()
[wallet_view.wait_balance_is_changed(asset) for asset in ['ETH', 'STT']]
eth_value = wallet_view.get_asset_amount_by_name('ETH') eth_value = wallet_view.get_asset_amount_by_name('ETH')
stt_value = wallet_view.get_asset_amount_by_name('STT') stt_value = wallet_view.get_asset_amount_by_name('STT')
if eth_value == 0 or stt_value == 0: if eth_value == 0 or stt_value == 0:
@ -338,6 +339,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(transaction_senders['C']['passphrase']) sign_in_view.recover_access(transaction_senders['C']['passphrase'])
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.wait_balance_is_changed()
send_transaction_view = SendTransactionView(self.driver) send_transaction_view = SendTransactionView(self.driver)
sign_in_view.just_fyi("Setting up wallet") sign_in_view.just_fyi("Setting up wallet")

View File

@ -259,11 +259,15 @@ class GroupChatInfoView(BaseView):
return UsernameOptions(self.driver, username) return UsernameOptions(self.driver, username)
def user_admin(self, username: str): def user_admin(self, username: str):
return Button(self.driver, admin = Button(self.driver,
xpath="//*[@text='%s']/..//*[@text='%s']" % (username, self.get_translation_by_key("group-chat-admin"))) xpath="//*[@text='%s']/..//*[@text='%s']" % (username, self.get_translation_by_key("group-chat-admin")))
admin.scroll_to_element()
return admin
def get_user_from_group_info(self, username: str): def get_user_from_group_info(self, username: str):
return Text(self.driver, xpath="//*[@text='%s']" % username) user = Text(self.driver, xpath="//*[@text='%s']" % username)
user.scroll_to_element()
return user
class PreviewMessage(ChatElementByText): class PreviewMessage(ChatElementByText):

View File

@ -160,13 +160,12 @@ class WalletView(BaseView):
self.wallet_button.double_click() self.wallet_button.double_click()
counter += 10 counter += 10
time.sleep(10) time.sleep(10)
if scan_tokens:
self.scan_tokens()
self.driver.info('*Waiting %ss for %s updated balance*' % (counter,asset)) self.driver.info('*Waiting %ss for %s updated balance*' % (counter,asset))
elif not self.asset_by_name(asset).is_element_present(10): elif not self.asset_by_name(asset).is_element_present(10):
if scan_tokens:
self.scan_tokens()
counter += 10 counter += 10
time.sleep(10) time.sleep(10)
self.swipe_up()
self.driver.info('*Waiting %s seconds for %s to display asset*' % (counter, asset)) self.driver.info('*Waiting %s seconds for %s to display asset*' % (counter, asset))
else: else:
self.driver.info('**Balance is updated!**') self.driver.info('**Balance is updated!**')