A platform for community discussion. Free, open, simple.
DEV: Attempt to fix flaky chat system test (#22580)
Alan Guo Xiang Tan31073c715bd2
diff --git a/plugins/chat/spec/system/navigation_spec.rb b/plugins/chat/spec/system/navigation_spec.rbindex cc6d1921894..04b9d10c520 100644--- a/plugins/chat/spec/system/navigation_spec.rb+++ b/plugins/chat/spec/system/navigation_spec.rb@@ -286,16 +286,19 @@ RSpec.describe "Navigation", type: :system docontext "when re-opening full page chat after navigating to a channel" doit "opens full page chat on correct channel" do+ chat_channel_path = chat.channel_path(category_channel_2.slug, category_channel_2.id)+visit("/")chat_page.open_from_headerchat_drawer_page.maximizesidebar_page.open_channel(category_channel_2)find("#site-logo").click++ expect(chat_page).to have_right_header_href(chat_channel_path)+chat_page.open_from_header- expect(page).to have_current_path(- chat.channel_path(category_channel_2.slug, category_channel_2.id),- )+ expect(page).to have_current_path(chat_channel_path)expect(page).to have_content(category_channel_2.title)endenddiff --git a/plugins/chat/spec/system/page_objects/chat/chat.rb b/plugins/chat/spec/system/page_objects/chat/chat.rbindex c95069f2814..ebd2d42f146 100644--- a/plugins/chat/spec/system/page_objects/chat/chat.rb+++ b/plugins/chat/spec/system/page_objects/chat/chat.rb@@ -21,6 +21,10 @@ module PageObjectsfind(".chat-header-icon").clickend+ def has_right_header_href?(href)+ find(".chat-header-icon").has_link?(href: href)+ end+def openvisit("/chat")end