FIX: target chat-message-text only on secondary action (#24255)

This is not necessary for other cases and was breaking specs. This commit also avoids using chat service when not necessary.
This commit is contained in:
Joffrey JAFFEUX
2023-11-07 00:45:13 +01:00
committed by GitHub
parent fb20f86784
commit 2797e0478e
2 changed files with 9 additions and 12 deletions

View File

@ -32,7 +32,7 @@ module PageObjects
def secondary_action(action)
if page.has_css?("html.mobile-view", wait: 0)
component.click(delay: 0.6)
component.find(".chat-message-text").click(delay: 0.6)
page.find(".chat-message-actions [data-id=\"#{action}\"]").click
else
open_more_menu
@ -61,10 +61,7 @@ module PageObjects
text = I18n.t("js.chat.deleted", count: args[:deleted]) if args[:deleted]
@component =
page.find(
"#{context} #{selector} .chat-message-text",
text: text ? /#{Regexp.escape(text)}/ : nil,
)
page.find("#{context} #{selector}", text: text ? /#{Regexp.escape(text)}/ : nil)
self
end