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:
Joffrey JAFFEUX 2023-05-31 15:04:34 +02:00 committed by GitHub
parent 4dd053a69c
commit f189c20578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -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:)

View File

@ -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