mattermost-mobile/detox/e2e/test/messaging/message_posting.e2e.js
Elias Nahum 0569479398
MM-28105 do not crash when in-app notification shows (#4915)
* MM-28105 do not crash when in-app notification shows

* Use index.tsx to register the notification screen

* Fix notification e2e and some import cleanup

* Update iOS notification json

* e2e: Show the add reaction screen before receiving a notification

* Update snapshots

* Patch react-native-notifications to prevent iOS crash when opening

* Apply TM4J id

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
2020-10-22 14:37:14 -03:00

38 lines
1.3 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// *******************************************************************
// - [#] indicates a test step (e.g. # Go to a screen)
// - [*] indicates an assertion (e.g. * Check the title)
// - Use element testID when selecting an element. Create one if none.
// *******************************************************************
import {logoutUser, toChannelScreen} from '@support/ui/screen';
import {Setup} from '@support/server_api';
describe('Messaging', () => {
beforeAll(async () => {
const {user} = await Setup.apiInit();
await toChannelScreen(user);
});
afterAll(async () => {
await logoutUser();
});
it('should post a message on tap to paper send button', async () => {
await expect(element(by.id('channel_screen'))).toBeVisible();
await expect(element(by.id('post_input'))).toExist();
await expect(element(by.id('send_button'))).not.toExist();
await element(by.id('post_input')).tap();
const text = Date.now().toString();
await element(by.id('post_input')).typeText(text);
await expect(element(by.id('send_button'))).toBeVisible();
await element(by.id('send_button')).tap();
await expect(element(by.text(text))).toExist();
});
});