MM-30429 Detox/E2E: Added e2e for MM-T3190, MM-T3212, MM-T3214, MM-T3227 (#5276)

* MM-30429 Detox/E2E: Added e2e for MM-T3190, MM-T3212, MM-T3214, MM-T3227

* Merge master

* Fix package-lock.json

* Upgrade deps

* Revert podfile

* Update Podfile.lock

* Stabilize closing of post options

* Merge master

* Normalize closing of post options

* Enabled MM-T1397 test case

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Joseph Baylon 2021-04-15 09:23:07 -07:00 committed by GitHub
parent 9131b25310
commit 42275536e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 1277 additions and 923 deletions

View file

@ -43,7 +43,7 @@ class PostOptions {
}
close = async () => {
await this.postOptions.tap();
await this.postOptions.tap({x: 5, y: 10});
await expect(this.postOptions).not.toBeVisible();
}

View file

@ -28,6 +28,7 @@ class EditChannelScreen {
open = async () => {
// # Open edit channel screen
await ChannelInfoScreen.channelInfoScrollView.scrollTo('bottom');
await ChannelInfoScreen.editChannelAction.tap();
return this.toBeVisible();

View file

@ -39,8 +39,8 @@ class EditPostScreen {
return this.toBeVisible();
}
back = async () => {
await this.backButton.tap();
close = async () => {
await this.closeEditPostButton.tap();
await expect(this.editPostScreen).not.toBeVisible();
}
}

View file

@ -50,7 +50,7 @@ describe('Guest Experience', () => {
await expect(postListPostItemHeaderGuestTag).not.toBeVisible();
});
xit('MM-T1397 Guest tag in search in:', async () => { // Disabled due to https://mattermost.atlassian.net/browse/MM-33854
it('MM-T1397 Guest tag in search in:', async () => {
const {
getSearchResultPostItem,
searchInSection,

View file

@ -11,42 +11,106 @@ import {
ChannelScreen,
ChannelInfoScreen,
EditChannelScreen,
MoreDirectMessagesScreen,
} from '@support/ui/screen';
import {Setup} from '@support/server_api';
import {
Setup,
Team,
User,
} from '@support/server_api';
describe('Edit Channel', () => {
const {
editChannelScreen,
headerInput,
nameInput,
purposeInput,
saveButton,
} = EditChannelScreen;
const {
addMembersAction,
archiveAction,
channelDisplayName,
channelInfoScrollView,
channelPurpose,
editChannelAction,
favoritePreferenceAction,
ignoreMentionsPreferenceAction,
manageMembersAction,
mutePreferenceAction,
notificationPreferenceAction,
leaveAction,
pinnedMessagesAction,
} = ChannelInfoScreen;
const {
getUserAtIndex,
searchInput,
startButton,
} = MoreDirectMessagesScreen;
const {
goToChannel,
openMainSidebar,
} = ChannelScreen;
let testUser;
let testOtherUser1;
let testOtherUser2;
let testChannel;
beforeAll(async () => {
const {user} = await Setup.apiInit();
const {channel, team, user} = await Setup.apiInit();
testUser = user;
testChannel = channel;
({user: testOtherUser1} = await User.apiCreateUser());
await Team.apiAddUserToTeam(testOtherUser1.id, team.id);
({user: testOtherUser2} = await User.apiCreateUser());
await Team.apiAddUserToTeam(testOtherUser2.id, team.id);
// # Open channel screen
await ChannelScreen.open(user);
await ChannelScreen.open(testUser);
});
afterAll(async () => {
await ChannelScreen.logout();
});
it('MM-T3199 should be able to edit public channel', async () => {
const {
editChannelScreen,
headerInput,
nameInput,
purposeInput,
saveButton,
} = EditChannelScreen;
const {
channelDisplayName,
channelPurpose,
} = ChannelInfoScreen;
it('MM-T3190 should be able to display channel info', async () => {
// # Open channel info screen
await goToChannel(testChannel.display_name);
await ChannelInfoScreen.open();
// * Verify channel info fields are visible
await expect(channelDisplayName).toHaveText(testChannel.display_name);
await expect(channelPurpose).toHaveText(`Channel purpose: ${testChannel.display_name.toLowerCase()}`);
await expect(element(by.text(`Channel header: ${testChannel.display_name.toLowerCase()}`))).toBeVisible();
await expect(favoritePreferenceAction).toBeVisible();
await expect(mutePreferenceAction).toBeVisible();
await expect(ignoreMentionsPreferenceAction).toBeVisible();
await expect(notificationPreferenceAction).toBeVisible();
await expect(pinnedMessagesAction).toBeVisible();
await expect(manageMembersAction).toBeVisible();
await channelInfoScrollView.scrollTo('bottom');
await expect(addMembersAction).toBeVisible();
await expect(editChannelAction).toBeVisible();
await expect(leaveAction).toBeVisible();
await expect(archiveAction).toBeVisible();
// # Close channel info screen
await ChannelInfoScreen.close();
});
it('MM-T3199 should be able to edit public channel', async () => {
// # Open edit channel screen
await goToChannel(testChannel.display_name);
await ChannelInfoScreen.open();
await EditChannelScreen.open();
// # Edit channel info
await nameInput.typeText(' name');
await purposeInput.typeText('purpose');
await purposeInput.typeText(' purpose');
await editChannelScreen.scrollTo('bottom');
await headerInput.tapReturnKey();
await headerInput.typeText('header1');
await headerInput.tapReturnKey();
await headerInput.typeText('header2');
@ -55,8 +119,67 @@ describe('Edit Channel', () => {
await saveButton.tap();
// * Verify changes have been saved
await expect(channelDisplayName).toHaveText('Town Square name');
await expect(channelPurpose).toHaveText('purpose');
await channelInfoScrollView.scrollTo('top');
await expect(channelDisplayName).toHaveText(`${testChannel.display_name} name`);
await expect(channelPurpose).toHaveText(`Channel purpose: ${testChannel.display_name.toLowerCase()} purpose`);
await expect(element(by.text(`Channel header: ${testChannel.display_name.toLowerCase()}\nheader1\nheader2`))).toBeVisible();
// # Close channel info screen
await ChannelInfoScreen.close();
});
it('MM-T3212 should be able edit direct message channel', async () => {
// # Create a DM with the other user
await openMainSidebar();
await MoreDirectMessagesScreen.open();
await searchInput.typeText(testOtherUser1.username);
await getUserAtIndex(0).tap();
await startButton.tap();
// # Open edit channel screen
await ChannelInfoScreen.open();
await EditChannelScreen.open();
// # Edit channel info
await headerInput.typeText('header1');
await headerInput.tapReturnKey();
await headerInput.typeText('header2');
// # Save changes
await saveButton.tap();
// * Verify changes have been saved
await channelInfoScrollView.scrollTo('top');
await expect(element(by.text('header1\nheader2'))).toBeVisible();
// # Close channel info screen
await ChannelInfoScreen.close();
});
it('MM-T3214 should be able edit group message channel', async () => {
// # Create a DM with the other user
await openMainSidebar();
await MoreDirectMessagesScreen.open();
await searchInput.typeText(testOtherUser1.username);
await getUserAtIndex(0).tap();
await searchInput.typeText(testOtherUser2.username);
await getUserAtIndex(0).tap();
await startButton.tap();
// # Open edit channel screen
await ChannelInfoScreen.open();
await EditChannelScreen.open();
// # Edit channel info
await headerInput.typeText('header1');
await headerInput.tapReturnKey();
await headerInput.typeText('header2');
// # Save changes
await saveButton.tap();
// * Verify changes have been saved
await channelInfoScrollView.scrollTo('top');
await expect(element(by.text('header1\nheader2'))).toBeVisible();
// # Close channel info screen

View file

@ -18,6 +18,17 @@ import {
} from '@support/server_api';
describe('Message Edit', () => {
const testMessage = Date.now().toString();
const additionalText = ' additional text';
const {
getPostListPostItem,
openPostOptionsFor,
postMessage,
} = ChannelScreen;
const {
messageInput,
saveButton,
} = EditPostScreen;
let testChannel;
beforeAll(async () => {
@ -33,19 +44,8 @@ describe('Message Edit', () => {
await ChannelScreen.logout();
});
it('MM-T3228 should be able to edit a message and save', async () => {
const {
getPostListPostItem,
openPostOptionsFor,
postMessage,
} = ChannelScreen;
const {
messageInput,
saveButton,
} = EditPostScreen;
it('MM-T3227 should be able to edit a message and cancel', async () => {
// # Post a message
const testMessage = Date.now().toString();
await postMessage(testMessage);
// # Open edit post screen
@ -53,8 +53,25 @@ describe('Message Edit', () => {
await openPostOptionsFor(post.id, testMessage);
await EditPostScreen.open();
// # Edit post and cancel
await messageInput.tap();
await messageInput.typeText(additionalText);
await EditPostScreen.close();
// * Verify post is not edited
await ChannelScreen.toBeVisible();
const {postListPostItem} = await getPostListPostItem(post.id, testMessage);
await expect(postListPostItem).toBeVisible();
});
it('MM-T3228 should be able to edit a message and save', async () => {
// # Open edit post screen
const {post} = await Post.apiGetLastPostInChannel(testChannel.id);
await openPostOptionsFor(post.id, testMessage);
await EditPostScreen.open();
// # Edit post and save
const additionalText = ' additional text';
await messageInput.tap();
await messageInput.typeText(additionalText);
await saveButton.tap();

View file

@ -28,7 +28,6 @@ describe('Saved Messages', () => {
postMessage,
} = ChannelScreen;
const {
postOptions,
reactionPickerAction,
saveAction,
unsaveAction,
@ -101,7 +100,7 @@ describe('Saved Messages', () => {
await SavedMessagesScreen.open();
await SavedMessagesScreen.openPostOptionsFor(post.id, message);
await expect(reactionPickerAction).not.toBeVisible();
await postOptions.tap();
await PostOptions.close();
// # Close saved messages screen
await SavedMessagesScreen.close();

View file

@ -158,19 +158,14 @@ describe('Search', () => {
});
it('MM-T3240 should not be able to add a reaction on search results', async () => {
const {
postOptions,
reactionPickerAction,
} = PostOptions;
// # Post message and search on text
await postMessageAndSearchText(testMessage, testPartialSearchTerm);
// * Verify add a reaction is not visible
const lastPost = await Post.apiGetLastPostInChannel(testChannel.id);
await SearchScreen.openPostOptionsFor(lastPost.post.id, testMessage);
await expect(reactionPickerAction).not.toBeVisible();
await postOptions.tap();
await expect(PostOptions.reactionPickerAction).not.toBeVisible();
await PostOptions.close();
// # Go back to channel
await SearchScreen.cancel();

921
detox/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,14 +6,14 @@
"devDependencies": {
"@babel/plugin-proposal-class-properties": "7.13.0",
"@babel/plugin-transform-modules-commonjs": "7.13.8",
"@babel/plugin-transform-runtime": "7.13.10",
"@babel/preset-env": "7.13.12",
"@babel/plugin-transform-runtime": "7.13.15",
"@babel/preset-env": "7.13.15",
"axios": "0.21.1",
"babel-jest": "26.6.3",
"babel-plugin-module-resolver": "4.1.0",
"client-oauth2": "github:larkox/js-client-oauth2#e24e2eb5dfcbbbb3a59d095e831dbe0012b0ac49",
"deepmerge": "4.2.2",
"detox": "18.9.0",
"detox": "18.11.2",
"form-data": "4.0.0",
"jest": "26.6.3",
"jest-circus": "26.6.3",

View file

@ -14,15 +14,15 @@ PODS:
- glog (0.3.5)
- jail-monkey (2.3.3):
- React
- libwebp (1.1.0):
- libwebp/demux (= 1.1.0)
- libwebp/mux (= 1.1.0)
- libwebp/webp (= 1.1.0)
- libwebp/demux (1.1.0):
- libwebp (1.2.0):
- libwebp/demux (= 1.2.0)
- libwebp/mux (= 1.2.0)
- libwebp/webp (= 1.2.0)
- libwebp/demux (1.2.0):
- libwebp/webp
- libwebp/mux (1.1.0):
- libwebp/mux (1.2.0):
- libwebp/demux
- libwebp/webp (1.1.0)
- libwebp/webp (1.2.0)
- MMKV (1.2.7):
- MMKVCore (~> 1.2.7)
- MMKVCore (1.2.7)
@ -389,10 +389,10 @@ PODS:
- React
- RNVectorIcons (8.1.0):
- React-Core
- Rudder (1.0.10)
- SDWebImage (5.9.4):
- SDWebImage/Core (= 5.9.4)
- SDWebImage/Core (5.9.4)
- Rudder (1.0.11)
- SDWebImage (5.10.4):
- SDWebImage/Core (= 5.10.4)
- SDWebImage/Core (5.10.4)
- SDWebImageWebPCoder (0.6.1):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.7)
@ -402,7 +402,7 @@ PODS:
- Swime (3.0.6)
- XCDYouTubeKit (2.8.2)
- Yoga (1.14.0)
- YoutubePlayer-in-WKWebView (0.3.4)
- YoutubePlayer-in-WKWebView (0.3.5)
DEPENDENCIES:
- BVLinearGradient (from `../node_modules/react-native-linear-gradient`)
@ -653,10 +653,10 @@ SPEC CHECKSUMS:
BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: 49cbe4b43e445b06bf29199b6ad2057649e4c8f5
FBReactNativeSpec: a804c9d6c798f94831713302354003ee54ea18cb
FBReactNativeSpec: 4862b23f27a9cdb8fdb1710af411fa677dcdd3cf
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
jail-monkey: 80c9e34da2cd54023e5ad08bf7051ec75bd43d5b
libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3
libwebp: e90b9c01d99205d03b6bb8f2c8c415e5a4ef66f0
MMKV: 22e5136f7d00197bc0fc9694b7f71519f0d1ca12
MMKVCore: 607b7b05f2c2140056b5d338e45f2c14bf3f4232
Permission-Camera: 0d2d15352e9c54c3ea8686c8c21fb1a9edf3431b
@ -726,14 +726,14 @@ SPEC CHECKSUMS:
RNShare: 503c37af86611beadccba46156fcc42170c9fb42
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
RNVectorIcons: 31cebfcf94e8cf8686eb5303ae0357da64d7a5a4
Rudder: 05e61fe2e59bcd65931f4a47d21011e15adf7159
SDWebImage: b69257f4ab14e9b6a2ef53e910fdf914d8f757c1
Rudder: ef340f877a39653f19e69124dffae12fde3f881b
SDWebImage: c666b97e1fa9c64b4909816a903322018f0a9c84
SDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21
Sentry: 9d055e2de30a77685e86b219acf02e59b82091fc
Swime: d7b2c277503b6cea317774aedc2dce05613f8b0b
XCDYouTubeKit: 79baadb0560673a67c771eba45f83e353fd12c1f
Yoga: 8c8436d4171c87504c648ae23b1d81242bdf3bbf
YoutubePlayer-in-WKWebView: af2f5929fc78882d94bfdfeea999b661b78d9717
YoutubePlayer-in-WKWebView: cfbf46da51d7370662a695a8f351e5fa1d3e1008
PODFILE CHECKSUM: 8f9184e7a51675aa02c8489226782a6a87b8d987

1014
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -122,7 +122,7 @@
"babel-plugin-module-resolver": "4.1.0",
"babel-plugin-transform-remove-console": "6.9.4",
"deep-freeze": "0.0.1",
"detox": "18.9.0",
"detox": "18.11.2",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.6",
"enzyme-to-json": "3.6.1",