Update e2e

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Serhy 2020-03-03 14:06:55 +02:00 committed by Andrey Shovkoplyas
parent 0e4c7a23bf
commit f5488e1f61
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
5 changed files with 30 additions and 10 deletions

View File

@ -75,7 +75,8 @@
[badge/message-counter (or (:other @count) @count) true]]
(pos? (:public @count))
[react/view {:style tabs.styles/counter-public-container}
[react/view {:style tabs.styles/counter-public}]]))]
[react/view {:style tabs.styles/counter-public
:accessibility-label :public-unread-badge}]]))]
(when-not platform/desktop?
[react/view {:style tabs.styles/tab-title-container}
[react/text {:style (tabs.styles/new-tab-title active?)}

View File

@ -49,7 +49,8 @@
(letsubs [{:keys [unviewed-messages-count public?]} [:chats/chat chat-id]]
(when (pos? unviewed-messages-count)
(if public?
[react/view {:style styles/public-unread}]
[react/view {:style styles/public-unread
:accessibility-label :unviewed-messages-public}]
[badge/message-counter unviewed-messages-count]))))
(defn home-list-item [[_ home-item]]

View File

@ -104,21 +104,21 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
chat_2.chat_message_input.send_keys(message)
chat_2.send_message_button.click()
if home_1.home_button.counter.text != '1':
self.errors.append('New messages counter is not shown on Home button')
if not home_1.home_button.public_unread_messages.is_element_displayed():
self.errors.append('New messages public chat badge is not shown on Home button')
chat_element = home_1.get_chat_with_user('#' + chat_name)
if chat_element.new_messages_counter.text != '1':
self.errors.append('New messages counter is not shown on chat element')
if not chat_element.new_messages_public_chat.is_element_displayed():
self.errors.append('New messages counter is not shown in public chat')
chat_element.click()
home_1.get_back_to_home_view()
if home_1.home_button.counter.is_element_displayed():
self.errors.append('New messages counter is shown on Home button for already seen message')
if home_1.home_button.public_unread_messages.is_element_displayed():
self.errors.append('New messages public chat badge is shown on Home button')
if chat_element.new_messages_public_chat.is_element_displayed():
self.errors.append('Unread messages badge is shown in public chat while while there are no unread messages')
if chat_element.new_messages_counter.text == '1':
self.errors.append('New messages counter is shown on chat element for already seen message')
self.errors.verify_no_errors()
@marks.testrail_id(6202)

View File

@ -92,6 +92,15 @@ class TabButton(BaseButton):
return Counter(self.driver, self.locator.value)
@property
def public_unread_messages(self):
class PublicChatUnreadMessages(BaseElement):
def __init__(self, driver):
super(PublicChatUnreadMessages, self).__init__(driver)
self.locator = self.Locator.accessibility_id('unviewed-messages-public')
return PublicChatUnreadMessages(self.driver)
class HomeButton(TabButton):
def __init__(self, driver):

View File

@ -118,6 +118,15 @@ class ChatElement(BaseButton):
return UnreadMessagesCountText(self.driver, self.locator.value)
@property
def new_messages_public_chat(self):
class UnreadMessagesPublicChat(BaseElement):
def __init__(self, driver):
super(UnreadMessagesPublicChat, self).__init__(driver)
self.locator = self.Locator.accessibility_id('public-unread-badge')
return UnreadMessagesPublicChat(self.driver)
class ChatNameText(BaseText):
def __init__(self, driver):