Add accessibility-id for create group chat button

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-01-31 12:18:10 +02:00
parent 10739cd2e4
commit 305bc8e1cf
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
4 changed files with 16 additions and 8 deletions

View File

@ -68,7 +68,13 @@
[react/view {:style (styles/logo-container size shadow?)}
[icons/icon :icons/logo (styles/logo icon-size)]]))
(defn bottom-button [{:keys [label disabled? on-press forward? back? uppercase?]
(defn bottom-button [{:keys [accessibility-label
label
disabled?
on-press
forward?
back?
uppercase?]
:or {uppercase? true}}]
[react/touchable-highlight {:on-press on-press :disabled disabled?}
[react/view (styles/bottom-button disabled?)
@ -76,6 +82,7 @@
[icons/icon :icons/back {:color colors/blue
:container-style {:align-self :baseline}}])
[react/text {:style styles/bottom-button-label
:accessibility-label accessibility-label
:uppercase? uppercase?}
(or label (i18n/label :t/next))]
(when forward?

View File

@ -108,13 +108,13 @@
(i18n/label :t/group-chat-no-contacts)]
[buttons/secondary-button {:on-press handle-invite-friends-pressed} (i18n/label :t/invite-friends)]])
(views/defview bottom-container [{:keys [on-press disabled label]}]
(views/defview bottom-container [{:keys [on-press disabled label accessibility-label]}]
[react/view {:style main-tabs.styles/tabs-container}
[react/view {:style components.styles/flex}]
[react/view {:style styles/bottom-container}
[components.common/bottom-button
{:forward? true
:accessibility-label :next-button
:accessibility-label (or accessibility-label :next-button)
:label label
:disabled? disabled
:on-press on-press}]]])
@ -162,7 +162,8 @@
:enable-empty-sections true}]]]
[bottom-container {:on-press #(re-frame/dispatch [:group-chats.ui/create-pressed group-name])
:disabled (string/blank? group-name)
:label (i18n/label :t/create-group-chat)}]])))
:label (i18n/label :t/create-group-chat)
:accessibility-label :create-group-chat-button}]])))
;; Add participants to existing group chat
(views/defview add-participants-toggle-list []

View File

@ -203,7 +203,7 @@ class ProfileSendTransactionButton(BaseButton):
class JoinChatButton(BaseButton):
def __init__(self, driver):
super(JoinChatButton, self).__init__(driver)
self.locator = self.Locator.text_part_selector('JOIN CHAT')
self.locator = self.Locator.text_part_selector('JOIN GROUP')
class ChatElementByText(BaseText):

View File

@ -47,7 +47,7 @@ class OpenButton(BaseButton):
class CreateButton(BaseButton):
def __init__(self, driver):
super(CreateButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('create-button')
self.locator = self.Locator.accessibility_id('create-group-chat-button')
def navigate(self):
from views.chat_view import ChatView