From c460c485a70f506012135db62083af84cb6dc356 Mon Sep 17 00:00:00 2001 From: Joseph Baylon Date: Thu, 21 Jul 2022 14:18:56 -0700 Subject: [PATCH] Detox/E2E: Channel Info and Quick Actions e2e tests in Gekidou (#6487) * Detox/E2E: Channel Info and Quick Actions e2e tests in Gekidou * Detox/E2E: Fix broken iOS e2e tests in Gekidou (#6488) --- .../channel_actions/channel_actions.tsx | 4 +- .../favorite_box/favorite_box.tsx | 4 +- .../channel_actions/mute_box/mute_box.tsx | 4 +- app/components/post_draft/archived/index.tsx | 1 + app/components/toast/index.tsx | 7 +- .../channel_post_list/intro/options/index.tsx | 8 +- app/screens/channel/header/header.tsx | 1 + .../channel/header/quick_actions/index.tsx | 1 + .../destructive_options/archive/archive.tsx | 1 + .../support/server_api/default_config.json | 7 +- detox/e2e/support/ui/component/alert.ts | 8 ++ detox/e2e/support/ui/component/post_draft.ts | 4 + detox/e2e/support/ui/screen/channel.ts | 64 +++++++-- detox/e2e/support/ui/screen/channel_info.ts | 96 ++++++++++++- .../ui/screen/create_or_edit_channel.ts | 2 +- .../test/autocomplete/channel_mention.e2e.ts | 13 +- .../e2e/test/channels/archive_channel.e2e.ts | 128 +++++++++++++++++ .../e2e/test/channels/browse_channels.e2e.ts | 67 ++++++--- detox/e2e/test/channels/channel_info.e2e.ts | 102 +++++++++++++ detox/e2e/test/channels/channel_list.e2e.ts | 7 - .../test/channels/channel_post_list.e2e.ts | 6 +- ...ate_channel_and_edit_channel_header.e2e.ts | 8 +- .../channels/create_direct_message.e2e.ts | 2 +- .../favorite_and_unfavorite_channel.e2e.ts | 136 ++++++++++++++++++ detox/e2e/test/channels/find_channels.e2e.ts | 45 +++--- detox/e2e/test/channels/leave_channel.e2e.ts | 98 +++++++++++++ .../channels/mute_and_unmute_channel.e2e.ts | 88 ++++++++++++ .../messaging/emojis_and_reactions.e2e.ts | 2 +- .../e2e/test/messaging/markdown_latex.e2e.ts | 8 -- .../e2e/test/server_login/server_list.e2e.ts | 29 ++-- detox/e2e/test/smoke_test/channels.e2e.ts | 51 ++++++- detox/e2e/test/smoke_test/server_login.e2e.ts | 21 ++- detox/e2e/test/smoke_test/threads.e2e.ts | 7 - .../threads/follow_and_unfollow_thread.e2e.ts | 7 - detox/e2e/test/threads/global_threads.e2e.ts | 13 +- .../mark_thread_as_read_and_unread.e2e.ts | 40 +++--- .../threads/open_thread_in_channel.e2e.ts | 7 - detox/e2e/test/threads/reply_to_thread.e2e.ts | 7 - .../threads/save_and_unsave_thread.e2e.ts | 7 - 39 files changed, 934 insertions(+), 177 deletions(-) create mode 100644 detox/e2e/test/channels/archive_channel.e2e.ts create mode 100644 detox/e2e/test/channels/channel_info.e2e.ts create mode 100644 detox/e2e/test/channels/favorite_and_unfavorite_channel.e2e.ts create mode 100644 detox/e2e/test/channels/leave_channel.e2e.ts create mode 100644 detox/e2e/test/channels/mute_and_unmute_channel.e2e.ts diff --git a/app/components/channel_actions/channel_actions.tsx b/app/components/channel_actions/channel_actions.tsx index 3f1d3963ad..87b471851d 100644 --- a/app/components/channel_actions/channel_actions.tsx +++ b/app/components/channel_actions/channel_actions.tsx @@ -46,13 +46,13 @@ const ChannelActions = ({channelId, channelType, inModal = false, testID}: Props {channelType && DIRECT_CHANNELS.includes(channelType) && diff --git a/app/components/channel_actions/favorite_box/favorite_box.tsx b/app/components/channel_actions/favorite_box/favorite_box.tsx index dae9aeb4bc..06950b36f0 100644 --- a/app/components/channel_actions/favorite_box/favorite_box.tsx +++ b/app/components/channel_actions/favorite_box/favorite_box.tsx @@ -27,6 +27,8 @@ const FavoriteBox = ({channelId, containerStyle, isFavorited, showSnackBar = fal toggleFavoriteChannel(serverUrl, channelId, showSnackBar); }, [serverUrl, channelId, showSnackBar]); + const favoriteActionTestId = isFavorited ? `${testID}.unfavorite.action` : `${testID}.favorite.action`; + return ( ); diff --git a/app/components/channel_actions/mute_box/mute_box.tsx b/app/components/channel_actions/mute_box/mute_box.tsx index fc7ae62402..4d96c7d5d2 100644 --- a/app/components/channel_actions/mute_box/mute_box.tsx +++ b/app/components/channel_actions/mute_box/mute_box.tsx @@ -27,6 +27,8 @@ const MutedBox = ({channelId, containerStyle, isMuted, showSnackBar = false, tes toggleMuteChannel(serverUrl, channelId, showSnackBar); }, [channelId, isMuted, serverUrl, showSnackBar]); + const muteActionTestId = isMuted ? `${testID}.unmute.action` : `${testID}.mute.action`; + return ( ); diff --git a/app/components/post_draft/archived/index.tsx b/app/components/post_draft/archived/index.tsx index a51d5bfa9d..1a47041769 100644 --- a/app/components/post_draft/archived/index.tsx +++ b/app/components/post_draft/archived/index.tsx @@ -95,6 +95,7 @@ export default function Archived({