2018-05-23 13:39:18 +00:00
|
|
|
const {
|
|
|
|
device, expect, element, by, waitFor
|
|
|
|
} = require('detox');
|
2020-05-20 16:33:40 +00:00
|
|
|
const data = require('../../data');
|
2021-03-18 16:52:47 +00:00
|
|
|
const { navigateToLogin, login, mockMessage, tapBack, sleep, searchRoom, starMessage, pinMessage, dismissReviewNag, tryTapping, logout } = require('../../helpers/app');
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2020-07-22 16:32:21 +00:00
|
|
|
async function navigateToRoom(roomName) {
|
|
|
|
await searchRoom(`${ roomName }`);
|
|
|
|
await element(by.id(`rooms-list-view-item-${ roomName }`)).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
describe('Room screen', () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
const mainRoom = data.groups.private.name;
|
2019-04-17 17:01:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
before(async() => {
|
2021-03-18 13:27:37 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
|
|
|
await login(data.users.regular.username, data.users.regular.password);
|
2020-07-22 16:32:21 +00:00
|
|
|
await navigateToRoom(mainRoom);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('Render', async() => {
|
|
|
|
it('should have room screen', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-view'))).toExist();
|
|
|
|
await waitFor(element(by.id(`room-view-title-${ mainRoom }`))).toExist().withTimeout(5000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Render - Header
|
|
|
|
describe('Header', async() => {
|
|
|
|
it('should have actions button ', async() => {
|
2021-04-07 18:31:25 +00:00
|
|
|
await expect(element(by.id('room-header'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2020-03-03 20:27:38 +00:00
|
|
|
|
|
|
|
it('should have threads button ', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-view-header-threads'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
});
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Render - Messagebox
|
|
|
|
describe('Messagebox', async() => {
|
|
|
|
it('should have messagebox', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have open emoji button', async() => {
|
2019-05-28 13:03:08 +00:00
|
|
|
if (device.getPlatform() === 'android') {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-open-emoji'))).toExist();
|
2019-05-28 13:03:08 +00:00
|
|
|
}
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have message input', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-input'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have audio button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-send-audio'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have actions button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-actions'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Usage', async() => {
|
|
|
|
describe('Messagebox', async() => {
|
|
|
|
it('should send message', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await mockMessage('message')
|
|
|
|
await expect(element(by.label(`${ data.random }message`)).atIndex(0)).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
|
2019-05-28 13:03:08 +00:00
|
|
|
it('should show/hide emoji keyboard', async () => {
|
|
|
|
if (device.getPlatform() === 'android') {
|
|
|
|
await element(by.id('messagebox-open-emoji')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('messagebox-keyboard-emoji'))).toExist().withTimeout(10000);
|
|
|
|
await expect(element(by.id('messagebox-close-emoji'))).toExist();
|
2019-05-28 13:03:08 +00:00
|
|
|
await expect(element(by.id('messagebox-open-emoji'))).toBeNotVisible();
|
|
|
|
await element(by.id('messagebox-close-emoji')).tap();
|
|
|
|
await waitFor(element(by.id('messagebox-keyboard-emoji'))).toBeNotVisible().withTimeout(10000);
|
|
|
|
await expect(element(by.id('messagebox-close-emoji'))).toBeNotVisible();
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-open-emoji'))).toExist();
|
2019-05-28 13:03:08 +00:00
|
|
|
}
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should show/hide emoji autocomplete', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id('messagebox-input')).typeText(':joy');
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('messagebox-container'))).toExist().withTimeout(10000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
await waitFor(element(by.id('messagebox-container'))).toBeNotVisible().withTimeout(10000);
|
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should show and tap on emoji autocomplete', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).replaceText(':');
|
|
|
|
await element(by.id('messagebox-input')).typeText('joy'); // workaround for number keyboard
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('messagebox-container'))).toExist().withTimeout(10000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('mention-item-joy')).tap();
|
|
|
|
await expect(element(by.id('messagebox-input'))).toHaveText(':joy: ');
|
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2021-04-07 18:56:16 +00:00
|
|
|
it('should not show emoji autocomplete on semicolon in middle of a string', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
// await element(by.id('messagebox-input')).replaceText(':');
|
|
|
|
await element(by.id('messagebox-input')).typeText('name:is');
|
|
|
|
await waitFor(element(by.id('messagebox-container'))).toNotExist().withTimeout(20000);
|
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
});
|
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should show and tap on user autocomplete and send mention', async() => {
|
2020-07-15 16:28:34 +00:00
|
|
|
const username = data.users.regular.username
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('messagebox-input')).tap();
|
2020-07-15 16:28:34 +00:00
|
|
|
await element(by.id('messagebox-input')).typeText(`@${ username }`);
|
2020-07-22 16:32:21 +00:00
|
|
|
await waitFor(element(by.id('messagebox-container'))).toExist().withTimeout(4000);
|
|
|
|
await waitFor(element(by.id(`mention-item-${ username }`))).toBeVisible().withTimeout(4000)
|
|
|
|
await tryTapping(element(by.id(`mention-item-${ username }`)), 2000, true);
|
2020-07-15 16:28:34 +00:00
|
|
|
await expect(element(by.id('messagebox-input'))).toHaveText(`@${ username } `);
|
2020-07-22 16:32:21 +00:00
|
|
|
await tryTapping(element(by.id('messagebox-input')), 2000)
|
2018-09-11 16:32:52 +00:00
|
|
|
await element(by.id('messagebox-input')).typeText(`${ data.random }mention`);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.label(`@${ data.user } ${ data.random }mention`)).atIndex(0)).toExist().withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2021-04-07 18:56:16 +00:00
|
|
|
it('should not show user autocomplete on @ in the middle of a string', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText(`email@gmail`);
|
|
|
|
await waitFor(element(by.id('messagebox-container'))).toNotExist().withTimeout(4000);
|
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
});
|
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should show and tap on room autocomplete', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText('#general');
|
2020-07-22 16:32:21 +00:00
|
|
|
//await waitFor(element(by.id('messagebox-container'))).toExist().withTimeout(4000);
|
|
|
|
await waitFor(element(by.id('mention-item-general'))).toBeVisible().withTimeout(4000);
|
|
|
|
await tryTapping(element(by.id('mention-item-general')), 2000, true)
|
2018-05-23 13:39:18 +00:00
|
|
|
await expect(element(by.id('messagebox-input'))).toHaveText('#general ');
|
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
});
|
2021-03-18 13:27:37 +00:00
|
|
|
|
2021-04-07 18:56:16 +00:00
|
|
|
it('should not show room autocomplete on # in middle of a string', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText('te#gen');
|
|
|
|
await waitFor(element(by.id('messagebox-container'))).toNotExist().withTimeout(4000);
|
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
});
|
2021-03-18 13:27:37 +00:00
|
|
|
it('should draft message', async () => {
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText(`${ data.random }draft`);
|
2021-03-18 13:27:37 +00:00
|
|
|
await tapBack();
|
|
|
|
|
|
|
|
await navigateToRoom(mainRoom);
|
|
|
|
await expect(element(by.id('messagebox-input'))).toHaveText(`${ data.random }draft`);
|
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
await tapBack();
|
|
|
|
|
|
|
|
await navigateToRoom(mainRoom);
|
|
|
|
await expect(element(by.id('messagebox-input'))).toHaveText('');
|
|
|
|
});
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('Message', async() => {
|
|
|
|
it('should copy permalink', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.label('Permalink')).atIndex(0).tap();
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
// TODO: test clipboard
|
|
|
|
});
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should copy message', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.label('Copy')).atIndex(0).tap();
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
// TODO: test clipboard
|
|
|
|
});
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should star message', async() => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await starMessage('message')
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2020-07-22 16:32:21 +00:00
|
|
|
await sleep(1000) //https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/2324
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'slow', 0.5);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await waitFor(element(by.label('Unstar')).atIndex(0)).toBeVisible().withTimeout(6000);
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.8);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should react to message', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
|
|
|
await element(by.id('add-reaction')).tap();
|
|
|
|
await waitFor(element(by.id('reaction-picker'))).toBeVisible().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('reaction-picker-😃')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('reaction-picker-grinning'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('reaction-picker-grinning')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('message-reaction-:grinning:'))).toExist().withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2020-06-15 19:35:45 +00:00
|
|
|
it('should react to message with frequently used emoji', async() => {
|
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
|
|
|
await waitFor(element(by.id('message-actions-emoji-+1'))).toBeVisible().withTimeout(2000);
|
|
|
|
await element(by.id('message-actions-emoji-+1')).tap();
|
|
|
|
await waitFor(element(by.id('message-reaction-:+1:'))).toBeVisible().withTimeout(60000);
|
|
|
|
});
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should show reaction picker on add reaction button pressed and have frequently used emoji', async() => {
|
|
|
|
await element(by.id('message-add-reaction')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('reaction-picker'))).toExist().withTimeout(2000);
|
|
|
|
await waitFor(element(by.id('reaction-picker-grinning'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('reaction-picker-😃')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('reaction-picker-grimacing'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('reaction-picker-grimacing')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('message-reaction-:grimacing:'))).toExist().withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2020-07-22 16:32:21 +00:00
|
|
|
|
|
|
|
it('should ask for review', async() => {
|
|
|
|
await dismissReviewNag() //TODO: Create a proper test for this elsewhere.
|
|
|
|
})
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should remove reaction', async() => {
|
|
|
|
await element(by.id('message-reaction-:grinning:')).tap();
|
|
|
|
await waitFor(element(by.id('message-reaction-:grinning:'))).toBeNotVisible().withTimeout(60000);
|
|
|
|
});
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-24 20:17:45 +00:00
|
|
|
it('should edit message', async() => {
|
|
|
|
await mockMessage('edit');
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }edit`)).atIndex(0).longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.label('Edit')).atIndex(0).tap();
|
2018-05-24 20:17:45 +00:00
|
|
|
await element(by.id('messagebox-input')).typeText('ed');
|
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toExist().withTimeout(60000);
|
2018-05-24 20:17:45 +00:00
|
|
|
});
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-24 20:17:45 +00:00
|
|
|
it('should quote message', async() => {
|
|
|
|
await mockMessage('quote');
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }quote`)).atIndex(0).longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.label('Quote')).atIndex(0).tap();
|
2018-05-24 20:17:45 +00:00
|
|
|
await element(by.id('messagebox-input')).typeText(`${ data.random }quoted`);
|
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-24 20:17:45 +00:00
|
|
|
// TODO: test if quote was sent
|
|
|
|
});
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should pin message', async() => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await mockMessage('pin')
|
|
|
|
await pinMessage('pin')
|
2020-12-01 19:26:03 +00:00
|
|
|
|
2021-04-19 14:31:43 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }pin`)).atIndex(0)).toExist().withTimeout(5000);
|
|
|
|
await waitFor(element(by.label(`${ data.users.regular.username } Message pinned`)).atIndex(0)).toExist().withTimeout(5000);
|
2020-07-22 16:32:21 +00:00
|
|
|
await element(by.label(`${ data.random }pin`)).atIndex(0).longPress();
|
|
|
|
await waitFor(element(by.id('action-sheet'))).toExist().withTimeout(1000);
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
|
|
|
await waitFor(element(by.label('Unpin'))).toBeVisible().withTimeout(2000);
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.8);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2020-06-15 19:35:45 +00:00
|
|
|
it('should delete message', async() => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await mockMessage('delete')
|
|
|
|
|
|
|
|
await waitFor(element(by.label(`${ data.random }delete`)).atIndex(0)).toBeVisible();
|
|
|
|
await element(by.label(`${ data.random }delete`)).atIndex(0).longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
2021-04-19 14:31:43 +00:00
|
|
|
await waitFor(element(by.label('Delete'))).toExist().withTimeout(1000);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.label('Delete')).atIndex(0).tap();
|
2020-06-15 19:35:45 +00:00
|
|
|
|
|
|
|
const deleteAlertMessage = 'You will not be able to recover this message!';
|
2020-07-22 16:32:21 +00:00
|
|
|
await waitFor(element(by.text(deleteAlertMessage)).atIndex(0)).toExist().withTimeout(10000);
|
2020-06-15 19:35:45 +00:00
|
|
|
await element(by.text('Delete')).tap();
|
|
|
|
|
2020-07-22 16:32:21 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }delete`)).atIndex(0)).toNotExist().withTimeout(2000);
|
2020-06-15 19:35:45 +00:00
|
|
|
});
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
2020-12-01 19:26:03 +00:00
|
|
|
});
|