diff --git a/detox/e2e/support/ui/screen/create_direct_message.ts b/detox/e2e/support/ui/screen/create_direct_message.ts index b97e60ff8..505ef76b8 100644 --- a/detox/e2e/support/ui/screen/create_direct_message.ts +++ b/detox/e2e/support/ui/screen/create_direct_message.ts @@ -78,7 +78,7 @@ class CreateDirectMessageScreen { }; closeTutorial = async () => { - await expect(this.tutorialHighlight).toExist(); + await waitFor(this.tutorialHighlight).toExist().withTimeout(timeouts.TEN_SEC); await this.tutorialSwipeLeft.tap(); await expect(this.tutorialHighlight).not.toExist(); }; diff --git a/detox/e2e/test/channels/archive_channel.e2e.ts b/detox/e2e/test/channels/archive_channel.e2e.ts index c99cfeac2..f1c8702e6 100644 --- a/detox/e2e/test/channels/archive_channel.e2e.ts +++ b/detox/e2e/test/channels/archive_channel.e2e.ts @@ -77,6 +77,7 @@ describe('Channels - Archive Channel', () => { await BrowseChannelsScreen.searchInput.replaceText(publicChannel.name); // * Verify search returns the archived public channel item + await wait(timeouts.ONE_SEC); await expect(BrowseChannelsScreen.getChannelItemDisplayName(publicChannel.name)).toHaveText(publicChannel.display_name); // # Go back to channel list screen @@ -123,6 +124,7 @@ describe('Channels - Archive Channel', () => { await BrowseChannelsScreen.searchInput.replaceText(privateChannel.name); // * Verify search returns the archived private channel item + await wait(timeouts.ONE_SEC); await expect(BrowseChannelsScreen.getChannelItemDisplayName(privateChannel.name)).toHaveText(privateChannel.display_name); // # Go back to channel list screen diff --git a/detox/e2e/test/channels/browse_channels.e2e.ts b/detox/e2e/test/channels/browse_channels.e2e.ts index 1dc3233c2..dc1ce5e7a 100644 --- a/detox/e2e/test/channels/browse_channels.e2e.ts +++ b/detox/e2e/test/channels/browse_channels.e2e.ts @@ -80,6 +80,7 @@ describe('Channels - Browse Channels', () => { await BrowseChannelsScreen.searchInput.replaceText(channel.name); // * Verify search returns the new public channel item + await wait(timeouts.ONE_SEC); await expect(BrowseChannelsScreen.getChannelItemDisplayName(channel.name)).toHaveText(channel.display_name); // # Tap on the new public channel item @@ -105,6 +106,7 @@ describe('Channels - Browse Channels', () => { await BrowseChannelsScreen.searchInput.replaceText(searchTerm); // * Verify empty search state for browse channels + await wait(timeouts.ONE_SEC); await expect(element(by.text(`No matches found for “${searchTerm}”`))).toBeVisible(); await expect(element(by.text('Check the spelling or try another search.'))).toBeVisible(); @@ -124,6 +126,7 @@ describe('Channels - Browse Channels', () => { await BrowseChannelsScreen.searchInput.replaceText(testOtherUser1.username); // * Verify empty search state for browse channels + await wait(timeouts.ONE_SEC); await expect(element(by.text(`No matches found for “${testOtherUser1.username}”`))).toBeVisible(); // # Search for the group message channel @@ -148,6 +151,7 @@ describe('Channels - Browse Channels', () => { await BrowseChannelsScreen.searchInput.replaceText(archivedChannel.name); // * Verify search returns the archived channel item + await wait(timeouts.ONE_SEC); await expect(BrowseChannelsScreen.getChannelItemDisplayName(archivedChannel.name)).toHaveText(archivedChannel.display_name); // # Go back to channel list screen @@ -162,6 +166,7 @@ describe('Channels - Browse Channels', () => { await BrowseChannelsScreen.searchInput.replaceText(joinedPublicChannel.name); // * Verify empty search state for browse channels + await wait(timeouts.ONE_SEC); await expect(element(by.text(`No matches found for “${joinedPublicChannel.name}”`))).toBeVisible(); // # Go back to channel list screen @@ -183,6 +188,7 @@ describe('Channels - Browse Channels', () => { await BrowseChannelsScreen.searchInput.replaceText(unjoinedPrivateChannel.name); // * Verify empty search state for browse channels + await wait(timeouts.ONE_SEC); await expect(element(by.text(`No matches found for “${unjoinedPrivateChannel.name}”`))).toBeVisible(); // # Go back to channel list screen diff --git a/detox/e2e/test/channels/channel_list.e2e.ts b/detox/e2e/test/channels/channel_list.e2e.ts index 63c545fe7..21dfcd84c 100644 --- a/detox/e2e/test/channels/channel_list.e2e.ts +++ b/detox/e2e/test/channels/channel_list.e2e.ts @@ -110,6 +110,7 @@ describe('Channels - Channel List', () => { await ChannelListScreen.getCategoryExpanded(channelsCategory).tap(); // * Verify category is collapsed and channels are not listed + await wait(timeouts.ONE_SEC); await expect(ChannelListScreen.getCategoryCollapsed(channelsCategory)).toBeVisible(); await expect(ChannelListScreen.getChannelItemDisplayName(channelsCategory, testChannel.name)).not.toBeVisible(); await expect(ChannelListScreen.getChannelItemDisplayName(channelsCategory, offTopicChannelName)).not.toBeVisible(); @@ -119,6 +120,7 @@ describe('Channels - Channel List', () => { await ChannelListScreen.getCategoryCollapsed(channelsCategory).tap(); // * Verify category is expanded and all channels are listed + await wait(timeouts.ONE_SEC); await expect(ChannelListScreen.getCategoryExpanded(channelsCategory)).toBeVisible(); await expect(ChannelListScreen.getChannelItemDisplayName(channelsCategory, testChannel.name)).toBeVisible(); await expect(ChannelListScreen.getChannelItemDisplayName(channelsCategory, offTopicChannelName)).toBeVisible(); diff --git a/detox/e2e/test/channels/edit_channel.e2e.ts b/detox/e2e/test/channels/edit_channel.e2e.ts index 4970a4fb6..7c6e12a30 100644 --- a/detox/e2e/test/channels/edit_channel.e2e.ts +++ b/detox/e2e/test/channels/edit_channel.e2e.ts @@ -105,10 +105,7 @@ describe('Channels - Edit Channel', () => { // # Edit channel info and save changes await CreateOrEditChannelScreen.displayNameInput.typeText(' name'); await CreateOrEditChannelScreen.purposeInput.typeText(' purpose'); - await CreateOrEditChannelScreen.headerInput.tapReturnKey(); - await CreateOrEditChannelScreen.headerInput.typeText('header1'); - await CreateOrEditChannelScreen.headerInput.tapReturnKey(); - await CreateOrEditChannelScreen.headerInput.typeText('header2'); + await CreateOrEditChannelScreen.headerInput.typeText('\nheader1\nheader2'); await CreateOrEditChannelScreen.saveButton.tap(); // * Verify on channel info screen and changes have been saved diff --git a/detox/e2e/test/channels/favorite_and_unfavorite_channel.e2e.ts b/detox/e2e/test/channels/favorite_and_unfavorite_channel.e2e.ts index ef85d1015..cf7be8e76 100644 --- a/detox/e2e/test/channels/favorite_and_unfavorite_channel.e2e.ts +++ b/detox/e2e/test/channels/favorite_and_unfavorite_channel.e2e.ts @@ -69,6 +69,7 @@ describe('Channels - Favorite and Unfavorite Channel', () => { // * Verify favorited toast message appears await wait(timeouts.ONE_SEC); await expect(ChannelScreen.toastMessage).toHaveText('This channel was favorited'); + await waitFor(ChannelScreen.toastMessage).not.toExist().withTimeout(timeouts.TEN_SEC); // # Go back to channel list screen await ChannelScreen.back(); @@ -85,6 +86,7 @@ describe('Channels - Favorite and Unfavorite Channel', () => { // * Verify unfavorited toast message appears await wait(timeouts.ONE_SEC); await expect(ChannelScreen.toastMessage).toHaveText('This channel was unfavorited'); + await waitFor(ChannelScreen.toastMessage).not.toExist().withTimeout(timeouts.TEN_SEC); // # Go back to channel list screen await ChannelScreen.back(); diff --git a/detox/e2e/test/channels/mute_and_unmute_channel.e2e.ts b/detox/e2e/test/channels/mute_and_unmute_channel.e2e.ts index be68a1162..9d1465d65 100644 --- a/detox/e2e/test/channels/mute_and_unmute_channel.e2e.ts +++ b/detox/e2e/test/channels/mute_and_unmute_channel.e2e.ts @@ -57,6 +57,7 @@ describe('Channels - Mute and Unmute Channel', () => { // * Verify muted toast message appears await wait(timeouts.ONE_SEC); await expect(ChannelScreen.toastMessage).toHaveText('This channel was muted'); + await waitFor(ChannelScreen.toastMessage).not.toExist().withTimeout(timeouts.TEN_SEC); // # Tap on channel quick actions button and tap on muted quick action to unmute the channel await ChannelScreen.channelQuickActionsButton.tap(); @@ -66,6 +67,7 @@ describe('Channels - Mute and Unmute Channel', () => { // * Verify unmuted toast message appears await wait(timeouts.ONE_SEC); await expect(ChannelScreen.toastMessage).toHaveText('This channel was unmuted'); + await waitFor(ChannelScreen.toastMessage).not.toExist().withTimeout(timeouts.TEN_SEC); // # Go back to channel list screen await ChannelScreen.back();