discourse/plugins/chat/spec/system
Alan Guo Xiang Tan 14517785b2
DEV: Fix flaky system test when expanding chat message actions on mobile (#22428)
Why this change?

Chat system tests that opens the message actions on mobile have been
flaky on our CI. Those system test usually fails when the message
actions do not show up as expected causing subsequent actions to fail.

In the case of the `Reply to message - channel - mobile when the message has an existing thread replies to the existing thread`
system test, failure screenshot shows that we ended up navigating to the
thread instead of opening the message actions button. To understand why
this happens, we first need to understand that by default Capybara clicks
on the centre of an element. Also, we need to note that the HTML structure of
a chat message is like so:

```
<div class="chat-message-container">
  <div class="chat-message">
    <div class="chat-message-avatar" />
    <div class="chat-message-content" />
    <div class="chat-message-thread-indicator" />
  </div>
</div>
```

Since `PageObjects::Pages::ChatChannel#expand_message_actions_mobile`
attempts to click on the `.chat-message-contaier`, there is a
possibility that the center of that element is the
`.chat-message-thread-indicator` element which would explain why we
navigated to the thread list instead of opening up the message actions.
This is possible because the content of the original chat message as
well as the message excerpt in the thread is randomly generated where the
length of the message and how the text wraps on mobile can affect the
height of the `.chat-message-content` element as thus its position in
the `.chat-message-container` element. In most cases, the middle of the
`.chat-message-container` happens to be the `.chat-message-content`
which is why this test "flakes" sometimes.

What is the solution?

Instead of clicking on the `.chat-message-container`, we be more
specific and click on the `.chat-message-content` element instead.
2023-07-05 10:39:04 +08:00
..
chat/composer DEV: Use same excerpt everywhere in chat (#22319) 2023-06-29 09:20:20 +10:00
chat_message FIX: various mobile chat improvements (#22132) 2023-06-16 11:36:43 +02:00
list_channels FIX: scroll top after chat activation (#21952) 2023-06-09 17:51:35 +02:00
page_objects DEV: Fix flaky system test when expanding chat message actions on mobile (#22428) 2023-07-05 10:39:04 +08:00
reply_to_message DEV: more reliable thread level spec (#22173) 2023-06-17 14:28:22 +02:00
select_message FIX: allows selection of messages in threads (#22119) 2023-06-15 11:27:31 +02:00
shortcuts DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
thread_list FEATURE: Allow users to manually track threads without replying (#22100) 2023-06-16 12:08:26 +10:00
thread_tracking FEATURE: Sort thread list by unread threads first (#22272) 2023-06-28 13:14:01 +10:00
user_menu_notifications DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
user_status FEATURE: Use rich user status tooltip everywhere (#21125) 2023-07-03 11:09:41 -03:00
anonymous_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
archive_channel_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
bookmark_message_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
browse_page_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
channel_about_page_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
channel_info_pages_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
channel_members_page_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
channel_message_upload_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
channel_selector_modal_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
channel_settings_page_spec.rb FEATURE: allows to enable/disable threading in UI (#22307) 2023-06-29 07:19:12 +02:00
channel_thread_message_echoing_spec.rb FEATURE: Allow users to manually track threads without replying (#22100) 2023-06-16 12:08:26 +10:00
chat_channel_spec.rb FEATURE: Use rich user status tooltip everywhere (#21125) 2023-07-03 11:09:41 -03:00
chat_composer_draft_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
chat_composer_spec.rb DEV: Ensure browser network conditions is reset in system tests (#22404) 2023-07-04 13:22:58 +08:00
chat_message_onebox_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
chat_summarization_spec.rb DEV: Cache summarization strategy results. (#22230) 2023-06-27 11:44:34 -03:00
closed_channel_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
create_channel_spec.rb FEATURE: allows to enable/disable threading in UI (#22307) 2023-06-29 07:19:12 +02:00
dates_separators_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
deleted_channel_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
deleted_message_spec.rb REFACTOR: <ChatMessage> component (#22172) 2023-06-19 09:50:54 +02:00
document_title_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
draft_message_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
drawer_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
edited_message_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
flag_message_spec.rb FIX: direct message channels can be flagged (#22134) 2023-06-16 11:04:59 +10:00
hashtag_autocomplete_spec.rb FIX: Add aria-label attribute to cooked hashtags (#22182) 2023-06-20 15:47:17 +10:00
jit_messages_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
kick_user_from_channel_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
mention_warnings_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
message_errors_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
message_notifications_mobile_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
message_notifications_with_sidebar_spec.rb UX: Chat unread indicator refactor (#22040) 2023-06-12 14:33:45 +10:00
message_thread_indicator_spec.rb DEV: Refactor DM channel creation into new service pattern (#22144) 2023-07-03 10:18:37 +10:00
message_user_info.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
move_message_to_channel_spec.rb REFACTOR: <ChatMessage> component (#22172) 2023-06-19 09:50:54 +02:00
navigation_spec.rb DEV: Try fix flaky chat navigation spec (#22356) 2023-06-30 09:08:29 +08:00
react_to_message_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
read_only_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
reviewables_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
sidebar_navigation_menu_spec.rb FEATURE: Use rich user status tooltip everywhere (#21125) 2023-07-03 11:09:41 -03:00
sidebars_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
silenced_user_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
single_thread_spec.rb FEATURE: Allow users to manually track threads without replying (#22100) 2023-06-16 12:08:26 +10:00
transcript_spec.rb DEV: Fix or remove flaky chat specs (#22406) 2023-07-04 16:23:04 +10:00
unfollow_dm_channel_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
update_last_read.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
uploads_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
user_card_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
user_chat_preferences_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
user_presence.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00
visit_channel_spec.rb DEV: Remove superfluous `js: true` metadata (#21960) 2023-06-07 09:26:58 +08:00