Skip to content

Commit

Permalink
Update InboxE2ETest.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
hermannakos committed Jan 30, 2024
1 parent dac41a4 commit 6aa2d09
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import com.instructure.canvas.espresso.refresh
import com.instructure.dataseeding.api.ConversationsApi
import com.instructure.dataseeding.api.GroupsApi
import com.instructure.dataseeding.model.CanvasUserApiModel
import com.instructure.espresso.retry
import com.instructure.espresso.retryWithIncreasingDelay
import com.instructure.student.ui.utils.StudentTest
import com.instructure.student.ui.utils.seedData
Expand Down Expand Up @@ -140,11 +139,11 @@ class InboxE2ETest: StudentTest() {
inboxPage.clickArchive()
inboxPage.assertConversationNotDisplayed(seededConversation.subject)

sleep(2000)

Log.d(STEP_TAG, "Navigate to 'ARCHIVED' scope and assert that the conversation is displayed there.")
inboxPage.filterInbox("Archived")
inboxPage.assertConversationDisplayed(seededConversation.subject)
retryWithIncreasingDelay(times = 10, maxDelay = 3000, catchBlock = { refresh() }) {
inboxPage.assertConversationDisplayed(seededConversation.subject)
}

Log.d(STEP_TAG, "Navigate to 'UNREAD' scope and assert that the conversation is displayed there, because a conversation cannot be archived and unread at the same time.")
inboxPage.filterInbox("Unread")
Expand Down Expand Up @@ -176,8 +175,6 @@ class InboxE2ETest: StudentTest() {
inboxPage.filterInbox("Starred")
inboxPage.assertConversationDisplayed(seededConversation.subject)

sleep(2000)

Log.d(STEP_TAG, "Navigate to 'INBOX' scope and assert that the conversation is displayed there because it is not archived yet.")
inboxPage.filterInbox("Inbox")
inboxPage.assertConversationDisplayed(seededConversation.subject)
Expand Down Expand Up @@ -351,12 +348,10 @@ class InboxE2ETest: StudentTest() {
inboxPage.assertConversationStarred(seededConversation.subject)
inboxPage.clickMarkAsUnread()

sleep(1000)

Log.d(STEP_TAG, "Navigate to 'STARRED' scope. Assert that the conversation is displayed in the 'STARRED' scope.")
inboxPage.filterInbox("Starred")

retry(times = 10, delay = 3000) {
retryWithIncreasingDelay(times = 10, maxDelay = 3000, catchBlock = { refresh() }) {
inboxPage.assertConversationDisplayed(seededConversation.subject)
}

Expand Down

0 comments on commit 6aa2d09

Please sign in to comment.