forked from Ivasoft/mattermost-mobile
Detox/E2E: Upgrade deps to fix detox crash; Fix/Stabilize e2e (#6387)
This commit is contained in:
@@ -37,6 +37,7 @@ const TutorialHighlight = ({children, itemBounds, itemBorderRadius, onDismiss, o
|
||||
onDismiss={onDismiss}
|
||||
onRequestClose={onDismiss}
|
||||
supportedOrientations={[supportedOrientations]}
|
||||
testID='tutorial_highlight'
|
||||
>
|
||||
<View
|
||||
style={StyleSheet.absoluteFill}
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
export const serverOneUrl = process.env.SITE_1_URL || (process.env.IOS ? 'http://127.0.0.1:8065' : 'http://10.0.2.2:8065');
|
||||
export const siteOneUrl = process.env.SITE_1_URL || 'http://127.0.0.1:8065';
|
||||
export const serverTwoUrl = process.env.SITE_2_URL || 'https://bitrise02.test.mattermost.cloud';
|
||||
export const siteTwoUrl = process.env.SITE_2_URL || 'https://bitrise02.test.mattermost.cloud';
|
||||
export const serverThreeUrl = process.env.SITE_3_URL || 'https://bitrise03.test.mattermost.cloud';
|
||||
export const siteThreeUrl = process.env.SITE_3_URL || 'https://bitrise03.test.mattermost.cloud';
|
||||
export const serverTwoUrl = process.env.SITE_2_URL || 'https://mobile02.test.mattermost.cloud';
|
||||
export const siteTwoUrl = process.env.SITE_2_URL || 'https://mobile02.test.mattermost.cloud';
|
||||
export const serverThreeUrl = process.env.SITE_3_URL || 'https://mobile03.test.mattermost.cloud';
|
||||
export const siteThreeUrl = process.env.SITE_3_URL || 'https://mobile03.test.mattermost.cloud';
|
||||
export const smtpUrl = process.env.SMTP_URL || 'http://127.0.0.1:9001';
|
||||
export const adminEmail = process.env.ADMIN_EMAIL || 'sysadmin@sample.mattermost.com';
|
||||
export const adminUsername = process.env.ADMIN_USERNAME || 'sysadmin';
|
||||
|
||||
@@ -47,14 +47,6 @@ class ChannelListScreen {
|
||||
return element(by.id(`category_header.${categoryKey}.display_name`));
|
||||
};
|
||||
|
||||
getChannelListItemCollapsed = (categoryKey: string, channelName: string) => {
|
||||
return element(by.id(`category.${categoryKey}.channel_list_item.${channelName}.collapsed.true`));
|
||||
};
|
||||
|
||||
getChannelListItemExpanded = (categoryKey: string, channelName: string) => {
|
||||
return element(by.id(`category.${categoryKey}.channel_list_item.${channelName}.collapsed.false`));
|
||||
};
|
||||
|
||||
getChannelListItemDisplayName = (categoryKey: string, channelName: string) => {
|
||||
return element(by.id(`category.${categoryKey}.channel_list_item.${channelName}.display_name`));
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@ class CreateDirectMessageScreen {
|
||||
searchCancelButton: 'create_direct_message.search_bar.search.cancel.button',
|
||||
flatUserList: 'create_direct_message.user_list.flat_list',
|
||||
sectionUserList: 'create_direct_message.user_list.section_list',
|
||||
tutorialHighlight: 'tutorial_highlight',
|
||||
};
|
||||
|
||||
createDirectMessageScreen = element(by.id(this.testID.createDirectMessageScreen));
|
||||
@@ -25,6 +26,7 @@ class CreateDirectMessageScreen {
|
||||
searchCancelButton = element(by.id(this.testID.searchCancelButton));
|
||||
flatUserList = element(by.id(this.testID.flatUserList));
|
||||
sectionUserList = element(by.id(this.testID.sectionUserList));
|
||||
tutorialHighlight = element(by.id(this.testID.tutorialHighlight));
|
||||
|
||||
getSelectedUser = (userId: string) => {
|
||||
return element(by.id(`create_direct_message.selected_user.${userId}`));
|
||||
@@ -68,6 +70,12 @@ class CreateDirectMessageScreen {
|
||||
await this.closeButton.tap();
|
||||
await expect(this.createDirectMessageScreen).not.toBeVisible();
|
||||
};
|
||||
|
||||
closeTutorial = async () => {
|
||||
await expect(this.tutorialHighlight).toExist();
|
||||
await this.closeButton.tap();
|
||||
await expect(this.tutorialHighlight).not.toExist();
|
||||
};
|
||||
}
|
||||
|
||||
const createDirectMessageScreen = new CreateDirectMessageScreen();
|
||||
|
||||
@@ -12,7 +12,7 @@ class ThreadOptionsScreen {
|
||||
followThreadOption: 'post_options.follow_thread.option',
|
||||
followingThreadOption: 'post_options.following_thread.option',
|
||||
openInChannelOption: 'thread_options.open_in_channel.option',
|
||||
markAsReadOption: 'thread_options.mark_as_unread.option',
|
||||
markAsReadOption: 'thread_options.mark_as_read.option',
|
||||
markAsUnreadOption: 'thread_options.mark_as_unread.option',
|
||||
saveThreadOption: 'post_options.save_post.option',
|
||||
unsaveThreadOption: 'post_options.unsave_post.option',
|
||||
@@ -25,7 +25,7 @@ class ThreadOptionsScreen {
|
||||
followThreadOption = element(by.id(this.testID.followThreadOption));
|
||||
followingThreadOption = element(by.id(this.testID.followingThreadOption));
|
||||
openInChannelOption = element(by.id(this.testID.openInChannelOption));
|
||||
markAsReadOption = element(by.id(this.testID.markAsUnreadOption));
|
||||
markAsReadOption = element(by.id(this.testID.markAsReadOption));
|
||||
markAsUnreadOption = element(by.id(this.testID.markAsUnreadOption));
|
||||
saveThreadOption = element(by.id(this.testID.saveThreadOption));
|
||||
unsaveThreadOption = element(by.id(this.testID.unsaveThreadOption));
|
||||
|
||||
@@ -115,20 +115,20 @@ describe('Channels - Channel List', () => {
|
||||
// # Toggle channels category to collapse
|
||||
await ChannelListScreen.getCategoryExpanded(channelsCategory).tap();
|
||||
|
||||
// * Verify category is collapsed and only currently active channel is listed
|
||||
// * Verify category is collapsed and channels are not listed
|
||||
await expect(ChannelListScreen.getCategoryCollapsed(channelsCategory)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemExpanded(channelsCategory, testChannel.name)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemCollapsed(channelsCategory, offTopicChannelName)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemCollapsed(channelsCategory, townSquareChannelName)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemDisplayName(channelsCategory, testChannel.name)).not.toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemDisplayName(channelsCategory, offTopicChannelName)).not.toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemDisplayName(channelsCategory, townSquareChannelName)).not.toBeVisible();
|
||||
|
||||
// # Toggle channels category to expand
|
||||
await ChannelListScreen.getCategoryCollapsed(channelsCategory).tap();
|
||||
|
||||
// * Verify category is expanded and all channels are listed
|
||||
await expect(ChannelListScreen.getCategoryExpanded(channelsCategory)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemExpanded(channelsCategory, testChannel.name)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemExpanded(channelsCategory, offTopicChannelName)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemExpanded(channelsCategory, townSquareChannelName)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemDisplayName(channelsCategory, testChannel.name)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemDisplayName(channelsCategory, offTopicChannelName)).toBeVisible();
|
||||
await expect(ChannelListScreen.getChannelListItemDisplayName(channelsCategory, townSquareChannelName)).toBeVisible();
|
||||
});
|
||||
|
||||
it('MM-T4728_4 - should be able to go to browse channels screen', async () => {
|
||||
@@ -152,6 +152,7 @@ describe('Channels - Channel List', () => {
|
||||
await CreateDirectMessageScreen.toBeVisible();
|
||||
|
||||
// # Go back to channel list screen
|
||||
await CreateDirectMessageScreen.closeTutorial();
|
||||
await CreateDirectMessageScreen.close();
|
||||
});
|
||||
|
||||
@@ -191,7 +192,7 @@ describe('Channels - Channel List', () => {
|
||||
// * Verify on first team and team sidebar item is selected and has correct display name abbreviation
|
||||
await expect(ChannelListScreen.headerTeamDisplayName).toHaveText(testTeam.display_name);
|
||||
await expect(ChannelListScreen.getTeamItemSelected(testTeam.id)).toBeVisible();
|
||||
await expect(ChannelListScreen.getTeamItemDisplayNameAbbreviation(testTeam.id)).toHaveText(testTeam.display_name.substring(0, 2).toUpperCase());
|
||||
await expect(ChannelListScreen.getTeamItemDisplayNameAbbreviation(testTeam.id)).toHaveText(testTeam.display_name.substring(0, 2));
|
||||
|
||||
// # Tap on second team item from team sidebar
|
||||
await ChannelListScreen.getTeamItemNotSelected(testTeamTwo.id).tap();
|
||||
@@ -199,7 +200,7 @@ describe('Channels - Channel List', () => {
|
||||
// * Verify on second team and team sidebar item is selected and has correct display name abbreviation
|
||||
await expect(ChannelListScreen.headerTeamDisplayName).toHaveText(testTeamTwo.display_name);
|
||||
await expect(ChannelListScreen.getTeamItemSelected(testTeamTwo.id)).toBeVisible();
|
||||
await expect(ChannelListScreen.getTeamItemDisplayNameAbbreviation(testTeamTwo.id)).toHaveText(testTeamTwo.display_name.substring(0, 2).toUpperCase());
|
||||
await expect(ChannelListScreen.getTeamItemDisplayNameAbbreviation(testTeamTwo.id)).toHaveText(testTeamTwo.display_name.substring(0, 2));
|
||||
|
||||
// # Tap back on first team item from team sidebar
|
||||
await ChannelListScreen.getTeamItemNotSelected(testTeam.id).tap();
|
||||
|
||||
@@ -56,6 +56,7 @@ describe('Channels - Create Direct Message', () => {
|
||||
it('MM-T4730_1 - should match elements on create direct message screen', async () => {
|
||||
// # Open create direct message screen
|
||||
await CreateDirectMessageScreen.open();
|
||||
await CreateDirectMessageScreen.closeTutorial();
|
||||
|
||||
// * Verify basic elements on create direct message screen
|
||||
await expect(CreateDirectMessageScreen.closeButton).toBeVisible();
|
||||
@@ -99,6 +100,7 @@ describe('Channels - Create Direct Message', () => {
|
||||
|
||||
// # Go back to channel list screen
|
||||
await ChannelScreen.back();
|
||||
await device.reloadReactNative();
|
||||
await ChannelListScreen.toBeVisible();
|
||||
|
||||
// * Verify direct message channel for the new user is added to direct message list
|
||||
@@ -144,6 +146,7 @@ describe('Channels - Create Direct Message', () => {
|
||||
|
||||
// # Go back to channel list screen
|
||||
await ChannelScreen.back();
|
||||
await device.reloadReactNative();
|
||||
await ChannelListScreen.toBeVisible();
|
||||
|
||||
// * Verify group message channel for the other two new users is added to direct message list
|
||||
|
||||
@@ -100,6 +100,7 @@ describe('Smoke Test - Channels', () => {
|
||||
await Team.apiAddUserToTeam(siteOneUrl, newUser.id, testTeam.id);
|
||||
await ChannelScreen.back();
|
||||
await CreateDirectMessageScreen.open();
|
||||
await CreateDirectMessageScreen.closeTutorial();
|
||||
await CreateDirectMessageScreen.searchInput.replaceText(newUserDisplayName);
|
||||
await CreateDirectMessageScreen.getUserItem(newUser.id).tap();
|
||||
await CreateDirectMessageScreen.startButton.tap();
|
||||
|
||||
@@ -152,10 +152,11 @@ describe('Smoke Test - Threads', () => {
|
||||
|
||||
// * Verify on channel screen and thread is displayed
|
||||
await ChannelScreen.toBeVisible();
|
||||
const {postListPostItem} = ThreadScreen.getPostListPostItem(parentPost.id, parentMessage);
|
||||
const {postListPostItem} = ChannelScreen.getPostListPostItem(parentPost.id, parentMessage);
|
||||
await expect(postListPostItem).toBeVisible();
|
||||
|
||||
// # Go back to channel list screen
|
||||
await ChannelScreen.back();
|
||||
await GlobalThreadsScreen.back();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -116,7 +116,6 @@ describe('Threads - Follow and Unfollow Thread', () => {
|
||||
await expect(postListPostItemFooterFollowingButton).toBeVisible();
|
||||
|
||||
// # Go back to channel list screen
|
||||
await ThreadScreen.back();
|
||||
await ChannelScreen.back();
|
||||
});
|
||||
|
||||
@@ -147,8 +146,7 @@ describe('Threads - Follow and Unfollow Thread', () => {
|
||||
// * Verify thread is not followed by user via post options
|
||||
await expect(PostOptionsScreen.followThreadOption).toBeVisible();
|
||||
|
||||
// # Open post options for thread and follow thread via post options
|
||||
await ChannelScreen.openPostOptionsFor(parentPost.id, parentMessage);
|
||||
// # Tap on follow thread option
|
||||
await PostOptionsScreen.followThreadOption.tap();
|
||||
|
||||
// * Verify thread is followed by user via post footer
|
||||
@@ -188,14 +186,13 @@ describe('Threads - Follow and Unfollow Thread', () => {
|
||||
// * Verify thread is followed by user via thread options
|
||||
await expect(ThreadOptionsScreen.followingThreadOption).toBeVisible();
|
||||
|
||||
// # Unfollow thread via thread options
|
||||
// # Tap on unfollow thread option
|
||||
await ThreadOptionsScreen.followingThreadOption.tap();
|
||||
|
||||
// * Verify thread is not displayed anymore in all your threads section
|
||||
await expect(GlobalThreadsScreen.getThreadItem(parentPost.id)).toBeVisible();
|
||||
await expect(GlobalThreadsScreen.getThreadItem(parentPost.id)).not.toBeVisible();
|
||||
|
||||
// # Go back to channel list screen
|
||||
await GlobalThreadsScreen.back();
|
||||
await ChannelScreen.back();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ describe('Threads - Global Threads', () => {
|
||||
|
||||
it('MM-T4805_1 - should match elements on global threads screen', async () => {
|
||||
// # Open global threads screen
|
||||
await ChannelListScreen.open();
|
||||
await GlobalThreadsScreen.open();
|
||||
|
||||
// * Verify basic elements on global threads screen
|
||||
await expect(GlobalThreadsScreen.headerAllThreadsButton).toBeVisible();
|
||||
@@ -92,6 +92,7 @@ describe('Threads - Global Threads', () => {
|
||||
// # Go back to channel list screen, then go to global threads screen, and tap on all your threads button
|
||||
await ThreadScreen.back();
|
||||
await ChannelScreen.back();
|
||||
await device.reloadReactNative();
|
||||
await GlobalThreadsScreen.open();
|
||||
await GlobalThreadsScreen.headerAllThreadsButton.tap();
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ describe('Threads - Mark Thread as Read and Unread', () => {
|
||||
await ThreadScreen.postMessage(replyMessage);
|
||||
await ThreadScreen.back();
|
||||
await ChannelScreen.back();
|
||||
await device.reloadReactNative();
|
||||
await GlobalThreadsScreen.open();
|
||||
await GlobalThreadsScreen.headerUnreadThreadsButton.tap();
|
||||
|
||||
@@ -109,6 +110,7 @@ describe('Threads - Mark Thread as Read and Unread', () => {
|
||||
await ThreadScreen.postMessage(replyMessage);
|
||||
await ThreadScreen.back();
|
||||
await ChannelScreen.back();
|
||||
await device.reloadReactNative();
|
||||
await GlobalThreadsScreen.open();
|
||||
await GlobalThreadsScreen.headerUnreadThreadsButton.tap();
|
||||
|
||||
@@ -156,6 +158,7 @@ describe('Threads - Mark Thread as Read and Unread', () => {
|
||||
await ThreadScreen.postMessage(replyMessage);
|
||||
await ThreadScreen.back();
|
||||
await ChannelScreen.back();
|
||||
await device.reloadReactNative();
|
||||
await GlobalThreadsScreen.open();
|
||||
await GlobalThreadsScreen.headerUnreadThreadsButton.tap();
|
||||
|
||||
|
||||
@@ -88,14 +88,15 @@ describe('Threads - Open Thread in Channel', () => {
|
||||
|
||||
// * Verify on channel screen and thread is displayed
|
||||
await ChannelScreen.toBeVisible();
|
||||
const {postListPostItem} = ThreadScreen.getPostListPostItem(parentPost.id, parentMessage);
|
||||
const {postListPostItem} = ChannelScreen.getPostListPostItem(parentPost.id, parentMessage);
|
||||
await expect(postListPostItem).toBeVisible();
|
||||
|
||||
// # Go back to channel list screen
|
||||
await ChannelScreen.back();
|
||||
await GlobalThreadsScreen.back();
|
||||
});
|
||||
|
||||
it('MM-T4810_1 - should be able to open a thread in channel by permalink', async () => {
|
||||
it('MM-T4810_2 - should be able to open a thread in channel by permalink', async () => {
|
||||
// # Create a thread, go back to channel list screen, and then go to global threads screen
|
||||
const parentMessage = `Message ${getRandomId()}`;
|
||||
await ChannelScreen.open(channelsCategory, testChannel.name);
|
||||
@@ -128,7 +129,7 @@ describe('Threads - Open Thread in Channel', () => {
|
||||
|
||||
// * Verify on channel screen and thread is displayed
|
||||
await ChannelScreen.toBeVisible();
|
||||
const {postListPostItem} = ThreadScreen.getPostListPostItem(parentPost.id, parentMessage);
|
||||
const {postListPostItem} = ChannelScreen.getPostListPostItem(parentPost.id, parentMessage);
|
||||
await expect(postListPostItem).toBeVisible();
|
||||
|
||||
// # Go back to channel list screen
|
||||
|
||||
1565
detox/package-lock.json
generated
1565
detox/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -5,29 +5,29 @@
|
||||
"author": "Mattermost, Inc.",
|
||||
"devDependencies": {
|
||||
"@babel/plugin-proposal-class-properties": "7.17.12",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.18.0",
|
||||
"@babel/plugin-transform-runtime": "7.18.0",
|
||||
"@babel/preset-env": "7.18.0",
|
||||
"@types/jest": "27.5.1",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.18.2",
|
||||
"@babel/plugin-transform-runtime": "7.18.5",
|
||||
"@babel/preset-env": "7.18.2",
|
||||
"@types/jest": "28.1.1",
|
||||
"@types/tough-cookie": "4.0.2",
|
||||
"@types/uuid": "8.3.4",
|
||||
"axios": "0.27.2",
|
||||
"axios-cookiejar-support": "4.0.1",
|
||||
"babel-jest": "28.1.0",
|
||||
"axios-cookiejar-support": "4.0.2",
|
||||
"babel-jest": "28.1.1",
|
||||
"babel-plugin-module-resolver": "4.1.0",
|
||||
"client-oauth2": "4.3.3",
|
||||
"deepmerge": "4.2.2",
|
||||
"detox": "19.6.9",
|
||||
"detox": "19.7.1",
|
||||
"form-data": "4.0.0",
|
||||
"jest": "28.1.0",
|
||||
"jest-circus": "28.1.0",
|
||||
"jest-cli": "28.1.0",
|
||||
"jest-html-reporters": "3.0.7",
|
||||
"jest": "28.1.1",
|
||||
"jest-circus": "28.1.1",
|
||||
"jest-cli": "28.1.1",
|
||||
"jest-html-reporters": "3.0.9",
|
||||
"jest-junit": "13.2.0",
|
||||
"moment-timezone": "0.5.34",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"tough-cookie": "4.0.0",
|
||||
"ts-jest": "28.0.2",
|
||||
"ts-jest": "28.0.5",
|
||||
"tslib": "2.4.0",
|
||||
"typescript": "4.6.4",
|
||||
"uuid": "8.3.2"
|
||||
|
||||
Reference in New Issue
Block a user