forked from Ivasoft/mattermost-mobile
Fix messaging e2e for android
This commit is contained in:
committed by
Elisabeth Kulzer
parent
658b35b6ad
commit
2ebfa0230e
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import {SearchBar} from '@support/ui/component';
|
import {SearchBar} from '@support/ui/component';
|
||||||
import {PostOptionsScreen} from '@support/ui/screen';
|
import {PostOptionsScreen} from '@support/ui/screen';
|
||||||
import {timeouts, wait} from '@support/utils';
|
import {isIos, timeouts, wait} from '@support/utils';
|
||||||
import {expect} from 'detox';
|
import {expect} from 'detox';
|
||||||
|
|
||||||
class EmojiPickerScreen {
|
class EmojiPickerScreen {
|
||||||
@@ -42,7 +42,12 @@ class EmojiPickerScreen {
|
|||||||
};
|
};
|
||||||
|
|
||||||
close = async () => {
|
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 expect(this.emojiPickerScreen).not.toBeVisible();
|
||||||
await wait(timeouts.ONE_SEC);
|
await wait(timeouts.ONE_SEC);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import {Alert} from '@support/ui/component';
|
import {Alert} from '@support/ui/component';
|
||||||
import {timeouts, wait} from '@support/utils';
|
import {isIos, timeouts, wait} from '@support/utils';
|
||||||
import {expect} from 'detox';
|
import {expect} from 'detox';
|
||||||
|
|
||||||
class PostOptionsScreen {
|
class PostOptionsScreen {
|
||||||
@@ -50,7 +50,12 @@ class PostOptionsScreen {
|
|||||||
};
|
};
|
||||||
|
|
||||||
close = async () => {
|
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 expect(this.postOptionsScreen).not.toBeVisible();
|
||||||
await wait(timeouts.ONE_SEC);
|
await wait(timeouts.ONE_SEC);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import {ProfilePicture} from '@support/ui/component';
|
import {ProfilePicture} from '@support/ui/component';
|
||||||
import {timeouts, wait} from '@support/utils';
|
import {isIos, timeouts, wait} from '@support/utils';
|
||||||
import {expect} from 'detox';
|
import {expect} from 'detox';
|
||||||
|
|
||||||
class ReactionsScreen {
|
class ReactionsScreen {
|
||||||
@@ -22,7 +22,12 @@ class ReactionsScreen {
|
|||||||
};
|
};
|
||||||
|
|
||||||
close = async () => {
|
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 expect(this.reactionsScreen).not.toBeVisible();
|
||||||
await wait(timeouts.ONE_SEC);
|
await wait(timeouts.ONE_SEC);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import {ChannelListScreen} from '@support/ui/screen';
|
import {ChannelListScreen} from '@support/ui/screen';
|
||||||
import {timeouts, wait} from '@support/utils';
|
import {isIos, timeouts, wait} from '@support/utils';
|
||||||
import {expect} from 'detox';
|
import {expect} from 'detox';
|
||||||
|
|
||||||
class ServerListScreen {
|
class ServerListScreen {
|
||||||
@@ -66,7 +66,12 @@ class ServerListScreen {
|
|||||||
};
|
};
|
||||||
|
|
||||||
close = async () => {
|
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 expect(this.serverListScreen).not.toBeVisible();
|
||||||
await wait(timeouts.ONE_SEC);
|
await wait(timeouts.ONE_SEC);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import {timeouts, wait} from '@support/utils';
|
import {isIos, timeouts, wait} from '@support/utils';
|
||||||
import {expect} from 'detox';
|
import {expect} from 'detox';
|
||||||
|
|
||||||
class ThreadOptionsScreen {
|
class ThreadOptionsScreen {
|
||||||
@@ -36,7 +36,12 @@ class ThreadOptionsScreen {
|
|||||||
};
|
};
|
||||||
|
|
||||||
close = async () => {
|
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 expect(this.threadOptionsScreen).not.toBeVisible();
|
||||||
await wait(timeouts.ONE_SEC);
|
await wait(timeouts.ONE_SEC);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import {ProfilePicture} from '@support/ui/component';
|
import {ProfilePicture} from '@support/ui/component';
|
||||||
import {timeouts, wait} from '@support/utils';
|
import {isIos, timeouts, wait} from '@support/utils';
|
||||||
import {expect} from 'detox';
|
import {expect} from 'detox';
|
||||||
|
|
||||||
class UserProfileScreen {
|
class UserProfileScreen {
|
||||||
@@ -47,7 +47,12 @@ class UserProfileScreen {
|
|||||||
};
|
};
|
||||||
|
|
||||||
close = async () => {
|
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 expect(this.userProfileScreen).not.toBeVisible();
|
||||||
await wait(timeouts.ONE_SEC);
|
await wait(timeouts.ONE_SEC);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ describe('Messaging - Message Draft', () => {
|
|||||||
await ChannelScreen.back();
|
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
|
// # Open a channel screen, post a message, and tap on the post to open reply thread
|
||||||
const message = `Message ${getRandomId()}`;
|
const message = `Message ${getRandomId()}`;
|
||||||
await ChannelScreen.open(channelsCategory, testChannel.name);
|
await ChannelScreen.open(channelsCategory, testChannel.name);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
LoginScreen,
|
LoginScreen,
|
||||||
ServerScreen,
|
ServerScreen,
|
||||||
} from '@support/ui/screen';
|
} from '@support/ui/screen';
|
||||||
import {getRandomId} from '@support/utils';
|
import {getRandomId, isAndroid} from '@support/utils';
|
||||||
import {expect} from 'detox';
|
import {expect} from 'detox';
|
||||||
|
|
||||||
describe('Messaging - Message Post', () => {
|
describe('Messaging - Message Post', () => {
|
||||||
@@ -87,6 +87,9 @@ describe('Messaging - Message Post', () => {
|
|||||||
await ChannelScreen.postMessage('short message');
|
await ChannelScreen.postMessage('short message');
|
||||||
|
|
||||||
// * Verify long message is posted and displays show more button (chevron down button)
|
// * 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);
|
const {postListPostItem, postListPostItemShowLessButton, postListPostItemShowMoreButton} = ChannelScreen.getPostListPostItem(post.id, longMessage);
|
||||||
await expect(postListPostItem).toBeVisible();
|
await expect(postListPostItem).toBeVisible();
|
||||||
await expect(postListPostItemShowMoreButton).toBeVisible();
|
await expect(postListPostItemShowMoreButton).toBeVisible();
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ describe('Messaging - Pin and Unpin Message', () => {
|
|||||||
await PostOptionsScreen.pinPostOption.tap();
|
await PostOptionsScreen.pinPostOption.tap();
|
||||||
|
|
||||||
// * Verify pinned text is displayed on the post pre-header
|
// * Verify pinned text is displayed on the post pre-header
|
||||||
|
await wait(timeouts.ONE_SEC);
|
||||||
const {postListPostItemPreHeaderText} = ChannelScreen.getPostListPostItem(post.id, message);
|
const {postListPostItemPreHeaderText} = ChannelScreen.getPostListPostItem(post.id, message);
|
||||||
await expect(postListPostItemPreHeaderText).toHaveText(pinnedText);
|
await expect(postListPostItemPreHeaderText).toHaveText(pinnedText);
|
||||||
|
|
||||||
@@ -76,6 +77,7 @@ describe('Messaging - Pin and Unpin Message', () => {
|
|||||||
await PostOptionsScreen.unpinPostOption.tap();
|
await PostOptionsScreen.unpinPostOption.tap();
|
||||||
|
|
||||||
// * Verify pinned text is not displayed on the post pre-header
|
// * Verify pinned text is not displayed on the post pre-header
|
||||||
|
await wait(timeouts.ONE_SEC);
|
||||||
await expect(postListPostItemPreHeaderText).not.toBeVisible();
|
await expect(postListPostItemPreHeaderText).not.toBeVisible();
|
||||||
|
|
||||||
// # Go back to channel list screen
|
// # Go back to channel list screen
|
||||||
@@ -103,6 +105,7 @@ describe('Messaging - Pin and Unpin Message', () => {
|
|||||||
await PostOptionsScreen.unpinPostOption.tap();
|
await PostOptionsScreen.unpinPostOption.tap();
|
||||||
|
|
||||||
// * Verify pinned text is not displayed on the post pre-header
|
// * Verify pinned text is not displayed on the post pre-header
|
||||||
|
await wait(timeouts.ONE_SEC);
|
||||||
await expect(postListPostItemPreHeaderText).not.toBeVisible();
|
await expect(postListPostItemPreHeaderText).not.toBeVisible();
|
||||||
|
|
||||||
// # Go back to channel list screen
|
// # Go back to channel list screen
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ describe('Messaging - Save and Unsave Message', () => {
|
|||||||
await PostOptionsScreen.savePostOption.tap();
|
await PostOptionsScreen.savePostOption.tap();
|
||||||
|
|
||||||
// * Verify saved text is displayed on the post pre-header
|
// * Verify saved text is displayed on the post pre-header
|
||||||
|
await wait(timeouts.ONE_SEC);
|
||||||
const {postListPostItemPreHeaderText} = ChannelScreen.getPostListPostItem(post.id, message);
|
const {postListPostItemPreHeaderText} = ChannelScreen.getPostListPostItem(post.id, message);
|
||||||
await expect(postListPostItemPreHeaderText).toHaveText(savedText);
|
await expect(postListPostItemPreHeaderText).toHaveText(savedText);
|
||||||
|
|
||||||
@@ -76,6 +77,7 @@ describe('Messaging - Save and Unsave Message', () => {
|
|||||||
await PostOptionsScreen.unsavePostOption.tap();
|
await PostOptionsScreen.unsavePostOption.tap();
|
||||||
|
|
||||||
// * Verify saved text is not displayed on the post pre-header
|
// * Verify saved text is not displayed on the post pre-header
|
||||||
|
await wait(timeouts.ONE_SEC);
|
||||||
await expect(postListPostItemPreHeaderText).not.toBeVisible();
|
await expect(postListPostItemPreHeaderText).not.toBeVisible();
|
||||||
|
|
||||||
// # Go back to channel list screen
|
// # Go back to channel list screen
|
||||||
@@ -94,6 +96,7 @@ describe('Messaging - Save and Unsave Message', () => {
|
|||||||
await PostOptionsScreen.savePostOption.tap();
|
await PostOptionsScreen.savePostOption.tap();
|
||||||
|
|
||||||
// * Verify saved text is displayed on the post pre-header
|
// * Verify saved text is displayed on the post pre-header
|
||||||
|
await wait(timeouts.ONE_SEC);
|
||||||
const {postListPostItemPreHeaderText} = ThreadScreen.getPostListPostItem(post.id, message);
|
const {postListPostItemPreHeaderText} = ThreadScreen.getPostListPostItem(post.id, message);
|
||||||
await expect(postListPostItemPreHeaderText).toHaveText(savedText);
|
await expect(postListPostItemPreHeaderText).toHaveText(savedText);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user