From 29fb83ccfec2665d62da52084a9df4ac80715e16 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Mon, 14 Sep 2020 21:46:36 +0800 Subject: [PATCH] add e2e for MM-T3179 (#4807) --- detox/e2e/test/smoke_test/login_email.e2e.js | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 detox/e2e/test/smoke_test/login_email.e2e.js diff --git a/detox/e2e/test/smoke_test/login_email.e2e.js b/detox/e2e/test/smoke_test/login_email.e2e.js new file mode 100644 index 000000000..c39bad0f9 --- /dev/null +++ b/detox/e2e/test/smoke_test/login_email.e2e.js @@ -0,0 +1,41 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import {Setup} from '@support/server_api'; +import {serverUrl} from '@support/test_config'; + +describe('Smoke Tests', () => { + it('MM-T3179 Log in - Email / password', async () => { + const {user} = await Setup.apiInit(); + + // * Verify that it starts with the Select Server screen + await expect(element(by.id('select_server_screen'))).toBeVisible(); + + // # Type in the server URL + await element(by.id('server_url_input')).replaceText(serverUrl); + + // # Tap connect button + await element(by.text('Connect')).tap(); + + // # Verify that it goes into Login screen + await expect(element(by.id('login_screen'))).toBeVisible(); + + // # Type in username + await element(by.id('username_input')).replaceText(user.username); + + // # Tap anywhere to hide keyboard + await element(by.text('Mattermost')).tap(); + + // # Type in password + await element(by.id('password_input')).replaceText(user.password); + + // # Tap anywhere to hide keyboard + await element(by.text('Mattermost')).tap(); + + // # Tap "Sign in" button + await element(by.text('Sign in')).tap(); + + // * Verify that the user has successfully logged in by checking it redirects into the Channel screen + await expect(element(by.id('channel_screen'))).toBeVisible(); + }); +});