mattermost-mobile/detox/e2e/support/ui/screen/channel_notification_preference.js
Joseph Baylon 0dfb776290
MM-30165 Detox/E2E: Add e2e tests for channel notification preference (#4949)
* Detox/E2E: Add e2e tests for channel notification preference

* Fixed unit snap files

* Moved e2e to notifications and updated formatting

* Added basic snapshot tests

* Update app/components/radio_button/radio_button_group.test.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/components/radio_button/radio_button_group.test.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/components/radio_button/radio_button_group.test.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/components/sidebars/settings/drawer_item.test.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/screens/channel_info/edit_channel/edit_channel.tsx

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/screens/channel_info/notification_preference/notification_preference.test.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/screens/channel_info/notification_preference/notification_preference.tsx

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/components/radio_button/radio_button_group.test.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Fix radio button group snap file

* Simplified element call

* Rename channel sidebar to main sidebar

* Rename drawer button files

* Update app/components/sidebars/settings/settings_sidebar.test.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/screens/channel_info/channel_info_row.test.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update comments

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-11-10 10:53:38 -07:00

42 lines
1.4 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ChannelInfoScreen} from '@support/ui/screen';
class ChannelNotificationPreferenceScreen {
testID = {
channelNotificationPreferenceScreen: 'channel_notification_preference.screen',
backButton: 'screen.back.button',
}
channelNotificationPreferenceScreen = element(by.id(this.testID.channelNotificationPreferenceScreen));
backButton = element(by.id(this.testID.backButton));
titleText = 'Mobile Notifications';
headerText = 'Send Notifications';
optionDefaultText = 'Global default';
optionAllText = 'For all activity';
optionMentionsText = 'Only mentions and direct messages';
optionNeverText = 'Never';
toBeVisible = async () => {
await expect(this.channelNotificationPreferenceScreen).toBeVisible();
return this.channelNotificationPreferenceScreen;
}
open = async () => {
// # Open channel notification preference screen
await ChannelInfoScreen.notificationPreferenceAction.tap();
return this.toBeVisible();
}
back = async () => {
await this.backButton.tap();
await expect(this.channelNotificationPreferenceScreen).not.toBeVisible();
}
}
const channelNotificationPreferenceScreen = new ChannelNotificationPreferenceScreen();
export default channelNotificationPreferenceScreen;