[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>
This commit is contained in:
Gerzon Z 2021-06-04 12:16:05 -04:00 committed by GitHub
parent 5fd7981d07
commit c087780ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 526 additions and 122 deletions

View File

@ -58119,6 +58119,7 @@ exports[`Storyshots Room Item Tag 1`] = `
},
]
}
testID="auto-join-tag"
>
Auto-join
</Text>
@ -59020,6 +59021,7 @@ exports[`Storyshots Room Item Tag 1`] = `
},
]
}
testID="auto-join-tag"
>
Auto-join
</Text>

View File

@ -18,6 +18,7 @@ export const Item = React.memo(({ item, hide, theme }) => {
onPress={onPress}
style={[styles.item, { backgroundColor: themes[theme].focusedBackground }]}
theme={theme}
testID={item.testID}
>
<CustomIcon name={item.icon} size={20} color={item.danger ? themes[theme].dangerColor : themes[theme].bodyText} />
<View style={styles.titleContainer}>
@ -42,7 +43,8 @@ Item.propTypes = {
icon: PropTypes.string,
danger: PropTypes.bool,
onPress: PropTypes.func,
right: PropTypes.func
right: PropTypes.func,
testID: PropTypes.string
}),
hide: PropTypes.func,
theme: PropTypes.string

View File

@ -18,13 +18,15 @@ const ListIcon = React.memo(({
theme,
name,
color,
style
style,
testID
}) => (
<View style={[styles.icon, style]}>
<CustomIcon
name={name}
color={color ?? themes[theme].auxiliaryText}
size={ICON_SIZE}
testID={testID}
/>
</View>
));
@ -33,7 +35,8 @@ ListIcon.propTypes = {
theme: PropTypes.string,
name: PropTypes.string,
color: PropTypes.string,
style: PropTypes.object
style: PropTypes.object,
testID: PropTypes.string
};
ListIcon.displayName = 'List.Icon';

View File

@ -755,7 +755,6 @@
"Convert_to_Team": "Convert to Team",
"Convert_to_Team_Warning": "This can't be undone. Once you convert a channel to a team, you can not turn it back to a channel.",
"Move_to_Team": "Move to Team",
"Move_Channel_to_Team": "Move Channel to Team",
"Move_Channel_Paragraph": "Moving a channel inside a team means that this channel will be added in the teams context, however, all channels members, which are not members of the respective team, will still have access to this channel, but will not be added as teams members. \n\nAll channels management will still be made by the owners of this channel.\n\nTeams members and even teams owners, if not a member of this channel, can not have access to the channels content. \n\nPlease notice that the Teams owner will be able remove members from the Channel.",
"Move_to_Team_Warning": "After reading the previous intructions about this behavior, do you still want to move this channel to the selected team?",
"Load_More": "Load More",

View File

@ -94,7 +94,7 @@ const RoomItem = ({
alert={alert}
/>
{
autoJoin ? <Tag name={I18n.t('Auto-join')} /> : null
autoJoin ? <Tag testID='auto-join-tag' name={I18n.t('Auto-join')} /> : null
}
<UpdatedAt
date={date}

View File

@ -6,7 +6,7 @@ import { themes } from '../../constants/colors';
import { useTheme } from '../../theme';
import styles from './styles';
const Tag = React.memo(({ name }) => {
const Tag = React.memo(({ name, testID }) => {
const { theme } = useTheme();
return (
@ -16,6 +16,7 @@ const Tag = React.memo(({ name }) => {
styles.tagText, { color: themes[theme].infoText }
]}
numberOfLines={1}
testID={testID}
>
{name}
</Text>
@ -24,7 +25,8 @@ const Tag = React.memo(({ name }) => {
});
Tag.propTypes = {
name: PropTypes.string
name: PropTypes.string,
testID: PropTypes.string
};
export default Tag;

View File

@ -51,7 +51,7 @@ const AddChannelTeamView = ({
<List.Item
title='Add_Existing'
onPress={() => navigation.navigate('AddExistingChannelView', { teamId, teamChannels })}
testID='add-channel-team-view-create-channel'
testID='add-channel-team-view-add-existing'
left={() => <List.Icon name='channel-public' />}
right={() => <List.Icon name='chevron-right' />}
theme={theme}

View File

@ -61,7 +61,7 @@ class AddExistingChannelView extends React.Component {
options.headerRight = () => selected.length > 0 && (
<HeaderButton.Container>
<HeaderButton.Item title={I18n.t('Create')} onPress={this.submit} testID='add-existing-channel-view-submit' />
<HeaderButton.Item title={I18n.t('Next')} onPress={this.submit} testID='add-existing-channel-view-submit' />
</HeaderButton.Container>
);
@ -169,7 +169,7 @@ class AddExistingChannelView extends React.Component {
title={RocketChat.getRoomTitle(item)}
translateTitle={false}
onPress={() => this.toggleChannel(item.rid)}
testID='add-existing-channel-view-item'
testID={`add-existing-channel-view-item-${ item.name }`}
left={() => <List.Icon name={icon} />}
right={() => (isChecked ? <List.Icon name='check' /> : null)}
/>

View File

@ -334,7 +334,7 @@ class CreateChannelView extends React.Component {
keyboardVerticalOffset={128}
>
<StatusBar />
<SafeAreaView testID={isTeam ? 'create-team-view' : 'create-channel-view'}>
<SafeAreaView testID='create-channel-view'>
<ScrollView {...scrollPersistTaps}>
<View style={[sharedStyles.separatorVertical, { borderColor: themes[theme].separatorColor }]}>
<TextInput
@ -345,7 +345,7 @@ class CreateChannelView extends React.Component {
onChangeText={this.onChangeText}
placeholder={isTeam ? I18n.t('Team_Name') : I18n.t('Channel_Name')}
returnKeyType='done'
testID={isTeam ? 'create-team-name' : 'create-channel-name'}
testID='create-channel-name'
autoCorrect={false}
autoCapitalize='none'
theme={theme}

View File

@ -518,7 +518,7 @@ class RoomActionsView extends React.Component {
try {
const { room } = this.state;
const { navigation } = this.props;
const result = await RocketChat.addRoomsToTeam({ teamId: selected.teamId, rooms: [room.rid] });
const result = await RocketChat.addRoomsToTeam({ teamId: selected?.[0], rooms: [room.rid] });
if (result.success) {
navigation.navigate('RoomView');
}
@ -538,13 +538,18 @@ class RoomActionsView extends React.Component {
);
if (teamRooms.length) {
const data = teamRooms.map(team => ({
rid: team.teamId,
t: team.t,
name: team.name
}));
navigation.navigate('SelectListView', {
title: 'Move_to_Team',
infoText: 'Move_Channel_Paragraph',
nextAction: () => {
navigation.push('SelectListView', {
title: 'Select_Team',
data: teamRooms,
data,
isRadio: true,
isSearch: true,
onSearch: onChangeText => this.searchTeam(onChangeText),
@ -554,7 +559,6 @@ class RoomActionsView extends React.Component {
confirmationText: I18n.t('Yes_action_it', { action: I18n.t('move') }),
onPress: () => this.handleMoveToTeam(selected)
})
});
}
});
@ -795,11 +799,11 @@ class RoomActionsView extends React.Component {
? (
<>
<List.Item
title='Move_Channel_to_Team'
title='Move_to_Team'
onPress={() => this.onPressTouchable({
event: this.moveToTeam
})}
testID='room-actions-convert-to-team'
testID='room-actions-move-to-team'
left={() => <List.Icon name='channel-move-to-team' />}
showActionIndicator
/>

View File

@ -265,7 +265,8 @@ class RoomMembersView extends React.Component {
options.push({
icon: 'ignore',
title: I18n.t(isIgnored ? 'Unignore' : 'Ignore'),
onPress: () => this.handleIgnore(selectedUser, !isIgnored)
onPress: () => this.handleIgnore(selectedUser, !isIgnored),
testID: 'action-sheet-ignore-user'
});
}
@ -284,7 +285,8 @@ class RoomMembersView extends React.Component {
confirmationText: I18n.t(userIsMuted ? 'Unmute' : 'Mute'),
onPress: () => this.handleMute(selectedUser)
});
}
},
testID: 'action-sheet-mute-user'
});
}
@ -296,7 +298,8 @@ class RoomMembersView extends React.Component {
icon: 'shield-check',
title: I18n.t('Owner'),
onPress: () => this.handleOwner(selectedUser, !isOwner),
right: () => <CustomIcon name={isOwner ? 'checkbox-checked' : 'checkbox-unchecked'} size={20} color={isOwner ? themes[theme].tintActive : themes[theme].auxiliaryTintColor} />
right: () => <CustomIcon testID={isOwner ? 'action-sheet-set-owner-checked' : 'action-sheet-set-owner-unchecked'} name={isOwner ? 'checkbox-checked' : 'checkbox-unchecked'} size={20} color={isOwner ? themes[theme].tintActive : themes[theme].auxiliaryTintColor} />,
testID: 'action-sheet-set-owner'
});
}
@ -308,7 +311,8 @@ class RoomMembersView extends React.Component {
icon: 'shield-alt',
title: I18n.t('Leader'),
onPress: () => this.handleLeader(selectedUser, !isLeader),
right: () => <CustomIcon name={isLeader ? 'checkbox-checked' : 'checkbox-unchecked'} size={20} color={isLeader ? themes[theme].tintActive : themes[theme].auxiliaryTintColor} />
right: () => <CustomIcon testID={isLeader ? 'action-sheet-set-leader-checked' : 'action-sheet-set-leader-unchecked'} name={isLeader ? 'checkbox-checked' : 'checkbox-unchecked'} size={20} color={isLeader ? themes[theme].tintActive : themes[theme].auxiliaryTintColor} />,
testID: 'action-sheet-set-leader'
});
}
@ -320,7 +324,8 @@ class RoomMembersView extends React.Component {
icon: 'shield',
title: I18n.t('Moderator'),
onPress: () => this.handleModerator(selectedUser, !isModerator),
right: () => <CustomIcon name={isModerator ? 'checkbox-checked' : 'checkbox-unchecked'} size={20} color={isModerator ? themes[theme].tintActive : themes[theme].auxiliaryTintColor} />
right: () => <CustomIcon testID={isModerator ? 'action-sheet-set-moderator-checked' : 'action-sheet-set-moderator-unchecked'} name={isModerator ? 'checkbox-checked' : 'checkbox-unchecked'} size={20} color={isModerator ? themes[theme].tintActive : themes[theme].auxiliaryTintColor} />,
testID: 'action-sheet-set-moderator'
});
}
@ -330,7 +335,8 @@ class RoomMembersView extends React.Component {
icon: 'logout',
danger: true,
title: I18n.t('Remove_from_Team'),
onPress: () => this.handleRemoveFromTeam(selectedUser)
onPress: () => this.handleRemoveFromTeam(selectedUser),
testID: 'action-sheet-remove-from-team'
});
}
@ -346,7 +352,8 @@ class RoomMembersView extends React.Component {
confirmationText: I18n.t('Yes_remove_user'),
onPress: () => this.handleRemoveUserFromRoom(selectedUser)
});
}
},
testID: 'action-sheet-remove-from-room'
});
}

View File

@ -134,8 +134,8 @@ class SelectListView extends React.Component {
const icon = item.teamMain ? teamIcon : channelIcon;
const checked = this.isChecked(item.rid) ? 'check' : null;
const showRadio = () => <RadioButton selected={selected.includes(item.rid)} color={themes[theme].actionTintColor} size={ICON_SIZE} />;
const showCheck = () => <List.Icon name={checked} color={themes[theme].actionTintColor} />;
const showRadio = () => <RadioButton testID={selected ? `radio-button-selected-${ item.name }` : `radio-button-unselected-${ item.name }`} selected={selected.includes(item.rid)} color={themes[theme].actionTintColor} size={ICON_SIZE} />;
const showCheck = () => <List.Icon testID={checked ? `${ item.name }-checked` : `${ item.name }-unchecked`} name={checked} color={themes[theme].actionTintColor} />;
return (
<>

View File

@ -217,9 +217,9 @@ class TeamChannelsView extends React.Component {
options.headerRight = () => (
<HeaderButton.Container>
{ showCreate
? <HeaderButton.Item iconName='create' onPress={() => navigation.navigate('AddChannelTeamView', { teamId: this.teamId, teamChannels: data })} />
? <HeaderButton.Item iconName='create' testID='team-channels-view-create' onPress={() => navigation.navigate('AddChannelTeamView', { teamId: this.teamId, teamChannels: data })} />
: null}
<HeaderButton.Item iconName='search' onPress={this.onSearchPress} />
<HeaderButton.Item iconName='search' testID='team-channels-view-search' onPress={this.onSearchPress} />
</HeaderButton.Container>
);
navigation.setOptions(options);
@ -388,7 +388,8 @@ class TeamChannelsView extends React.Component {
title: I18n.t('Auto-join'),
icon: item.t === 'p' ? 'channel-private' : 'channel-public',
onPress: () => this.toggleAutoJoin(item),
right: () => <CustomIcon name={autoJoinIcon} size={20} color={autoJoinIconColor} />
right: () => <CustomIcon testID={isAutoJoinChecked ? 'auto-join-checked' : 'auto-join-unchecked'} name={autoJoinIcon} size={20} color={autoJoinIconColor} />,
testID: 'action-sheet-auto-join'
});
}
@ -398,7 +399,8 @@ class TeamChannelsView extends React.Component {
title: I18n.t('Remove_from_Team'),
icon: 'close',
danger: true,
onPress: () => this.remove(item)
onPress: () => this.remove(item),
testID: 'action-sheet-remove-from-team'
});
}
@ -408,7 +410,8 @@ class TeamChannelsView extends React.Component {
title: I18n.t('Delete'),
icon: 'delete',
danger: true,
onPress: () => this.delete(item)
onPress: () => this.delete(item),
testID: 'action-sheet-delete'
});
}

View File

@ -42,6 +42,11 @@ const data = {
name: `detox-private-${ value }`
}
},
teams: {
private: {
name: `detox-team-${ value }`
}
},
registeringUser: {
username: `newuser${ value }`,
password: `password${ value }`,
@ -57,6 +62,11 @@ const data = {
password: `passwordthree${ value }`,
email: `mobile+registeringthree${ value }@rocket.chat`
},
registeringUser4: {
username: `newuserfour${ value }`,
password: `passwordfour${ value }`,
email: `mobile+registeringfour${ value }@rocket.chat`
},
random: value
}
module.exports = data;

View File

@ -42,6 +42,11 @@ const data = {
name: `detox-private-${ value }`
}
},
teams: {
private: {
name: `detox-team-${ value }`
}
},
registeringUser: {
username: `newuser${ value }`,
password: `password${ value }`,
@ -57,6 +62,11 @@ const data = {
password: `passwordthree${ value }`,
email: `mobile+registeringthree${ value }@rocket.chat`
},
registeringUser4: {
username: `newuserfour${ value }`,
password: `passwordfour${ value }`,
email: `mobile+registeringfour${ value }@rocket.chat`
},
random: value
}
module.exports = data;

View File

@ -67,7 +67,7 @@ async function starMessage(message){
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.label('Star')).tap();
await element(by.label('Star')).atIndex(0).tap();
await waitFor(element(by.id('action-sheet'))).not.toExist().withTimeout(5000);
};
@ -78,7 +78,7 @@ async function pinMessage(message){
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.label('Pin')).tap();
await element(by.label('Pin')).atIndex(0).tap();
await waitFor(element(by.id('action-sheet'))).not.toExist().withTimeout(5000);
}

View File

@ -98,10 +98,6 @@ describe('Join public room', () => {
await expect(element(by.id('room-actions-starred'))).toBeVisible();
});
it('should have search', async() => {
await expect(element(by.id('room-actions-search'))).toBeVisible();
});
it('should have share', async() => {
await expect(element(by.id('room-actions-share'))).toBeVisible();
});
@ -150,7 +146,6 @@ describe('Join public room', () => {
await expect(element(by.id('room-actions-files'))).toBeVisible();
await expect(element(by.id('room-actions-mentioned'))).toBeVisible();
await expect(element(by.id('room-actions-starred'))).toBeVisible();
await expect(element(by.id('room-actions-search'))).toBeVisible();
await element(by.type('UIScrollView')).atIndex(1).swipe('down');
await expect(element(by.id('room-actions-share'))).toBeVisible();
await expect(element(by.id('room-actions-pinned'))).toBeVisible();

View File

@ -168,7 +168,7 @@ describe('Room screen', () => {
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.label('Permalink')).tap();
await element(by.label('Permalink')).atIndex(0).tap();
// TODO: test clipboard
});
@ -178,7 +178,7 @@ describe('Room screen', () => {
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.label('Copy')).tap();
await element(by.label('Copy')).atIndex(0).tap();
// TODO: test clipboard
});
@ -191,7 +191,7 @@ describe('Room screen', () => {
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', 'slow', 0.5);
await waitFor(element(by.label('Unstar'))).toBeVisible().withTimeout(6000);
await waitFor(element(by.label('Unstar')).atIndex(0)).toBeVisible().withTimeout(6000);
await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.8);
});
@ -243,7 +243,7 @@ describe('Room screen', () => {
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.label('Edit')).tap();
await element(by.label('Edit')).atIndex(0).tap();
await element(by.id('messagebox-input')).typeText('ed');
await element(by.id('messagebox-send-message')).tap();
await waitFor(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toExist().withTimeout(60000);
@ -255,7 +255,7 @@ describe('Room screen', () => {
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.label('Quote')).tap();
await element(by.label('Quote')).atIndex(0).tap();
await element(by.id('messagebox-input')).typeText(`${ data.random }quoted`);
await element(by.id('messagebox-send-message')).tap();
@ -285,7 +285,7 @@ describe('Room screen', () => {
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('Delete'))).toExist().withTimeout(1000);
await element(by.label('Delete')).tap();
await element(by.label('Delete')).atIndex(0).tap();
const deleteAlertMessage = 'You will not be able to recover this message!';
await waitFor(element(by.text(deleteAlertMessage)).atIndex(0)).toExist().withTimeout(10000);

View File

@ -77,10 +77,6 @@ describe('Room actions screen', () => {
await expect(element(by.id('room-actions-starred'))).toExist();
});
it('should have search', async() => {
await expect(element(by.id('room-actions-search'))).toExist();
});
it('should have share', async() => {
await waitFor(element(by.id('room-actions-share'))).toExist();
await expect(element(by.id('room-actions-share'))).toExist();
@ -147,10 +143,6 @@ describe('Room actions screen', () => {
await expect(element(by.id('room-actions-starred'))).toExist();
});
it('should have search', async() => {
await expect(element(by.id('room-actions-search'))).toExist();
});
it('should have share', async() => {
await waitFor(element(by.id('room-actions-share'))).toExist();
await expect(element(by.id('room-actions-share'))).toExist();
@ -229,7 +221,7 @@ describe('Room actions screen', () => {
await element(by.label(`${ data.random }messageToStar`)).atIndex(0).longPress();
await expect(element(by.id('action-sheet'))).toExist();
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
await element(by.label('Unstar')).tap();
await element(by.label('Unstar')).atIndex(0).tap();
await waitFor(element(by.label(`${ data.random }messageToStar`).withAncestor(by.id('starred-messages-view')))).toBeNotVisible().withTimeout(60000);
await backToActions();
@ -256,29 +248,29 @@ describe('Room actions screen', () => {
await expect(element(by.id('action-sheet'))).toExist();
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
await element(by.label('Unpin')).tap();
await element(by.label('Unpin')).atIndex(0).tap();
await waitFor(element(by.label(`${ data.random }messageToPin`).withAncestor(by.id('pinned-messages-view')))).not.toExist().withTimeout(6000);
await backToActions();
});
it('should search and find a message', async() => {
// it('should search and find a message', async() => {
//Go back to room and send a message
await tapBack();
await mockMessage('messageToFind');
// //Go back to room and send a message
// await tapBack();
// await mockMessage('messageToFind');
//Back into Room Actions
await element(by.id('room-header')).tap();
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(5000);
// //Back into Room Actions
// await element(by.id('room-header')).tap();
// await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(5000);
await element(by.id('room-actions-search')).tap();
await waitFor(element(by.id('search-messages-view'))).toExist().withTimeout(2000);
await expect(element(by.id('search-message-view-input'))).toExist();
await element(by.id('search-message-view-input')).replaceText(`/${ data.random }messageToFind/`);
await waitFor(element(by.label(`${ data.random }messageToFind`).withAncestor(by.id('search-messages-view')))).toExist().withTimeout(60000);
await backToActions();
});
// await element(by.id('room-actions-search')).tap();
// await waitFor(element(by.id('search-messages-view'))).toExist().withTimeout(2000);
// await expect(element(by.id('search-message-view-input'))).toExist();
// await element(by.id('search-message-view-input')).replaceText(`/${ data.random }messageToFind/`);
// await waitFor(element(by.label(`${ data.random }messageToFind`).withAncestor(by.id('search-messages-view')))).toExist().withTimeout(60000);
// await backToActions();
// });
});
describe('Notification', async() => {
@ -419,46 +411,46 @@ describe('Room actions screen', () => {
it('should set/remove as owner', async() => {
await openActionSheet(user.username);
await element(by.label('Set as owner')).tap();
await element(by.id('action-sheet-set-owner')).tap();
await waitForToast();
await openActionSheet(user.username);
await element(by.label('Remove as owner')).tap();
await waitFor(element(by.id('action-sheet-set-owner-checked'))).toBeVisible().withTimeout(6000);
await element(by.id('action-sheet-set-owner')).tap();
await waitForToast();
await openActionSheet(user.username);
// Tests if Remove as owner worked
await waitFor(element(by.label('Set as owner'))).toExist().withTimeout(5000);
await waitFor(element(by.id('action-sheet-set-owner-unchecked'))).toBeVisible().withTimeout(60000);
await closeActionSheet();
});
it('should set/remove as leader', async() => {
await openActionSheet(user.username);
await element(by.label('Set as leader')).tap();
await element(by.id('action-sheet-set-leader')).tap();
await waitForToast();
await openActionSheet(user.username);
await element(by.label('Remove as leader')).tap();
await waitFor(element(by.id('action-sheet-set-leader-checked'))).toBeVisible().withTimeout(6000);
await element(by.id('action-sheet-set-leader')).tap();
await waitForToast();
await openActionSheet(user.username);
// Tests if Remove as leader worked
await waitFor(element(by.label('Set as leader'))).toExist().withTimeout(5000);
await waitFor(element(by.id('action-sheet-set-owner-unchecked'))).toBeVisible().withTimeout(60000);
await closeActionSheet();
});
it('should set/remove as moderator', async() => {
await openActionSheet(user.username);
await element(by.label('Set as moderator')).tap();
await element(by.id('action-sheet-set-moderator')).tap();
await waitForToast();
await openActionSheet(user.username);
await element(by.label('Remove as moderator')).tap();
await waitFor(element(by.id('action-sheet-set-moderator-checked'))).toBeVisible().withTimeout(6000);
await element(by.id('action-sheet-set-moderator')).tap();
await waitForToast();
await openActionSheet(user.username);
// Tests if Remove as moderator worked
await waitFor(element(by.label('Set as moderator'))).toExist().withTimeout(5000);
await waitFor(element(by.id('action-sheet-set-moderator-unchecked'))).toBeVisible().withTimeout(60000);
await closeActionSheet();
});

View File

@ -102,10 +102,6 @@ describe('Discussion', () => {
await expect(element(by.id('room-actions-starred'))).toBeVisible();
});
it('should have search', async() => {
await expect(element(by.id('room-actions-search'))).toBeVisible();
});
it('should have share', async() => {
await element(by.type('UIScrollView')).atIndex(1).swipe('up');
await expect(element(by.id('room-actions-share'))).toBeVisible();

View File

@ -2,9 +2,9 @@ const {
device, expect, element, by, waitFor
} = require('detox');
const data = require('../../data');
const { tapBack, sleep, navigateToLogin, login, tryTapping } = require('../../helpers/app');
const { navigateToLogin, login } = require('../../helpers/app');
const teamName = `team-${ data.random }`;
describe('Create team screen', () => {
before(async() => {
@ -18,38 +18,18 @@ describe('Create team screen', () => {
await element(by.id('rooms-list-view-create-channel')).tap();
});
describe('Render', async() => {
it('should have team button', async() => {
await waitFor(element(by.id('new-message-view-create-channel'))).toBeVisible().withTimeout(2000);
});
})
it('should have team button', async() => {
await waitFor(element(by.id('new-message-view-create-team'))).toBeVisible().withTimeout(2000);
});
describe('Usage', async() => {
it('should navigate to select users', async() => {
await element(by.id('new-message-view-create-channel')).tap();
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(5000);
});
})
it('should navigate to select users', async() => {
await element(by.id('new-message-view-create-team')).tap();
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(5000);
});
});
describe('Select Users', async() => {
it('should search users', async() => {
await element(by.id('select-users-view-search')).replaceText('rocket.cat');
await waitFor(element(by.id(`select-users-view-item-rocket.cat`))).toBeVisible().withTimeout(10000);
});
it('should select/unselect user', async() => {
// Spotlight issues
await element(by.id('select-users-view-item-rocket.cat')).tap();
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeVisible().withTimeout(10000);
await element(by.id('selected-user-rocket.cat')).tap();
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeNotVisible().withTimeout(10000);
// Spotlight issues
await element(by.id('select-users-view-item-rocket.cat')).tap();
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeVisible().withTimeout(10000);
});
it('should create team', async() => {
it('should nav to create team', async() => {
await element(by.id('selected-users-view-submit')).tap();
await waitFor(element(by.id('create-channel-view'))).toExist().withTimeout(10000);
});
@ -64,19 +44,33 @@ describe('Create team screen', () => {
});
it('should create private team', async() => {
const room = `private${ data.random }`;
await element(by.id('create-channel-name')).replaceText('');
await element(by.id('create-channel-name')).typeText(room);
await element(by.id('create-channel-name')).typeText(teamName);
await element(by.id('create-channel-submit')).tap();
await waitFor(element(by.id('room-view'))).toExist().withTimeout(20000);
await expect(element(by.id('room-view'))).toExist();
await waitFor(element(by.id(`room-view-title-${ room }`))).toExist().withTimeout(6000);
await expect(element(by.id(`room-view-title-${ room }`))).toExist();
await tapBack();
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(10000);
await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(6000);
await expect(element(by.id(`rooms-list-view-item-${ room }`))).toExist();
await waitFor(element(by.id(`room-view-title-${ teamName }`))).toExist().withTimeout(6000);
await expect(element(by.id(`room-view-title-${ teamName }`))).toExist();
});
})
});
describe('Delete Team', async() => {
it('should navigate to room info edit view', async() => {
await element(by.id('room-header')).tap();
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(5000);
await element(by.id('room-actions-info')).tap();
await waitFor(element(by.id('room-info-view'))).toExist().withTimeout(2000);
});
it('should delete team', async() => {
await element(by.id('room-info-view-edit-button')).tap();
await element(by.id('room-info-edit-view-list')).swipe('up', 'fast', 0.5);
await element(by.id('room-info-edit-view-delete')).tap();
await waitFor(element(by.text('Yes, delete it!'))).toExist().withTimeout(5000);
await element(by.text('Yes, delete it!')).tap();
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(10000);
await waitFor(element(by.id(`rooms-list-view-item-${ teamName }`))).toBeNotVisible().withTimeout(60000);
});
});
});

View File

@ -0,0 +1,296 @@
const {
device, expect, element, by, waitFor
} = require('detox');
const data = require('../../data');
const { navigateToLogin, login, tapBack, sleep, searchRoom } = require('../../helpers/app');
async function navigateToRoom(roomName) {
await searchRoom(`${ roomName }`);
await element(by.id(`rooms-list-view-item-${ roomName }`)).tap();
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
}
async function openActionSheet(username) {
await waitFor(element(by.id(`room-members-view-item-${ username }`))).toExist().withTimeout(5000);
await element(by.id(`room-members-view-item-${ username }`)).tap();
await sleep(300);
await expect(element(by.id('action-sheet'))).toExist();
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
}
async function navigateToRoomActions() {
await waitFor(element(by.id('room-view'))).toExist().withTimeout(2000);
await element(by.id('room-header')).tap();
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(5000);
}
async function backToActions() {
await tapBack();
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(2000);
}
async function closeActionSheet() {
await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.6);
}
async function waitForToast() {
await sleep(1000);
}
describe('Team', () => {
const team = data.teams.private.name;
const user = data.users.alternate;
const room = `private${ data.random }`;
const existingRoom = data.groups.private.name;
before(async() => {
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
await navigateToLogin();
await login(data.users.regular.username, data.users.regular.password);
await navigateToRoom(team);
});
describe('Team Room', async() => {
describe('Team Header', async() => {
it('should have actions button ', async() => {
await expect(element(by.id('room-header'))).toExist();
});
it('should have team channels button ', async() => {
await expect(element(by.id('room-view-header-team-channels'))).toExist();
});
it('should have threads button ', async() => {
await expect(element(by.id('room-view-header-threads'))).toExist();
});
it('should have threads button ', async() => {
await expect(element(by.id('room-view-search'))).toExist();
});
});
describe('Team Header Usage', async() => {
it('should navigate to team channels view', async() => {
await element(by.id('room-view-header-team-channels')).tap();
await waitFor(element(by.id('team-channels-view'))).toExist().withTimeout(5000);
});
})
describe('Team Channels Header', async() => {
it('should have actions button ', async() => {
await expect(element(by.id('room-header'))).toExist();
});
it('should have team channels button ', async() => {
await expect(element(by.id('team-channels-view-create'))).toExist();
});
it('should have threads button ', async() => {
await expect(element(by.id('team-channels-view-search'))).toExist();
});
});
describe('Team Channels Header Usage', async() => {
it('should navigate to add team channels view', async() => {
await element(by.id('team-channels-view-create')).tap();
await waitFor(element(by.id('add-channel-team-view'))).toExist().withTimeout(5000);
});
it('should have create new button', async() => {
await waitFor(element(by.id('add-channel-team-view-create-channel'))).toExist().withTimeout(5000);
});
it('should add existing button', async() => {
await waitFor(element(by.id('add-channel-team-view-add-existing'))).toExist().withTimeout(5000);
});
})
describe('Channels', async() => {
it('should create new channel for team', async() => {
await element(by.id('add-channel-team-view-create-channel')).tap();
await element(by.id('select-users-view-search')).replaceText('rocket.cat');
await element(by.id('select-users-view-item-rocket.cat')).tap();
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeVisible().withTimeout(10000);
await element(by.id('selected-users-view-submit')).tap();
await waitFor(element(by.id('create-channel-view'))).toExist().withTimeout(10000);
await element(by.id('create-channel-name')).replaceText('');
await element(by.id('create-channel-name')).typeText(room);
await element(by.id('create-channel-submit')).tap();
await waitFor(element(by.id('room-view'))).toExist().withTimeout(20000);
await expect(element(by.id('room-view'))).toExist();
await expect(element(by.id('room-view-header-team-channels'))).toExist();
await element(by.id('room-view-header-team-channels')).tap();
await waitFor(element(by.id('team-channels-view'))).toExist().withTimeout(5000);
await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(6000);
await expect(element(by.id(`rooms-list-view-item-${ room }`))).toExist();
await element(by.id(`rooms-list-view-item-${ room }`)).tap();
await waitFor(element(by.id(`room-view-title-${ room }`))).toExist().withTimeout(60000);
await expect(element(by.id(`room-view-title-${ room }`))).toExist();
await expect(element(by.id('room-view-header-team-channels'))).toExist();
await expect(element(by.id('room-view-header-threads'))).toExist();
await expect(element(by.id('room-view-search'))).toExist();
await tapBack();
});
it('should add existing channel to team', async() => {
await element(by.id('team-channels-view-create')).tap();
await waitFor(element(by.id('add-channel-team-view'))).toExist().withTimeout(5000);
await element(by.id('add-channel-team-view-add-existing')).tap();
await waitFor(element(by.id('add-existing-channel-view'))).toExist().withTimeout(60000)
await expect(element(by.id(`add-existing-channel-view-item-${ existingRoom }`))).toExist();
await element(by.id(`add-existing-channel-view-item-${ existingRoom }`)).tap();
await waitFor(element(by.id('add-existing-channel-view-submit'))).toExist().withTimeout(6000);
await element(by.id('add-existing-channel-view-submit')).tap();
await waitFor(element(by.id('room-view'))).toExist().withTimeout(20000);
await expect(element(by.id('room-view'))).toExist();
await expect(element(by.id('room-view-header-team-channels'))).toExist();
await element(by.id('room-view-header-team-channels')).tap();
await waitFor(element(by.id(`rooms-list-view-item-${ existingRoom }`))).toExist().withTimeout(10000);
});
it('should activate/deactivate auto-join to channel', async() => {
await element(by.id(`rooms-list-view-item-${ existingRoom }`)).atIndex(0).longPress();
await waitFor(element(by.id('action-sheet-auto-join'))).toBeVisible().withTimeout(5000);
await waitFor(element(by.id('auto-join-unchecked'))).toBeVisible().withTimeout(5000);
await waitFor(element(by.id('action-sheet-remove-from-team'))).toBeVisible().withTimeout(5000);
await waitFor(element(by.id('action-sheet-delete'))).toBeVisible().withTimeout(5000);
await element(by.id('auto-join-unchecked')).tap();
await waitFor(element(by.id('auto-join-tag'))).toBeVisible().withTimeout(5000);
await element(by.id(`rooms-list-view-item-${ existingRoom }`)).atIndex(0).longPress();
await waitFor(element(by.id('auto-join-checked'))).toBeVisible().withTimeout(5000);
await element(by.id('auto-join-checked')).tap();
await waitFor(element(by.id('auto-join-tag'))).toBeNotVisible().withTimeout(5000);
await waitFor(element(by.id(`rooms-list-view-item-${ existingRoom }`))).toExist().withTimeout(6000);
});
})
describe('Team actions', () => {
before(async() => {
await tapBack();
await navigateToRoomActions();
});
it('should add users to the team', async() => {
await waitFor(element(by.id('room-actions-add-user'))).toExist().withTimeout(10000);
await element(by.id('room-actions-add-user')).tap();
const rocketCat = 'rocket.cat';
await element(by.id('select-users-view-search')).replaceText('rocket.cat');
await waitFor(element(by.id(`select-users-view-item-${ rocketCat }`))).toExist().withTimeout(10000);
await element(by.id(`select-users-view-item-${ rocketCat }`)).tap();
await waitFor(element(by.id(`selected-user-${ rocketCat }`))).toExist().withTimeout(5000);
await waitFor(element(by.id('select-users-view-search'))).toExist().withTimeout(4000);
await element(by.id('select-users-view-search')).tap();
await element(by.id('select-users-view-search')).replaceText(user.username);
await waitFor(element(by.id(`select-users-view-item-${ user.username }`))).toExist().withTimeout(10000);
await element(by.id(`select-users-view-item-${ user.username }`)).tap();
await waitFor(element(by.id(`selected-user-${ user.username }`))).toExist().withTimeout(5000);
await element(by.id('selected-users-view-submit')).tap();
await sleep(300);
await waitFor(element(by.id('room-actions-members'))).toExist().withTimeout(10000);
await element(by.id('room-actions-members')).tap();
await element(by.id('room-members-view-toggle-status')).tap();
await waitFor(element(by.id(`room-members-view-item-${ user.username }`))).toExist().withTimeout(60000);
await backToActions();
});
it('should try to leave to leave team and raise alert', async() => {
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
await waitFor(element(by.id('room-actions-leave-channel'))).toExist().withTimeout(2000);
await element(by.id('room-actions-leave-channel')).tap();
await waitFor(element(by.id('select-list-view'))).toExist().withTimeout(2000);
await waitFor(element(by.id(`select-list-view-item-${room}`))).toExist().withTimeout(2000);
await waitFor(element(by.id(`select-list-view-item-${existingRoom}`))).toExist().withTimeout(2000);
await element(by.id(`select-list-view-item-${room}`)).tap();
await waitFor(element(by.label('You are the last owner of this channel. Once you leave the team, the channel will be kept inside the team but you will be managing it from outside.'))).toExist().withTimeout(2000);
await element(by.text('OK')).tap();
await waitFor(element(by.id('select-list-view-submit'))).toExist().withTimeout(2000);
await element(by.id('select-list-view-submit')).tap();
await waitFor(element(by.text('Last owner cannot be removed'))).toExist().withTimeout(8000);
await element(by.text('OK')).tap();
await tapBack();
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(2000);
});
describe('Room Members', async() => {
before(async() => {
await element(by.id('room-actions-members')).tap();
await waitFor(element(by.id('room-members-view'))).toExist().withTimeout(2000);
});
it('should show all users', async() => {
await element(by.id('room-members-view-toggle-status')).tap();
await waitFor(element(by.id(`room-members-view-item-${ user.username }`))).toExist().withTimeout(60000);
});
it('should filter user', async() => {
await waitFor(element(by.id(`room-members-view-item-${ user.username }`))).toExist().withTimeout(60000);
await element(by.id('room-members-view-search')).replaceText('rocket');
await waitFor(element(by.id(`room-members-view-item-${ user.username }`))).toBeNotVisible().withTimeout(60000);
await element(by.id('room-members-view-search')).tap();
await element(by.id('room-members-view-search')).clearText('');
await waitFor(element(by.id(`room-members-view-item-${ user.username }`))).toExist().withTimeout(60000);
});
it('should remove member from team', async() => {
await openActionSheet('rocket.cat');
await element(by.id('action-sheet-remove-from-team')).tap();
await waitFor(element(by.id('select-list-view'))).toExist().withTimeout(5000);
await waitFor(element(by.id(`select-list-view-item-${ room }`))).toExist().withTimeout(5000);
await element(by.id(`select-list-view-item-${ room }`)).tap();
await waitFor(element(by.id(`${ room }-checked`))).toExist().withTimeout(5000);
await element(by.id(`select-list-view-item-${ room }`)).tap();
await waitFor(element(by.id(`${ room }-unchecked`))).toExist().withTimeout(5000);
await element(by.id('select-list-view-submit')).tap();
await waitFor(element(by.id('room-members-view-item-rocket.cat'))).toBeNotVisible().withTimeout(60000);
});
it('should set member as owner', async() => {
await openActionSheet(user.username);
await element(by.id('action-sheet-set-owner')).tap();
await waitForToast();
await openActionSheet(user.username);
await waitFor(element(by.id('action-sheet-set-owner-checked'))).toBeVisible().withTimeout(6000);
await closeActionSheet();
});
it('should leave team', async() => {
await tapBack();
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
await waitFor(element(by.id('room-actions-leave-channel'))).toExist().withTimeout(2000);
await element(by.id('room-actions-leave-channel')).tap();
await waitFor(element(by.id('select-list-view'))).toExist().withTimeout(2000);
await waitFor(element(by.id(`select-list-view-item-${room}`))).toExist().withTimeout(2000);
await waitFor(element(by.id(`select-list-view-item-${existingRoom}`))).toExist().withTimeout(2000);
await element(by.id(`select-list-view-item-${room}`)).tap();
await waitFor(element(by.label('You are the last owner of this channel. Once you leave the team, the channel will be kept inside the team but you will be managing it from outside.'))).toExist().withTimeout(2000);
await element(by.text('OK')).tap();
await waitFor(element(by.id('select-list-view-submit'))).toExist().withTimeout(2000);
await element(by.id('select-list-view-submit')).tap();
await waitFor(element(by.text(`You were removed from ${ team }`))).toExist().withTimeout(8000);
await element(by.text('OK')).tap();
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(5000);
});
});
});
});
});

View File

@ -0,0 +1,89 @@
const {
device, expect, element, by, waitFor
} = require('detox');
const data = require('../../data');
const { navigateToLogin, login, tapBack, searchRoom, sleep } = require('../../helpers/app');
const toBeConverted = `to-be-converted-${ data.random }`;
const toBeMoved = `to-be-moved-${ data.random }`;
const createChannel = async(room) => {
await element(by.id('rooms-list-view-create-channel')).tap();
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(5000);
await element(by.id('new-message-view-create-channel')).tap();
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(5000);
await element(by.id('selected-users-view-submit')).tap();
await waitFor(element(by.id('create-channel-view'))).toExist().withTimeout(10000);
await element(by.id('create-channel-name')).typeText(room);
await element(by.id('create-channel-submit')).tap();
await waitFor(element(by.id('room-view'))).toExist().withTimeout(60000);
await waitFor(element(by.id(`room-view-title-${ room }`))).toExist().withTimeout(60000);
await tapBack();
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(60000);
}
async function navigateToRoom(room) {
await searchRoom(`${ room }`);
await element(by.id(`rooms-list-view-item-${ room }`)).tap();
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
}
async function navigateToRoomActions(room) {
await navigateToRoom(room);
await element(by.id('room-header')).tap();
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(5000);
}
describe('Move/Convert Team', () => {
before(async() => {
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
await navigateToLogin();
await login(data.users.regular.username, data.users.regular.password);
});
describe('Convert', async() => {
before(async() => {
await createChannel(toBeConverted);
});
it('should convert channel to a team', async() => {
await navigateToRoomActions(toBeConverted);
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
await waitFor(element(by.id('room-actions-convert-to-team'))).toExist().withTimeout(2000);
await element(by.id('room-actions-convert-to-team')).tap();
await waitFor(element(by.label('This can\'t be undone. Once you convert a channel to a team, you can not turn it back to a channel.'))).toExist().withTimeout(2000);
await element(by.text('Convert')).tap();
await waitFor(element(by.id('room-view'))).toExist().withTimeout(20000);
await waitFor(element(by.id(`room-view-title-${ toBeConverted }`))).toExist().withTimeout(6000);
});
after(async() => {
await tapBack();
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
})
});
describe('Move', async() => {
before(async() => {
await createChannel(toBeMoved);
});
it('should move channel to a team', async() => {
await navigateToRoomActions(toBeMoved);
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
await waitFor(element(by.id('room-actions-move-to-team'))).toExist().withTimeout(2000);
await element(by.id('room-actions-move-to-team')).tap();
await waitFor(element(by.id('select-list-view'))).toExist().withTimeout(2000);
await element(by.id('select-list-view-submit')).tap();
await sleep(2000);
await waitFor(element(by.id('select-list-view'))).toExist().withTimeout(2000);
await waitFor(element(by.id(`select-list-view-item-${toBeConverted}`))).toExist().withTimeout(2000);
await element(by.id(`select-list-view-item-${toBeConverted}`)).tap();
await element(by.id('select-list-view-submit')).atIndex(0).tap();
await waitFor(element(by.label('After reading the previous intructions about this behavior, do you still want to move this channel to the selected team?'))).toExist().withTimeout(2000);
await element(by.text('Yes, move it!')).tap();
await waitFor(element(by.id('room-view-header-team-channels'))).toExist().withTimeout(10000);
});
})
});