Fix channels e2e for android

This commit is contained in:
Joseph Baylon 2023-02-02 17:04:28 -08:00 committed by Elisabeth Kulzer
parent e8ad89861d
commit 658b35b6ad
7 changed files with 16 additions and 5 deletions

View file

@ -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();
};

View file

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

View file

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

View file

@ -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();

View file

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

View file

@ -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();

View file

@ -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();