A platform for community discussion. Free, open, simple.
DEV: Fix "Composer Proofreading" and "Thread Indicator" flakes (#39368)
Jarek Radosz38864874be75
diff --git a/plugins/chat/spec/system/page_objects/chat/components/thread_indicator.rb b/plugins/chat/spec/system/page_objects/chat/components/thread_indicator.rbindex bea1ff5ab8b..31b9bd285cb 100644--- a/plugins/chat/spec/system/page_objects/chat/components/thread_indicator.rb+++ b/plugins/chat/spec/system/page_objects/chat/components/thread_indicator.rb@@ -13,44 +13,44 @@ module PageObjectsenddef click- find(@context).find(SELECTOR).click+ find("#{@context} #{SELECTOR}").clickenddef exists?(**args)- find(@context).has_css?(SELECTOR)+ has_css?("#{@context} #{SELECTOR}")enddef does_not_exist?(**args)- find(@context).has_no_css?(SELECTOR)+ has_no_css?("#{@context} #{SELECTOR}")enddef has_reply_count?(count)- find(@context).has_css?(- "#{SELECTOR}__replies-count",+ has_css?(+ "#{@context} #{SELECTOR}__replies-count",text: I18n.t("js.chat.thread.replies", count: count),)enddef has_participant?(user)- find(@context).has_css?(- ".chat-thread-participants__avatar-group .chat-user-avatar[data-username=\"#{user.username}\"] img",+ has_css?(+ "#{@context} .chat-thread-participants__avatar-group .chat-user-avatar[data-username=\"#{user.username}\"] img",)enddef has_no_participants?- find(@context).has_no_css?(".chat-thread-participants")+ has_no_css?("#{@context} .chat-thread-participants")enddef has_excerpt?(text)- find(@context).find("#{SELECTOR}__last-reply-excerpt", text: text)+ has_css?("#{@context} #{SELECTOR}__last-reply-excerpt", text: text)enddef has_user?(user)- find(@context).find("#{SELECTOR}__last-reply-username", text: user.username)+ has_css?("#{@context} #{SELECTOR}__last-reply-username", text: user.username)enddef excerpt- find(@context).find("#{SELECTOR}__last-reply-excerpt")+ find("#{@context} #{SELECTOR}__last-reply-excerpt")endendenddiff --git a/spec/system/page_objects/components/composer.rb b/spec/system/page_objects/components/composer.rbindex 549d168a710..ecd30b738b3 100644--- a/spec/system/page_objects/components/composer.rb+++ b/spec/system/page_objects/components/composer.rb@@ -67,7 +67,7 @@ module PageObjectsenddef has_input_title?(value)- expect(find("#{@composer_id} input#reply-title").value).to eq(value)+ has_field?("reply-title", with: value)enddef fill_content(content)@@ -105,7 +105,13 @@ module PageObjectsenddef has_value?(value)- expect(composer_input.value).to eq(value)+ within(@composer_id) do+ if value.nil?+ has_no_field?(class: "d-editor-input")+ else+ has_field?(class: "d-editor-input", with: value)+ end+ endenddef has_popup_content?(content)