mattermost-mobile/detox/e2e/test/autocomplete/post_draft.e2e.js
Elias Nahum fbe2a9e575
MM-28539 Fix wrong participant count in GM info (#4887)
* Fix e2e flaky tests

* MM-28539 Fix wrong participant count in GM info

* Apply suggestions from code review

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

* Apply suggestions from code review

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update detox/e2e/test/autocomplete/edit_post.e2e.js

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
2020-10-19 10:13:30 -03:00

66 lines
2.7 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('Autocomplete', () => {
beforeAll(async () => {
const {user} = await Setup.apiInit();
await toChannelScreen(user);
});
beforeEach(async () => {
// # Select post draft
await expect(element(by.id('channel_screen'))).toBeVisible();
await element(by.id('post_input')).clearText();
await element(by.id('post_input')).tap();
});
afterAll(async () => {
await element(by.id('post_input')).clearText();
await logoutUser();
});
it('MM-T3392_1 should render emoji_suggestion component', async () => {
// # Type ":" to activate emoji suggestions
await expect(element(by.id('autocomplete.emoji_suggestion.list'))).not.toExist();
await element(by.id('post_input')).typeText(':');
// * Expect emoji suggestions to render
await expect(element(by.id('autocomplete.emoji_suggestion.list'))).toExist();
});
it('MM-T3392_2 should render at_mention component', async () => {
// # Type "@" to activate at mention autocomplete
await expect(element(by.id('autocomplete.at_mention.list'))).not.toExist();
await element(by.id('post_input')).typeText('@');
// * Expect at mention autocomplete to render
await expect(element(by.id('autocomplete.at_mention.list'))).toExist();
});
it('MM-T3392_3 should render channel_mention component', async () => {
// # Type "~" to activate channel mention autocomplete
await expect(element(by.id('autocomplete.channel_mention.list'))).not.toExist();
await element(by.id('post_input')).typeText('~');
// * Expect channel mention to render
await expect(element(by.id('autocomplete.channel_mention.list'))).toExist();
});
it('MM-T3392_4 should render slash_suggestion component', async () => {
// # Type "/" to activate slash command suggestions
await expect(element(by.id('autocomplete.slash_suggestion'))).not.toExist();
await element(by.id('post_input')).typeText('/');
// * Expect slash suggestions to render
await expect(element(by.id('autocomplete.slash_suggestion'))).toExist();
});
});