e2e: fixes

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2022-03-22 17:37:47 +01:00
parent cd24bc013f
commit 4b487f81f6
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
6 changed files with 39 additions and 38 deletions

View File

@ -150,7 +150,7 @@ class NetworkApi(object):
def faucet_backup(self, address):
self.log("Trying to get funds from %s" % self.faucet_backup_address)
address = "0x" + address
w3.donate_testnet_eth(address=address, amount=0.005, inscrease_default_gas_price=10)
w3.donate_testnet_eth(address=address, amount=0.01, inscrease_default_gas_price=10)
def get_donate(self, address, external_faucet=False, wait_time=300):
initial_balance = self.get_balance(address)

View File

@ -812,7 +812,6 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
@marks.testrail_id(5767)
@marks.medium
@marks.flaky
def test_can_not_connect_to_mailserver(self):
self.create_drivers(2)
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
@ -828,13 +827,16 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.mail_server_address_input.set_value(mailserver_address.replace('4', '5'))
profile_1.save_button.click()
profile_1.mail_server_by_name(server_name).click()
profile_1.mail_server_connect_button.click()
profile_1.confirm_button.click()
profile_1.mail_server_connect_button.wait_and_click()
profile_1.confirm_button.wait_and_click()
if profile_1.save_button.is_element_displayed():
profile_1.save_button.click()
sign_in_1 = home_1.get_sign_in_view()
sign_in_1.sign_in()
profile_1.just_fyi('check that popup "Error connecting" will not reappear if tap on "Cancel"')
profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(120)
profile_1.cancel_button.click()
profile_1.home_button.click()
home_2.just_fyi('send several messages to public channel')
public_chat_name = home_2.get_random_chat_name()
@ -849,27 +851,27 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
public_chat_1 = home_1.join_public_chat(public_chat_name)
public_chat_1.relogin()
profile_1.just_fyi('check that still connected to custom mailserver after relogin')
home_1.profile_button.click()
profile_1.sync_settings_button.click()
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')
# TODO: blocked due to 11786 (rechecked 23.11.21, valid)
# profile_1.just_fyi('check that still connected to custom mailserver after relogin')
# home_1.profile_button.click()
# profile_1.sync_settings_button.click()
# 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)
# public_chat_1.element_by_translation_id(id='mailserver-retry', uppercase=True).wait_and_click(60)
# profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(120)
# public_chat_1.element_by_translation_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.element_by_translation_id(id='mailserver-pick-another', uppercase=True).wait_and_click(120)
# profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(120)
# profile_1.element_by_translation_id('mailserver-pick-another', uppercase=True).wait_and_click(120)
# mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet)
# profile_1.element_by_text(mailserver).click()
# profile_1.confirm_button.click()
# profile_1.home_button.click()
# home_1.get_chat('#%s' % public_chat_name).click()
# if not public_chat_1.chat_element_by_text(message).is_element_displayed(60):
# self.errors.append("Chat history wasn't fetched")
# self.errors.append("Chat history wasn't fetched")
self.errors.verify_no_errors()

View File

@ -109,11 +109,11 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
home_1.just_fyi('go back online and check that 1-1 chat will be fetched')
home_1.toggle_airplane_mode()
chat_element = home_1.get_chat(username_2, wait_time=60)
chat_element = home_1.get_chat(username_2, wait_time=120)
chat_1 = chat_element.click()
chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element(2)
home_1.just_fyi('checking offline fetching for another message, check delivered stutus for first message')
home_1.just_fyi('checking offline fetching for another message, check delivered status for first message')
chat_2.toggle_airplane_mode()
if chat_2.chat_element_by_text(message_1).status != 'delivered':
self.errors.append(
@ -212,10 +212,10 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1_one_to_one_chat_element = home_1.get_chat(username_2)
chat_private_2.edit_message_in_chat(message_before_edit_1_1, message_after_edit_1_1)
if not home_1.element_by_text_part(message_after_edit_1_1).is_element_present():
if not home_1.element_by_text_part(message_after_edit_1_1).is_element_displayed(30):
self.errors.append('UNedited message version displayed on preview')
chat_private_1 = device_1_one_to_one_chat_element.click()
if not home_1.element_by_text_part(message_after_edit_1_1).is_element_present(30):
if not home_1.element_by_text_part(message_after_edit_1_1).is_element_present():
self.errors.append('No edited message in 1-1 chat displayed')
if not home_1.element_by_text_part("⌫ Edited").is_element_present(30):
self.errors.append('No mark in message bubble about this message was edited on receiver side')

View File

@ -302,7 +302,7 @@ def create_shared_drivers(quantity):
else:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
capabilities = {'maxDuration': 1800}
capabilities = {'maxDuration': 2700}
drivers = loop.run_until_complete(start_threads(quantity,
Driver,
drivers,

View File

@ -73,7 +73,7 @@ class BaseElement(object):
def find_element(self):
for _ in range(3):
try:
self.driver.info("Find '%s' by '%s': `%s`" % (self.name, self.by, self.exclude_emoji(self.locator)))
self.driver.info("Find `%s` by `%s`: `%s`" % (self.name, self.by, self.exclude_emoji(self.locator)))
return self.driver.find_element(self.by, self.locator)
except NoSuchElementException:
raise NoSuchElementException(
@ -93,7 +93,7 @@ class BaseElement(object):
def click_until_presence_of_element(self, desired_element, attempts=4):
counter = 0
self.driver.info("Click until '%s' by '%s': `%s` will be presented" % (
self.driver.info("Click until `%s` by `%s`: `%s` will be presented" % (
desired_element.name, desired_element.by, desired_element.locator))
while not desired_element.is_element_present(1) and counter <= attempts:
try:
@ -115,7 +115,7 @@ class BaseElement(object):
.until(expected_conditions.presence_of_element_located((self.by, self.locator)))
except TimeoutException:
raise TimeoutException(
"Device %s: %s by %s: `%s` is not found on the screen" % (
"Device `%s`: `%s` by` %s`: `%s` is not found on the screen" % (
self.driver.number, self.name, self.by, self.locator)) from None
def wait_for_elements(self, seconds=10):
@ -146,11 +146,11 @@ class BaseElement(object):
def wait_for_element_text(self, text, wait_time=30):
counter = 0
self.driver.info("Wait for text element '%s' to be equal to '%s'" % (self.name, text))
self.driver.info("Wait for text element `%s` to be equal to `%s`" % (self.name, text))
while True:
if counter >= wait_time:
self.driver.fail(
"'%s' is not equal to expected '%s' in %s sec" % (self.find_element().text, text, wait_time))
"`%s` is not equal to expected `%s` in %s sec" % (self.find_element().text, text, wait_time))
elif self.find_element().text != text:
counter += 10
time.sleep(10)
@ -273,7 +273,7 @@ class BaseElement(object):
def long_press_element(self):
element = self.find_element()
self.driver.info("Long press on '%s'" % self.name)
self.driver.info("Long press on `%s`" % self.name)
action = TouchAction(self.driver)
action.long_press(element).release().perform()
@ -313,25 +313,25 @@ class EditBox(BaseElement):
def send_keys(self, value):
self.find_element().send_keys(value)
self.driver.info("Type '%s' to '%s'" % (self.exclude_emoji(value), self.name))
self.driver.info("Type `%s` to `%s`" % (self.exclude_emoji(value), self.name))
def set_value(self, value):
self.find_element().set_value(value)
self.driver.info("Set '%s' value for '%s'" % (self.exclude_emoji(value), self.name))
self.driver.info("Set `%s` value for `%s`" % (self.exclude_emoji(value), self.name))
def clear(self):
self.find_element().clear()
self.driver.info("Clear text in '%s'" % self.name)
self.driver.info("Clear text in `%s`" % self.name)
def delete_last_symbols(self, number_of_symbols_to_delete: int):
self.driver.info("Delete last %s symbols from '%s'" % (number_of_symbols_to_delete, self.name))
self.driver.info("Delete last `%s` symbols from `%s`" % (number_of_symbols_to_delete, self.name))
self.click()
for _ in range(number_of_symbols_to_delete):
time.sleep(1)
self.driver.press_keycode(67)
def paste_text_from_clipboard(self):
self.driver.info("Paste text from clipboard into '%s'" % self.name)
self.driver.info("Paste text from clipboard into `%s`" % self.name)
self.long_press_element()
time.sleep(2)
action = TouchAction(self.driver)
@ -366,14 +366,13 @@ class Button(BaseElement):
super(Button, self).__init__(driver, **kwargs)
def wait_and_click(self, sec=30):
self.driver.info("Wait for element '%s' for max %ss and click when it is available" % (self.name, sec))
self.driver.info("Wait for element `%s` for max %ss and click when it is available" % (self.name, sec))
self.wait_for_visibility_of_element(sec)
self.click()
def click_until_absense_of_element(self, desired_element, attempts=3):
counter = 0
self.driver.info("Click until '%s' by '%s': `%s` is NOT presented" % (
self.driver.info("Click until `%s` by `%s`: `%s` is NOT presented" % (
desired_element.name, desired_element.by, desired_element.locator))
while desired_element.is_element_present(1) and counter <= attempts:
try:
@ -390,7 +389,7 @@ class SilentButton(Button):
return self.driver.find_element(self.by, self.locator)
except NoSuchElementException:
raise NoSuchElementException(
"Device %s: '%s' by %s:'%s' not found on the screen" % (
"Device %s: `%s` by `%s`:`%s` not found on the screen" % (
self.driver.number, self.name, self.by, self.locator)) from None
except Exception as exception:
if 'Internal Server Error' in str(exception):

View File

@ -62,7 +62,7 @@ class DappsView(BaseView):
web_view.open_new_tab_plus_button.click_if_shown()
self.enter_url_editbox.wait_for_visibility_of_element(20)
self.enter_url_editbox.click()
self.enter_url_editbox.send_keys(url)
self.enter_url_editbox.set_value(url)
self.confirm()
from views.web_views.base_web_view import BaseWebView
BaseWebView(self.driver).wait_for_d_aap_to_load()