DEV: ensures thread list has finished loading (#21855)
This should fix this failure: ``` Failures: 1) Thread list in side panel | full page when there are no threads that the user is participating in shows a message Failure/Error: measurement = Benchmark.measure { example.run } expected to find text "You are not participating in any threads in this channel." in "Community\nEverything\nMy Posts\nMore\nMessages\nInbox\nChannels\nRandom 25\nPersonal chat\nRandom 25\nShowing all messages\nOngoing discussions" ``` The screenshot failure was clearly showing the spinner still being present.
This commit is contained in:
parent
4dd053a69c
commit
f189c20578
|
@ -225,6 +225,7 @@ module PageObjects
|
||||||
|
|
||||||
def open_thread_list
|
def open_thread_list
|
||||||
find(thread_list_button_selector).click
|
find(thread_list_button_selector).click
|
||||||
|
PageObjects::Components::Chat::ThreadList.new.has_loaded?
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_unread_thread_indicator?(count:)
|
def has_unread_thread_indicator?(count:)
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module PageObjects
|
||||||
|
module Components
|
||||||
|
module Chat
|
||||||
|
class ThreadList < PageObjects::Components::Base
|
||||||
|
SELECTOR = ".chat-thread-list"
|
||||||
|
|
||||||
|
def component
|
||||||
|
find(SELECTOR)
|
||||||
|
end
|
||||||
|
|
||||||
|
def has_loaded?
|
||||||
|
component.has_css?(".spinner", wait: 0)
|
||||||
|
component.has_no_css?(".spinner")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue