Fixed username verification in public chat, added StaleElementReferenceException to rerun errors
Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
parent
3bc7378544
commit
7613e642ff
|
@ -18,8 +18,9 @@ RERUN_ERRORS = [
|
|||
"Sauce could not start your job",
|
||||
"HTTP Error 303",
|
||||
"http.client.RemoteDisconnected: Remote end closed connection without response",
|
||||
"[Errno 110] Connection timed out"
|
||||
"replacement transaction underpriced"
|
||||
"[Errno 110] Connection timed out",
|
||||
"replacement transaction underpriced",
|
||||
"StaleElementReferenceException"
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import pytest
|
||||
from tests import marks
|
||||
from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase
|
||||
from views.sign_in_view import SignInView
|
||||
|
@ -14,6 +13,9 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
|
|||
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
|
||||
username_1, username_2 = 'user_1', 'user_2'
|
||||
home_1, home_2 = device_1.create_user(username=username_1), device_2.create_user(username=username_2)
|
||||
profile_1 = home_1.profile_button.click()
|
||||
default_username_1 = profile_1.default_username_text.text
|
||||
profile_1.home_button.click()
|
||||
public_key_2 = home_2.get_public_key()
|
||||
home_2.home_button.click()
|
||||
|
||||
|
@ -28,10 +30,11 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
|
|||
chat_1.send_message_button.click()
|
||||
|
||||
chat_2.verify_message_is_under_today_text(message, self.errors)
|
||||
if chat_2.chat_element_by_text(message).username.text != username_1:
|
||||
self.errors.append("Username '%s' is not shown next to the received message" % username_1)
|
||||
full_username = '%s :: %s' % (username_1, default_username_1)
|
||||
if chat_2.chat_element_by_text(message).username.text != full_username:
|
||||
self.errors.append("Username '%s' is not shown next to the received message" % full_username)
|
||||
|
||||
if chat_1.element_by_text(username_1).is_element_displayed():
|
||||
if chat_1.element_by_text_part(username_1).is_element_displayed():
|
||||
self.errors.append("Username '%s' is shown for the sender" % username_1)
|
||||
|
||||
self.verify_no_errors()
|
||||
|
|
|
@ -101,11 +101,18 @@ class ConfirmLogoutButton(BaseButton):
|
|||
self.locator = self.Locator.text_selector('LOG OUT')
|
||||
|
||||
|
||||
class UserNameText(BaseText):
|
||||
class UserNameSetByUserText(BaseText):
|
||||
def __init__(self, driver):
|
||||
super(UserNameText, self).__init__(driver)
|
||||
super(UserNameSetByUserText, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector(
|
||||
'//android.widget.ImageView[@content-desc="chat-icon"]/../../android.widget.TextView')
|
||||
'//android.widget.ImageView[@content-desc="chat-icon"]/../../android.widget.TextView[1]')
|
||||
|
||||
|
||||
class DefaultUserNameText(BaseText):
|
||||
def __init__(self, driver):
|
||||
super(DefaultUserNameText, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector(
|
||||
'//android.widget.ImageView[@content-desc="chat-icon"]/../../android.widget.TextView[2]')
|
||||
|
||||
|
||||
class ShareMyProfileButton(BaseButton):
|
||||
|
@ -417,7 +424,8 @@ class ProfileView(BaseView):
|
|||
|
||||
self.main_currency_button = MainCurrencyButton(self.driver)
|
||||
|
||||
self.username_text = UserNameText(self.driver)
|
||||
self.username_set_by_user_text = UserNameSetByUserText(self.driver)
|
||||
self.default_username_text = DefaultUserNameText(self.driver)
|
||||
self.share_my_profile_button = ShareMyProfileButton(self.driver)
|
||||
self.edit_button = EditButton(self.driver)
|
||||
self.profile_picture = ProfilePictureElement(self.driver)
|
||||
|
|
Loading…
Reference in New Issue