e2e: new checks and fixes

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-10-29 11:11:39 +02:00
parent 0469419f9a
commit ec319974bd
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
7 changed files with 30 additions and 9 deletions

View File

@ -89,6 +89,7 @@ class TestWalletManagement(SingleDeviceTestCase):
self.driver.fail('Transaction hash was not copied')
@marks.testrail_id(5346)
@marks.flaky
@marks.high
def test_collectible_from_wallet(self):
passphrase = wallet_users['F']['passphrase']

View File

@ -423,4 +423,4 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
if not group_info_view.element_by_text_part('20 members').is_element_displayed():
self.errors.append('Amount of users is not shown on Group info screen')
self.errors.verify_no_errors()
self.errors.verify_no_errors()

View File

@ -201,7 +201,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
def test_edit_delete_message_in_one_to_one_and_public_chats(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1, home_2 = device_1.create_user(), device_2.create_user()
home_1, home_2 = device_1.create_user(enable_notifications=True), device_2.create_user()
device_2.just_fyi("Create public chat on Device1, send message and edit it then")
public_key_1, username_1 = home_1.get_public_key_and_username(return_username=True)
@ -248,6 +248,17 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
if home_1.element_by_text(message_after_edit_1_1).is_element_displayed():
self.errors.append("Deleted message is shown on chat element on home screen")
device_2.just_fyi("Send one more message and check that PN will be deleted with message deletion")
message_to_delete = 'DELETE ME'
home_1.put_app_to_background()
chat_private_2.send_message(message_to_delete)
home_1.open_notification_bar()
home_1.get_pn(message_to_delete).wait_for_element(30)
chat_private_2.delete_message_in_chat(message_to_delete)
if not home_1.get_pn(message_to_delete).is_element_disappeared(30):
self.errors.append("Push notification was not removed after initial message deletion")
home_1.click_system_back_button(2)
chat_private_2.just_fyi("Check for that edited message is shown for Device 2 and delete message in public chat")
[home.home_button.double_click() for home in (home_1, home_2)]
public_chat_1, public_chat_2 = home_1.get_chat('#%s' %chat_name).click(), home_2.join_public_chat(chat_name)

View File

@ -258,7 +258,7 @@ class TestUpgradeMultipleApplication(MultipleDeviceTestCase):
home.upgrade_app()
home = device_1.sign_in()
device_1.just_fyi("**Check messages in 1-1 chat**")
device_1.just_fyi("Check messages in 1-1 chat")
command_username = 'Royal Defensive Solenodon'
messages = chat_data.chats[command_username]['messages']
home.swipe_up()

View File

@ -153,7 +153,7 @@ class BaseElement(object):
self.driver.swipe(500, size["height"]*0.25, 500, size["height"]*0.8)
else:
raise NoSuchElementException(
"Device %s: %s by %s:* `%s` is not found on the screen" % (self.driver.number, self.name, self.by, self.locator)) from None
"Device %s: %s by %s: `%s` is not found on the screen" % (self.driver.number, self.name, self.by, self.locator)) from None
def scroll_and_click(self, direction='down'):
self.scroll_to_element(direction=direction)
@ -171,6 +171,12 @@ class BaseElement(object):
except TimeoutException:
return False
def is_element_disappeared(self, sec=20):
try:
return self.wait_for_invisibility_of_element(sec)
except TimeoutException:
return False
@property
def text(self):
return self.find_element().text

View File

@ -751,8 +751,9 @@ class ChatView(BaseView):
return self
def chat_element_by_text(self, text):
self.driver.info("Looking for a message by text: %s" % text)
return ChatElementByText(self.driver, text)
chat_element = ChatElementByText(self.driver, text)
self.driver.info("Looking for a message by text: %s" % chat_element.exclude_emoji(text))
return chat_element
def verify_message_is_under_today_text(self, text, errors):
self.driver.info("Verifying that '%s' is under today" % text)

View File

@ -175,10 +175,12 @@ class SignInView(BaseView):
self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s')" % (password, str(keycard)), device=False)
if not second_user:
self.accept_tos_checkbox.click()
self.get_started_button.click()
self.get_started_button.click_until_presence_of_element(self.generate_key_button)
if not self.generate_key_button.is_element_displayed():
[button.click() for button in
[self.accept_tos_checkbox, self.get_started_button, self.generate_key_button]]
self.generate_key_button.click()
if not self.next_button.is_element_displayed():
[button.click() for button in [self.accept_tos_checkbox, self.get_started_button,self.generate_key_button]]
self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2"))
if keycard:
keycard_flow = self.keycard_storage_button.click()