Fix messaging e2e for android

This commit is contained in:
Joseph Baylon
2023-02-02 20:08:15 -08:00
committed by Elisabeth Kulzer
parent 658b35b6ad
commit 2ebfa0230e
10 changed files with 53 additions and 14 deletions

View File

@@ -3,7 +3,7 @@
import {SearchBar} from '@support/ui/component';
import {PostOptionsScreen} from '@support/ui/screen';
import {timeouts, wait} from '@support/utils';
import {isIos, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
class EmojiPickerScreen {
@@ -42,7 +42,12 @@ class EmojiPickerScreen {
};
close = async () => {
await this.emojiPickerScreen.swipe('down');
if (isIos()) {
await this.emojiPickerScreen.swipe('down');
} else {
await device.pressBack();
}
await wait(timeouts.ONE_SEC);
await expect(this.emojiPickerScreen).not.toBeVisible();
await wait(timeouts.ONE_SEC);
};

View File

@@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import {Alert} from '@support/ui/component';
import {timeouts, wait} from '@support/utils';
import {isIos, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
class PostOptionsScreen {
@@ -50,7 +50,12 @@ class PostOptionsScreen {
};
close = async () => {
await this.postOptionsScreen.swipe('down');
if (isIos()) {
await this.postOptionsScreen.swipe('down');
} else {
await device.pressBack();
}
await wait(timeouts.ONE_SEC);
await expect(this.postOptionsScreen).not.toBeVisible();
await wait(timeouts.ONE_SEC);
};

View File

@@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import {ProfilePicture} from '@support/ui/component';
import {timeouts, wait} from '@support/utils';
import {isIos, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
class ReactionsScreen {
@@ -22,7 +22,12 @@ class ReactionsScreen {
};
close = async () => {
await this.reactionsScreen.swipe('down');
if (isIos()) {
await this.reactionsScreen.swipe('down');
} else {
await device.pressBack();
}
await wait(timeouts.ONE_SEC);
await expect(this.reactionsScreen).not.toBeVisible();
await wait(timeouts.ONE_SEC);
};

View File

@@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import {ChannelListScreen} from '@support/ui/screen';
import {timeouts, wait} from '@support/utils';
import {isIos, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
class ServerListScreen {
@@ -66,7 +66,12 @@ class ServerListScreen {
};
close = async () => {
await this.serverListScreen.swipe('down');
if (isIos()) {
await this.serverListScreen.swipe('down');
} else {
await device.pressBack();
}
await wait(timeouts.ONE_SEC);
await expect(this.serverListScreen).not.toBeVisible();
await wait(timeouts.ONE_SEC);
};

View File

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {timeouts, wait} from '@support/utils';
import {isIos, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
class ThreadOptionsScreen {
@@ -36,7 +36,12 @@ class ThreadOptionsScreen {
};
close = async () => {
await this.threadOptionsScreen.swipe('down');
if (isIos()) {
await this.threadOptionsScreen.swipe('down');
} else {
await device.pressBack();
}
await wait(timeouts.ONE_SEC);
await expect(this.threadOptionsScreen).not.toBeVisible();
await wait(timeouts.ONE_SEC);
};

View File

@@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import {ProfilePicture} from '@support/ui/component';
import {timeouts, wait} from '@support/utils';
import {isIos, timeouts, wait} from '@support/utils';
import {expect} from 'detox';
class UserProfileScreen {
@@ -47,7 +47,12 @@ class UserProfileScreen {
};
close = async () => {
await this.userProfileScreen.swipe('down');
if (isIos()) {
await this.userProfileScreen.swipe('down');
} else {
await device.pressBack();
}
await wait(timeouts.ONE_SEC);
await expect(this.userProfileScreen).not.toBeVisible();
await wait(timeouts.ONE_SEC);
};

View File

@@ -144,7 +144,7 @@ describe('Messaging - Message Draft', () => {
await ChannelScreen.back();
});
it('MM-T4781_4 - should be able to create a message draft from reply thread', async () => {
it('MM-T4781_4 - should be able to create a message draft from reply thread -- KNOWN ISSUE: MM-50298', async () => {
// # Open a channel screen, post a message, and tap on the post to open reply thread
const message = `Message ${getRandomId()}`;
await ChannelScreen.open(channelsCategory, testChannel.name);

View File

@@ -22,7 +22,7 @@ import {
LoginScreen,
ServerScreen,
} from '@support/ui/screen';
import {getRandomId} from '@support/utils';
import {getRandomId, isAndroid} from '@support/utils';
import {expect} from 'detox';
describe('Messaging - Message Post', () => {
@@ -87,6 +87,9 @@ describe('Messaging - Message Post', () => {
await ChannelScreen.postMessage('short message');
// * Verify long message is posted and displays show more button (chevron down button)
if (isAndroid()) {
await device.pressBack();
}
const {postListPostItem, postListPostItemShowLessButton, postListPostItemShowMoreButton} = ChannelScreen.getPostListPostItem(post.id, longMessage);
await expect(postListPostItem).toBeVisible();
await expect(postListPostItemShowMoreButton).toBeVisible();

View File

@@ -68,6 +68,7 @@ describe('Messaging - Pin and Unpin Message', () => {
await PostOptionsScreen.pinPostOption.tap();
// * Verify pinned text is displayed on the post pre-header
await wait(timeouts.ONE_SEC);
const {postListPostItemPreHeaderText} = ChannelScreen.getPostListPostItem(post.id, message);
await expect(postListPostItemPreHeaderText).toHaveText(pinnedText);
@@ -76,6 +77,7 @@ describe('Messaging - Pin and Unpin Message', () => {
await PostOptionsScreen.unpinPostOption.tap();
// * Verify pinned text is not displayed on the post pre-header
await wait(timeouts.ONE_SEC);
await expect(postListPostItemPreHeaderText).not.toBeVisible();
// # Go back to channel list screen
@@ -103,6 +105,7 @@ describe('Messaging - Pin and Unpin Message', () => {
await PostOptionsScreen.unpinPostOption.tap();
// * Verify pinned text is not displayed on the post pre-header
await wait(timeouts.ONE_SEC);
await expect(postListPostItemPreHeaderText).not.toBeVisible();
// # Go back to channel list screen

View File

@@ -68,6 +68,7 @@ describe('Messaging - Save and Unsave Message', () => {
await PostOptionsScreen.savePostOption.tap();
// * Verify saved text is displayed on the post pre-header
await wait(timeouts.ONE_SEC);
const {postListPostItemPreHeaderText} = ChannelScreen.getPostListPostItem(post.id, message);
await expect(postListPostItemPreHeaderText).toHaveText(savedText);
@@ -76,6 +77,7 @@ describe('Messaging - Save and Unsave Message', () => {
await PostOptionsScreen.unsavePostOption.tap();
// * Verify saved text is not displayed on the post pre-header
await wait(timeouts.ONE_SEC);
await expect(postListPostItemPreHeaderText).not.toBeVisible();
// # Go back to channel list screen
@@ -94,6 +96,7 @@ describe('Messaging - Save and Unsave Message', () => {
await PostOptionsScreen.savePostOption.tap();
// * Verify saved text is displayed on the post pre-header
await wait(timeouts.ONE_SEC);
const {postListPostItemPreHeaderText} = ThreadScreen.getPostListPostItem(post.id, message);
await expect(postListPostItemPreHeaderText).toHaveText(savedText);