From 047d4e5889b497d219e8658ed3f53b75cbb7818f Mon Sep 17 00:00:00 2001 From: Anant Bhasin Date: Fri, 16 Jul 2021 02:29:16 +0530 Subject: [PATCH] Lint fix --- e2e/helpers/app.js | 105 +++++++++--------- e2e/helpers/platformFunctions.js | 81 +++++++------- e2e/helpers/platformTypes.js | 18 +-- e2e/tests/assorted/01-e2eencryption.spec.js | 7 +- e2e/tests/assorted/03-profile.spec.js | 7 +- e2e/tests/assorted/04-setting.spec.js | 2 +- e2e/tests/assorted/05-joinpublicroom.spec.js | 2 +- .../assorted/08-joinprotectedroom.spec.js | 4 +- e2e/tests/assorted/10-deleteserver.spec.js | 5 +- e2e/tests/assorted/11-deeplinking.spec.js | 18 +-- e2e/tests/assorted/12-i18n.spec.js | 10 +- e2e/tests/onboarding/06-roomslist.spec.js | 4 +- .../onboarding/07-server-history.spec.js | 4 +- e2e/tests/room/01-createroom.spec.js | 4 +- e2e/tests/room/02-room.spec.js | 2 +- e2e/tests/room/03-roomactions.spec.js | 12 +- e2e/tests/room/04-discussion.spec.js | 4 +- e2e/tests/room/07-markasunread.spec.js | 2 +- 18 files changed, 155 insertions(+), 136 deletions(-) diff --git a/e2e/helpers/app.js b/e2e/helpers/app.js index 4a6b8bc66..11d9f3f19 100644 --- a/e2e/helpers/app.js +++ b/e2e/helpers/app.js @@ -38,7 +38,7 @@ async function login(username, password) { async function logout() { const deviceType = device.getPlatform(); - const { scrollViewType } = platformTypes[deviceType]; + const { scrollViewType } = platformTypes[deviceType]; await element(by.id('rooms-list-view-sidebar')).tap(); await waitFor(element(by.id('sidebar-view'))).toBeVisible().withTimeout(2000); await waitFor(element(by.id('sidebar-settings'))).toBeVisible().withTimeout(2000); @@ -60,48 +60,48 @@ async function mockMessage(message, isThread = false) { await element(by.id(input)).typeText(`${ data.random }${ message }`); await element(by.id('messagebox-send-message')).tap(); await waitFor(element(by.text(`${ data.random }${ message }`))).toExist().withTimeout(60000); - await expect(element(by.text(`${ data.random }${ message }`))).toExist(); - await element(by.text(`${ data.random }${ message }`)).atIndex(0).tap(); -}; - -async function starMessage(message){ - const messageLabel = `${ data.random }${ message }` - await element(by.text(messageLabel)).atIndex(0).longPress(); - await expect(element(by.id('action-sheet'))).toExist(); - await expect(element(by.id('action-sheet-handle'))).toBeVisible(); - await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5); - await element(by.text('Star')).atIndex(0).tap(); - await waitFor(element(by.id('action-sheet'))).not.toExist().withTimeout(5000); -}; - -async function pinMessage(message){ - const messageLabel = `${ data.random }${ message }` - await waitFor(element(by.text(messageLabel)).atIndex(0)).toExist(); - await element(by.text(messageLabel)).atIndex(0).longPress(); - await expect(element(by.id('action-sheet'))).toExist(); - await expect(element(by.id('action-sheet-handle'))).toBeVisible(); - await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5); - await element(by.text('Pin')).atIndex(0).tap(); - await waitFor(element(by.id('action-sheet'))).not.toExist().withTimeout(5000); + await expect(element(by.text(`${ data.random }${ message }`))).toExist(); + await element(by.text(`${ data.random }${ message }`)).atIndex(0).tap(); } -async function dismissReviewNag(){ - const deviceType = device.getPlatform(); - const { alertButtonType } = platformTypes[deviceType]; - await waitFor(element(by.text('Are you enjoying this app?'))).toExist().withTimeout(60000); - await element(by.text('NO').and(by.type(alertButtonType))).tap(); // Tap `no` on ask for review alert +async function starMessage(message) { + const messageLabel = `${ data.random }${ message }`; + await element(by.text(messageLabel)).atIndex(0).longPress(); + await expect(element(by.id('action-sheet'))).toExist(); + await expect(element(by.id('action-sheet-handle'))).toBeVisible(); + await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5); + await element(by.text('Star')).atIndex(0).tap(); + await waitFor(element(by.id('action-sheet'))).not.toExist().withTimeout(5000); +} + +async function pinMessage(message) { + const messageLabel = `${ data.random }${ message }`; + await waitFor(element(by.text(messageLabel)).atIndex(0)).toExist(); + await element(by.text(messageLabel)).atIndex(0).longPress(); + await expect(element(by.id('action-sheet'))).toExist(); + await expect(element(by.id('action-sheet-handle'))).toBeVisible(); + await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5); + await element(by.text('Pin')).atIndex(0).tap(); + await waitFor(element(by.id('action-sheet'))).not.toExist().withTimeout(5000); +} + +async function dismissReviewNag() { + const deviceType = device.getPlatform(); + const { alertButtonType } = platformTypes[deviceType]; + await waitFor(element(by.text('Are you enjoying this app?'))).toExist().withTimeout(60000); + await element(by.text('NO').and(by.type(alertButtonType))).tap(); // Tap `no` on ask for review alert } async function mockMessageWithNag(message, isThread = false) { - let input = isThread ? 'messagebox-input-thread' : 'messagebox-input'; + const input = isThread ? 'messagebox-input-thread' : 'messagebox-input'; await element(by.id(input)).tap(); await element(by.id(input)).typeText(`${ data.random }${ message }`); await element(by.id('messagebox-send-message')).tap(); - await dismissReviewNag(); + await dismissReviewNag(); await waitFor(element(by.text(`${ data.random }${ message }`))).toExist().withTimeout(60000); - await expect(element(by.text(`${ data.random }${ message }`))).toExist(); - await element(by.text(`${ data.random }${ message }`)).atIndex(0).tap(); -}; + await expect(element(by.text(`${ data.random }${ message }`))).toExist(); + await element(by.text(`${ data.random }${ message }`)).atIndex(0).tap(); +} async function tapBack() { await element(by.id('header-back')).atIndex(0).tap(); @@ -145,25 +145,26 @@ const checkServer = async(server) => { }; async function closeKeyboard() { - if(device.getPlatform() === 'android') - await device.goBack(); + if (device.getPlatform() === 'android') { + await device.goBack(); + } } module.exports = { - navigateToWorkspace, - navigateToLogin, - navigateToRegister, - login, - logout, - mockMessage, - starMessage, - pinMessage, - dismissReviewNag, - tapBack, - sleep, - searchRoom, - tryTapping, - checkServer, - closeKeyboard, - mockMessageWithNag + navigateToWorkspace, + navigateToLogin, + navigateToRegister, + login, + logout, + mockMessage, + starMessage, + pinMessage, + dismissReviewNag, + tapBack, + sleep, + searchRoom, + tryTapping, + checkServer, + closeKeyboard, + mockMessageWithNag }; diff --git a/e2e/helpers/platformFunctions.js b/e2e/helpers/platformFunctions.js index eb54aa37b..cd3e4acff 100644 --- a/e2e/helpers/platformFunctions.js +++ b/e2e/helpers/platformFunctions.js @@ -5,51 +5,48 @@ const { sleep } = require('./app'); const defaultLaunchArgs = { permissions: { notifications: 'YES' } }; function runCommand(command) { - return new Promise((resolve, reject) => { - exec(command, (error, stdout, stderr) => { - if(error) - { - reject(new Error(`exec error: ${stderr}`)); - return; - } - resolve(); - }) - }); + return new Promise((resolve, reject) => { + exec(command, (error, stdout, stderr) => { + if (error) { + reject(new Error(`exec error: ${ stderr }`)); + return; + } + resolve(); + }); + }); } // The Spell Checker and the autofill service introduce additional flakiness, and appear over other elements. // So, we disable them before running the tests. -exports.prepareAndroid = async () => { - if(device.getPlatform() !== 'android') return; - await runCommand('adb shell settings put secure spell_checker_enabled 0'); - await runCommand('adb shell settings put secure autofill_service null'); -} +exports.prepareAndroid = async() => { + if (device.getPlatform() !== 'android') { + return; + } + await runCommand('adb shell settings put secure spell_checker_enabled 0'); + await runCommand('adb shell settings put secure autofill_service null'); +}; -exports.launchWithLanguage = async (language, countryCode="US", launchArgs=defaultLaunchArgs) => { - if(device.id === undefined) - { - await device.launchApp(launchArgs); - } - if(device.getPlatform() === 'android') - { - await runCommand('adb root'); - await runCommand(`adb shell "setprop persist.sys.locale ${language}-${countryCode}; setprop ctl.restart zygote"`); - await sleep(20000); - await device.launchApp(launchArgs); - } - else - { - const langLocale = typeof countryCode === 'string' ? `${language}-${countryCode}` : language; - await device.launchApp({ - ...launchArgs, - languageAndLocale: { - language: langLocale, - locale: langLocale - } - }); - } -} +exports.launchWithLanguage = async(language, countryCode = 'US', launchArgs = defaultLaunchArgs) => { + if (device.id === undefined) { + await device.launchApp(launchArgs); + } + if (device.getPlatform() === 'android') { + await runCommand('adb root'); + await runCommand(`adb shell "setprop persist.sys.locale ${ language }-${ countryCode }; setprop ctl.restart zygote"`); + await sleep(20000); + await device.launchApp(launchArgs); + } else { + const langLocale = typeof countryCode === 'string' ? `${ language }-${ countryCode }` : language; + await device.launchApp({ + ...launchArgs, + languageAndLocale: { + language: langLocale, + locale: langLocale + } + }); + } +}; -exports.closeKeyboardAndroid = async () => { - await device.pressBack(); // Android-only -} +exports.closeKeyboardAndroid = async() => { + await device.pressBack(); // Android-only +}; diff --git a/e2e/helpers/platformTypes.js b/e2e/helpers/platformTypes.js index 5a241843d..44ffb6b65 100644 --- a/e2e/helpers/platformTypes.js +++ b/e2e/helpers/platformTypes.js @@ -1,13 +1,13 @@ exports.android = { - //Android types - alertButtonType: 'android.widget.Button', - scrollViewType: 'android.widget.ScrollView', - textInputType: 'android.widget.EditText', + // Android types + alertButtonType: 'android.widget.Button', + scrollViewType: 'android.widget.ScrollView', + textInputType: 'android.widget.EditText' }; exports.ios = { - //iOS types - alertButtonType: '_UIAlertControllerActionView', - scrollViewType: 'UIScrollView', - textInputType: '_UIAlertControllerTextField' -}; \ No newline at end of file + // iOS types + alertButtonType: '_UIAlertControllerActionView', + scrollViewType: 'UIScrollView', + textInputType: '_UIAlertControllerTextField' +}; diff --git a/e2e/tests/assorted/01-e2eencryption.spec.js b/e2e/tests/assorted/01-e2eencryption.spec.js index ae8cb87b1..a82534bd7 100644 --- a/e2e/tests/assorted/01-e2eencryption.spec.js +++ b/e2e/tests/assorted/01-e2eencryption.spec.js @@ -20,7 +20,7 @@ const checkServer = async(server) => { const checkBanner = async() => { await waitFor(element(by.id('listheader-encryption').withDescendant(by.text('Save Your Encryption Password')))).toBeVisible().withTimeout(10000); -} +}; async function navigateToRoom(roomName) { await searchRoom(`${ roomName }`); @@ -46,7 +46,8 @@ async function navigateSecurityPrivacy() { describe('E2E Encryption', () => { const room = `encrypted${ data.random }`; const newPassword = 'abc'; - let alertButtonType, scrollViewType; + let alertButtonType; + let scrollViewType; before(async() => { await device.launchApp({ permissions: { notifications: 'YES' }, delete: true }); @@ -206,7 +207,7 @@ describe('E2E Encryption', () => { await waitFor(element(by.id('login-view'))).toBeVisible().withTimeout(2000); await login(testuser.username, testuser.password); await waitFor(element(by.id('listheader-encryption').withDescendant(by.text('Save Your Encryption Password')))).toBeVisible().withTimeout(2000); - }) + }); }); }); diff --git a/e2e/tests/assorted/03-profile.spec.js b/e2e/tests/assorted/03-profile.spec.js index 955911e63..dab54e7ee 100644 --- a/e2e/tests/assorted/03-profile.spec.js +++ b/e2e/tests/assorted/03-profile.spec.js @@ -17,7 +17,8 @@ async function waitForToast() { } describe('Profile screen', () => { - let textInputType, scrollViewType; + let textInputType; + let scrollViewType; before(async() => { await device.launchApp({ permissions: { notifications: 'YES' }, delete: true }); @@ -94,7 +95,9 @@ describe('Profile screen', () => { await element(by.id('profile-view-submit')).tap(); await element(by.type(textInputType)).typeText(`${ profileChangeUser.password }\n`); // TODO: Check if this is fine on iOS - if(device.getPlatform() === 'android') await element(by.text('SAVE')).tap(); + if (device.getPlatform() === 'android') { + await element(by.text('SAVE')).tap(); + } await waitForToast(); }); diff --git a/e2e/tests/assorted/04-setting.spec.js b/e2e/tests/assorted/04-setting.spec.js index 19822087a..05519d18f 100644 --- a/e2e/tests/assorted/04-setting.spec.js +++ b/e2e/tests/assorted/04-setting.spec.js @@ -70,7 +70,7 @@ describe('Settings screen', () => { await waitFor(element(by.id('settings-view'))).toBeVisible().withTimeout(2000); await element(by.id('settings-view-clear-cache')).tap(); await waitFor(element(by.text('This will clear all your offline data.'))).toExist().withTimeout(2000); - await element(by.text('Clear').and(by.type(alertButtonType))).tap(); + await element(by.text('Clear').and(by.type(alertButtonType))).tap(); await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(5000); await waitFor(element(by.id(`rooms-list-view-item-${ data.groups.private.name }`))).toExist().withTimeout(10000); }); diff --git a/e2e/tests/assorted/05-joinpublicroom.spec.js b/e2e/tests/assorted/05-joinpublicroom.spec.js index 01d0815b4..0bdaa731a 100644 --- a/e2e/tests/assorted/05-joinpublicroom.spec.js +++ b/e2e/tests/assorted/05-joinpublicroom.spec.js @@ -34,7 +34,7 @@ describe('Join public room', () => { describe('Render', () => { it('should have room screen', async() => { await expect(element(by.id('room-view'))).toBeVisible(); - }); + }); // it('should have messages list', async() => { // await expect(element(by.id('room-view-messages'))).toBeVisible(); diff --git a/e2e/tests/assorted/08-joinprotectedroom.spec.js b/e2e/tests/assorted/08-joinprotectedroom.spec.js index 81f304928..58ba3c3fc 100644 --- a/e2e/tests/assorted/08-joinprotectedroom.spec.js +++ b/e2e/tests/assorted/08-joinprotectedroom.spec.js @@ -1,5 +1,7 @@ const data = require('../../data'); -const { navigateToLogin, login, mockMessage, searchRoom } = require('../../helpers/app'); +const { + navigateToLogin, login, mockMessage, searchRoom +} = require('../../helpers/app'); const { prepareAndroid } = require('../../helpers/platformFunctions'); const testuser = data.users.regular; diff --git a/e2e/tests/assorted/10-deleteserver.spec.js b/e2e/tests/assorted/10-deleteserver.spec.js index 9224aafd8..4712bacf1 100644 --- a/e2e/tests/assorted/10-deleteserver.spec.js +++ b/e2e/tests/assorted/10-deleteserver.spec.js @@ -7,7 +7,8 @@ const platformTypes = require('../../helpers/platformTypes'); const { prepareAndroid } = require('../../helpers/platformFunctions'); describe('Delete server', () => { - let scrollViewType, alertButtonType; + let scrollViewType; + let alertButtonType; before(async() => { await device.launchApp({ permissions: { notifications: 'YES' }, delete: true }); await prepareAndroid(); @@ -48,7 +49,7 @@ describe('Delete server', () => { await element(by.id('rooms-list-header-server-dropdown-button')).tap(); await waitFor(element(by.id('rooms-list-header-server-dropdown'))).toBeVisible().withTimeout(5000); await element(by.id(`rooms-list-header-server-${ data.server }`)).longPress(1500); - await element(by.text('Delete').and(by.type(alertButtonType))).tap(); + await element(by.text('Delete').and(by.type(alertButtonType))).tap(); await element(by.id('rooms-list-header-server-dropdown-button')).tap(); await waitFor(element(by.id('rooms-list-header-server-dropdown'))).toBeVisible().withTimeout(5000); await waitFor(element(by.id(`rooms-list-header-server-${ data.server }`))).toBeNotVisible().withTimeout(10000); diff --git a/e2e/tests/assorted/11-deeplinking.spec.js b/e2e/tests/assorted/11-deeplinking.spec.js index dda7e4be1..23aa4a5b2 100644 --- a/e2e/tests/assorted/11-deeplinking.spec.js +++ b/e2e/tests/assorted/11-deeplinking.spec.js @@ -9,7 +9,7 @@ const DEEPLINK_METHODS = { AUTH: 'auth', ROOM: 'room' }; let amp = '&'; const getDeepLink = (method, server, params) => { - const deeplink = `rocketchat://${ method }?host=${ server.replace(/^(http:\/\/|https:\/\/)/, '') }${amp}${params}`; + const deeplink = `rocketchat://${ method }?host=${ server.replace(/^(http:\/\/|https:\/\/)/, '') }${ amp }${ params }`; console.log(`Deeplinking to: ${ deeplink }`); return deeplink; }; @@ -17,11 +17,13 @@ const getDeepLink = (method, server, params) => { describe('Deep linking', () => { let userId; let authToken; + let scrollViewType; + before(async() => { const loginResult = await login(data.users.regular.username, data.users.regular.password); ({ userId, authToken } = loginResult); const deviceType = device.getPlatform(); - amp = deviceType == 'android' ? '\\&' : '&'; + amp = deviceType === 'android' ? '\\&' : '&'; ({ scrollViewType } = platformTypes[deviceType]); }); @@ -30,7 +32,7 @@ describe('Deep linking', () => { await device.launchApp({ permissions: { notifications: 'YES' }, delete: true, - url: getDeepLink(DEEPLINK_METHODS.AUTH, data.server, `userId=123${amp}token=abc`), + url: getDeepLink(DEEPLINK_METHODS.AUTH, data.server, `userId=123${ amp }token=abc`) }); await prepareAndroid(); await waitFor(element(by.text('You\'ve been logged out by the server. Please log in again.'))).toExist().withTimeout(10000); // TODO: we need to improve this message @@ -40,7 +42,7 @@ describe('Deep linking', () => { await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, - url: getDeepLink(DEEPLINK_METHODS.AUTH, data.server, `userId=${ userId }${amp}token=${ authToken }${amp}path=group/${ data.groups.private.name }`), + url: getDeepLink(DEEPLINK_METHODS.AUTH, data.server, `userId=${ userId }${ amp }token=${ authToken }${ amp }path=group/${ data.groups.private.name }`) }); await waitFor(element(by.id(`room-view-title-${ data.groups.private.name }`))).toExist().withTimeout(30000); await tapBack(); @@ -74,7 +76,7 @@ describe('Deep linking', () => { await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, - url: getDeepLink(DEEPLINK_METHODS.ROOM, data.server, `path=group/${ data.groups.private.name }`), + url: getDeepLink(DEEPLINK_METHODS.ROOM, data.server, `path=group/${ data.groups.private.name }`) }); await waitFor(element(by.id(`room-view-title-${ data.groups.private.name }`))).toExist().withTimeout(10000); @@ -85,7 +87,7 @@ describe('Deep linking', () => { await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, - url: getDeepLink(DEEPLINK_METHODS.ROOM, data.server, `rid=${ roomResult.data.group._id }`), + url: getDeepLink(DEEPLINK_METHODS.ROOM, data.server, `rid=${ roomResult.data.group._id }`) }); await waitFor(element(by.id(`room-view-title-${ data.groups.private.name }`))).toExist().withTimeout(15000); @@ -104,7 +106,7 @@ describe('Deep linking', () => { await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, - url: getDeepLink(DEEPLINK_METHODS.ROOM, data.server, `path=group/${ data.groups.private.name }`), + url: getDeepLink(DEEPLINK_METHODS.ROOM, data.server, `path=group/${ data.groups.private.name }`) }); await waitFor(element(by.id(`room-view-title-${ data.groups.private.name }`))).toExist().withTimeout(10000); @@ -114,7 +116,7 @@ describe('Deep linking', () => { await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, - url: getDeepLink(DEEPLINK_METHODS.ROOM, 'https://google.com'), + url: getDeepLink(DEEPLINK_METHODS.ROOM, 'https://google.com') }); await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000); diff --git a/e2e/tests/assorted/12-i18n.spec.js b/e2e/tests/assorted/12-i18n.spec.js index da154a54d..092ae046b 100644 --- a/e2e/tests/assorted/12-i18n.spec.js +++ b/e2e/tests/assorted/12-i18n.spec.js @@ -19,13 +19,15 @@ const navToLanguage = async() => { }; describe('i18n', () => { - before(async () => { + before(async() => { await prepareAndroid(); }); describe('OS language', () => { it('OS set to \'en\' and proper translate to \'en\'', async() => { - if(device.getPlatform() === "android") return; // Not run on android + if (device.getPlatform() === 'android') { + return; + } await device.launchApp({ ...defaultLaunchArgs, languageAndLocale: { @@ -40,7 +42,9 @@ describe('i18n', () => { }); it('OS set to unavailable language and fallback to \'en\'', async() => { - if(device.getPlatform() === "android") return; // Not run on android + if (device.getPlatform() === 'android') { + return; + } await device.launchApp({ ...defaultLaunchArgs, languageAndLocale: { diff --git a/e2e/tests/onboarding/06-roomslist.spec.js b/e2e/tests/onboarding/06-roomslist.spec.js index 6d0b3e22d..6f0b28428 100644 --- a/e2e/tests/onboarding/06-roomslist.spec.js +++ b/e2e/tests/onboarding/06-roomslist.spec.js @@ -1,7 +1,9 @@ const { device, expect, element, by, waitFor } = require('detox'); -const { login, navigateToLogin, logout, tapBack, searchRoom } = require('../../helpers/app'); +const { + login, navigateToLogin, logout, tapBack, searchRoom +} = require('../../helpers/app'); const { prepareAndroid } = require('../../helpers/platformFunctions'); const data = require('../../data'); diff --git a/e2e/tests/onboarding/07-server-history.spec.js b/e2e/tests/onboarding/07-server-history.spec.js index 1e24e4d48..99bca8b16 100644 --- a/e2e/tests/onboarding/07-server-history.spec.js +++ b/e2e/tests/onboarding/07-server-history.spec.js @@ -1,7 +1,9 @@ const { device, expect, element, by, waitFor } = require('detox'); -const { login, navigateToLogin, logout, tapBack } = require('../../helpers/app'); +const { + login, navigateToLogin, logout, tapBack +} = require('../../helpers/app'); const { prepareAndroid } = require('../../helpers/platformFunctions'); const data = require('../../data'); diff --git a/e2e/tests/room/01-createroom.spec.js b/e2e/tests/room/01-createroom.spec.js index b5c634967..5de53e7b8 100644 --- a/e2e/tests/room/01-createroom.spec.js +++ b/e2e/tests/room/01-createroom.spec.js @@ -1,5 +1,7 @@ const data = require('../../data'); -const { tapBack, navigateToLogin, login, tryTapping } = require('../../helpers/app'); +const { + tapBack, navigateToLogin, login, tryTapping +} = require('../../helpers/app'); const { prepareAndroid } = require('../../helpers/platformFunctions'); diff --git a/e2e/tests/room/02-room.spec.js b/e2e/tests/room/02-room.spec.js index 6255c0036..115ba5b03 100644 --- a/e2e/tests/room/02-room.spec.js +++ b/e2e/tests/room/02-room.spec.js @@ -187,7 +187,7 @@ describe('Room screen', () => { it('should star message', async() => { await starMessage('message'); - await sleep(1000); //https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/2324 + await sleep(1000); // https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/2324 await element(by.text(`${ data.random }message`)).atIndex(0).longPress(); await expect(element(by.id('action-sheet'))).toExist(); await expect(element(by.id('action-sheet-handle'))).toBeVisible(); diff --git a/e2e/tests/room/03-roomactions.spec.js b/e2e/tests/room/03-roomactions.spec.js index 862ca7447..16d364aa0 100644 --- a/e2e/tests/room/03-roomactions.spec.js +++ b/e2e/tests/room/03-roomactions.spec.js @@ -1,7 +1,9 @@ const data = require('../../data'); -const { navigateToLogin, login, tapBack, sleep, searchRoom, mockMessage, starMessage, pinMessage } = require('../../helpers/app'); +const { + navigateToLogin, login, tapBack, sleep, searchRoom, mockMessage, starMessage, pinMessage +} = require('../../helpers/app'); const { prepareAndroid } = require('../../helpers/platformFunctions'); -const { sendMessage } = require('../../helpers/data_setup') +const { sendMessage } = require('../../helpers/data_setup'); const platformTypes = require('../../helpers/platformTypes'); @@ -213,14 +215,14 @@ describe('Room actions screen', () => { await element(by.id('room-header')).tap(); await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(5000); - //Go to starred messages + // Go to starred messages await element(by.id('room-actions-view')).swipe('up'); await waitFor(element(by.id('room-actions-starred'))).toExist(); await element(by.id('room-actions-starred')).tap(); await waitFor(element(by.id('starred-messages-view'))).toExist().withTimeout(2000); await waitFor(element(by.text(`${ data.random }messageToStar`).withAncestor(by.id('starred-messages-view')))).toExist().withTimeout(60000); - - //Unstar message + + // Unstar message await element(by.text(`${ data.random }messageToStar`)).atIndex(0).longPress(); await expect(element(by.id('action-sheet'))).toExist(); await expect(element(by.id('action-sheet-handle'))).toBeVisible(); diff --git a/e2e/tests/room/04-discussion.spec.js b/e2e/tests/room/04-discussion.spec.js index 25f03d410..cc8e8e2ad 100644 --- a/e2e/tests/room/04-discussion.spec.js +++ b/e2e/tests/room/04-discussion.spec.js @@ -15,7 +15,7 @@ const navigateToRoom = async() => { describe('Discussion', () => { let scrollViewType; - + before(async() => { await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true }); await prepareAndroid(); @@ -68,7 +68,7 @@ describe('Discussion', () => { const discussionName = `${ data.random }message`; await element(by.text(discussionName)).atIndex(0).longPress(); await waitFor(element(by.id('action-sheet'))).toExist().withTimeout(2000); - await element(by.text(`Start a Discussion`)).atIndex(0).tap(); + await element(by.text('Start a Discussion')).atIndex(0).tap(); await waitFor(element(by.id('create-discussion-view'))).toExist().withTimeout(2000); await element(by.id('create-discussion-submit')).tap(); await waitFor(element(by.id('room-view'))).toExist().withTimeout(10000); diff --git a/e2e/tests/room/07-markasunread.spec.js b/e2e/tests/room/07-markasunread.spec.js index 89a673d14..11d4fed19 100644 --- a/e2e/tests/room/07-markasunread.spec.js +++ b/e2e/tests/room/07-markasunread.spec.js @@ -3,7 +3,7 @@ const { navigateToLogin, login, searchRoom, sleep } = require('../../helpers/app'); const { prepareAndroid } = require('../../helpers/platformFunctions'); -const { sendMessage } = require('../../helpers/data_setup') +const { sendMessage } = require('../../helpers/data_setup'); async function navigateToRoom(user) { await searchRoom(`${ user }`);