Skip to content

Commit

Permalink
MM-30431 Detox/E2E: Added e2e for MM-T3196, MM-T3210, MM-T3211, MM-T3…
Browse files Browse the repository at this point in the history
…262, MM-T3264 (mattermost#5313)

* MM-30431 Detox/E2E: Added e2e for MM-T3196, MM-T3210, MM-T3211, MM-T3262, MM-T3264

* Fix snap test
  • Loading branch information
Joseph Baylon authored Apr 13, 2021
1 parent 26f6880 commit 09593f7
Show file tree
Hide file tree
Showing 17 changed files with 511 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class ChannelItem extends PureComponent {
channelId: PropTypes.string.isRequired,
channel: PropTypes.object,
currentChannelId: PropTypes.string.isRequired,
displayName: PropTypes.string.isRequired,
displayName: PropTypes.string,
isArchived: PropTypes.bool,
isChannelMuted: PropTypes.bool,
isManualUnread: PropTypes.bool,
Expand Down
53 changes: 47 additions & 6 deletions app/screens/about/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default class About extends PureComponent {
id='about.teamEditiont0'
defaultMessage='Team Edition'
style={style.title}
testID='about.title'
/>
);

Expand All @@ -94,6 +95,7 @@ export default class About extends PureComponent {
id='about.teamEditionSt'
defaultMessage='All your team communication in one place, instantly searchable and accessible anywhere.'
style={style.subtitle}
testID='about.subtitle'
/>
);

Expand All @@ -103,11 +105,15 @@ export default class About extends PureComponent {
id='about.teamEditionLearn'
defaultMessage='Join the Mattermost community at '
style={style.learn}
testID='about.learn_more'
/>
<TouchableOpacity
onPress={this.handleAboutTeam}
>
<Text style={style.learnLink}>
<Text
style={style.learnLink}
testID='about.learn_more.url'
>
{Config.TeamEditionLearnURL}
</Text>
</TouchableOpacity>
Expand All @@ -121,6 +127,7 @@ export default class About extends PureComponent {
id='about.teamEditiont1'
defaultMessage='Enterprise Edition'
style={style.title}
testID='about.title'
/>
);

Expand All @@ -129,6 +136,7 @@ export default class About extends PureComponent {
id='about.enterpriseEditionSt'
defaultMessage='Modern communication from behind your firewall.'
style={style.subtitle}
testID='about.subtitle'
/>
);

Expand All @@ -138,11 +146,15 @@ export default class About extends PureComponent {
id='about.enterpriseEditionLearn'
defaultMessage='Learn more about Enterprise Edition at '
style={style.learn}
testID='about.learn_more'
/>
<TouchableOpacity
onPress={this.handleAboutEnterprise}
>
<Text style={style.learnLink}>
<Text
style={style.learnLink}
testID='about.learn_more.url'
>
{Config.EELearnURL}
</Text>
</TouchableOpacity>
Expand All @@ -155,6 +167,7 @@ export default class About extends PureComponent {
id='about.enterpriseEditione1'
defaultMessage='Enterprise Edition'
style={style.title}
testID='about.title'
/>
);

Expand All @@ -167,6 +180,7 @@ export default class About extends PureComponent {
values={{
company: license.Company,
}}
testID='about.licensee'
/>
</View>
);
Expand All @@ -183,6 +197,7 @@ export default class About extends PureComponent {
values={{
version: config.Version,
}}
testID='about.server_version'
/>
);
} else {
Expand All @@ -195,6 +210,7 @@ export default class About extends PureComponent {
version: config.Version,
number: config.BuildNumber,
}}
testID='about.server_version'
/>
);
}
Expand All @@ -207,6 +223,7 @@ export default class About extends PureComponent {
defaultMessage='Terms of Service'
style={style.noticeLink}
onPress={this.handleTermsOfService}
testID='about.terms_of_service'
/>
);
}
Expand All @@ -219,6 +236,7 @@ export default class About extends PureComponent {
defaultMessage='Privacy Policy'
style={style.noticeLink}
onPress={this.handlePrivacyPolicy}
testID='about.privacy_policy'
/>
);
}
Expand All @@ -236,22 +254,28 @@ export default class About extends PureComponent {
<SafeAreaView
edges={['left', 'right']}
style={style.container}
testID='about.screen'
>
<StatusBar/>
<ScrollView
style={style.scrollView}
contentContainerStyle={style.scrollViewContent}
testID='about.scroll_view'
>
<View style={style.logoContainer}>
<CompassIcon
name='mattermost'
color={theme.centerChannelColor}
size={120}
testID='about.logo'
/>
</View>
<View style={style.infoContainer}>
<View style={style.titleContainer}>
<Text style={style.title}>
<Text
style={style.title}
testID='about.site_name'
>
{`${config.SiteName} `}
</Text>
{title}
Expand All @@ -265,6 +289,7 @@ export default class About extends PureComponent {
version: DeviceInfo.getVersion(),
number: DeviceInfo.getBuildNumber(),
}}
testID='about.app_version'
/>
{serverVersion}
<FormattedText
Expand All @@ -274,6 +299,7 @@ export default class About extends PureComponent {
values={{
type: config.SQLDriverName,
}}
testID='about.database'
/>
{licensee}
{learnMore}
Expand All @@ -285,6 +311,7 @@ export default class About extends PureComponent {
values={{
site: this.props.config.SiteName,
}}
testID='about.powered_by'
/>
}
<FormattedText
Expand All @@ -294,6 +321,7 @@ export default class About extends PureComponent {
values={{
currentYear: new Date().getFullYear(),
}}
testID='about.copyright'
/>
<View style={style.tosPrivacyContainer}>
{termsOfService}
Expand Down Expand Up @@ -324,6 +352,7 @@ export default class About extends PureComponent {
/>
),
}}
testID='about.notice_text'
/>
</View>
</View>
Expand All @@ -333,8 +362,12 @@ export default class About extends PureComponent {
id='about.hash'
defaultMessage='Build Hash:'
style={style.footerTitleText}
testID='about.build_hash.title'
/>
<Text style={style.footerText}>
<Text
style={style.footerText}
testID='about.build_hash.value'
>
{config.BuildHash}
</Text>
</View>
Expand All @@ -343,8 +376,12 @@ export default class About extends PureComponent {
id='about.hashee'
defaultMessage='EE Build Hash:'
style={style.footerTitleText}
testID='about.build_hash_enterprise.title'
/>
<Text style={style.footerText}>
<Text
style={style.footerText}
testID='about.build_hash_enterprise.value'
>
{config.BuildHashEnterprise}
</Text>
</View>
Expand All @@ -354,8 +391,12 @@ export default class About extends PureComponent {
id='about.date'
defaultMessage='Build Date:'
style={style.footerTitleText}
testID='about.build_date.title'
/>
<Text style={style.footerText}>
<Text
style={style.footerText}
testID='about.build_date.value'
>
{config.BuildDate}
</Text>
</View>
Expand Down
3 changes: 3 additions & 0 deletions app/screens/settings/advanced_settings/advanced_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ class AdvancedSettings extends Component {
<SafeAreaView
edges={['left', 'right']}
style={style.container}
testID='advanced_settings.screen'
>
<StatusBar/>
<ScrollView
contentContainerStyle={style.wrapper}
alwaysBounceVertical={false}
testID='advanced_settings.scroll_view'
>
<View style={style.divider}/>
<SettingsItem
Expand All @@ -162,6 +164,7 @@ class AdvancedSettings extends Component {
showArrow={false}
rightComponent={this.renderCacheFileSize()}
theme={theme}
testID='advanced_settings.delete_documents_and_data.action'
/>
<View style={style.divider}/>
{this.renderSentryDebugOptions()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`user_profile should match snapshot 1`] = `
"flex": 1,
}
}
testID="user_profile.screen"
>
<Connect(StatusBar) />
<ScrollView
Expand All @@ -21,6 +22,7 @@ exports[`user_profile should match snapshot 1`] = `
"flex": 1,
}
}
testID="user_profile.scroll_view"
>
<View
style={
Expand Down Expand Up @@ -69,7 +71,9 @@ exports[`user_profile should match snapshot 1`] = `
}
}
>
<View>
<View
testID="user_profile.display_block"
>
<Text
style={
Object {
Expand All @@ -81,6 +85,7 @@ exports[`user_profile should match snapshot 1`] = `
"textTransform": "uppercase",
}
}
testID="user_profile.display_block.nickname.label"
/>
<Text
style={
Expand All @@ -89,6 +94,7 @@ exports[`user_profile should match snapshot 1`] = `
"fontSize": 15,
}
}
testID="user_profile.display_block.nickname.value"
>
nick
</Text>
Expand All @@ -110,6 +116,7 @@ exports[`user_profile should match snapshot 1`] = `
icon="send"
iconColor="rgba(0, 0, 0, 0.7)"
iconSize={24}
testID="user_profile.send_message.action"
textColor="#000"
textId="mobile.routes.user_profile.send_message"
theme={
Expand Down
26 changes: 22 additions & 4 deletions app/screens/user_profile/user_profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,19 @@ export default class UserProfile extends PureComponent {
}

return (
<View>
<Text style={style.header}>{label}</Text>
<Text style={style.text}>{user[property]}</Text>
<View testID='user_profile.display_block'>
<Text
style={style.header}
testID={`user_profile.display_block.${property}.label`}
>
{label}
</Text>
<Text
style={style.text}
testID={`user_profile.display_block.${property}.value`}
>
{user[property]}
</Text>
</View>
);
}
Expand All @@ -186,12 +196,14 @@ export default class UserProfile extends PureComponent {
id='mobile.routes.user_profile.local_time'
defaultMessage='LOCAL TIME'
style={style.header}
testID='user_profile.timezone_block.local_time.label'
/>
<Text style={style.text}>
<FormattedTime
timeZone={currentTimezone}
hour12={!militaryTime}
value={nowDate}
testID='user_profile.timezone_block.local_time.value'
/>
</Text>
</View>
Expand Down Expand Up @@ -287,6 +299,7 @@ export default class UserProfile extends PureComponent {
icon={l.icon}
theme={this.props.theme}
iconSize={l.iconSize}
testID='user_profile.additional_options.action'
/>
);
});
Expand Down Expand Up @@ -331,11 +344,15 @@ export default class UserProfile extends PureComponent {
}

return (
<SafeAreaView style={style.container}>
<SafeAreaView
style={style.container}
testID='user_profile.screen'
>
<StatusBar/>
<ScrollView
style={style.scrollView}
contentContainerStyle={style.contentContainer}
testID='user_profile.scroll_view'
>
<View style={style.top}>
<ProfilePicture
Expand All @@ -359,6 +376,7 @@ export default class UserProfile extends PureComponent {
iconSize={24}
textId={t('mobile.routes.user_profile.send_message')}
theme={theme}
testID='user_profile.send_message.action'
/>
{this.renderAdditionalOptions()}
</ScrollView>
Expand Down
7 changes: 5 additions & 2 deletions app/screens/user_profile/user_profile_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function createTouchableComponent(children, action) {
}

function userProfileRow(props) {
const {action, defaultMessage, detail, icon, textId, togglable, theme, iconSize, shouldRender = true} = props;
const {action, defaultMessage, detail, icon, textId, togglable, theme, iconSize, shouldRender = true, testID} = props;

if (!shouldRender) {
return null;
Expand All @@ -74,7 +74,10 @@ function userProfileRow(props) {
);

const RowComponent = (
<View style={style.wrapper}>
<View
style={style.wrapper}
testID={testID}
>
<View style={style.container}>
{iconComponent}
<FormattedText
Expand Down
Loading

0 comments on commit 09593f7

Please sign in to comment.