From 9c54e16ed7894a867ec038d9b04e7029d7b7a93c Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 14 May 2020 14:07:01 -0300 Subject: [PATCH] roominfo --- app/views/RoomInfoView/Channel.js | 4 ++++ app/views/RoomInfoView/Item.js | 4 ++-- e2e/08-room.spec.js | 2 +- e2e/09-roomactions.spec.js | 2 +- e2e/10-roominfo.spec.js | 29 +++++++++++++---------------- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/app/views/RoomInfoView/Channel.js b/app/views/RoomInfoView/Channel.js index 81ae70c61..bb65128b8 100644 --- a/app/views/RoomInfoView/Channel.js +++ b/app/views/RoomInfoView/Channel.js @@ -12,21 +12,25 @@ const Channel = ({ room, theme }) => { label={I18n.t('Description')} content={description || `__${ I18n.t('No_label_provided', { label: 'description' }) }__`} theme={theme} + testID='room-info-view-description' /> ); diff --git a/app/views/RoomInfoView/Item.js b/app/views/RoomInfoView/Item.js index d282ebd2f..1263fbc82 100644 --- a/app/views/RoomInfoView/Item.js +++ b/app/views/RoomInfoView/Item.js @@ -6,9 +6,9 @@ import styles from './styles'; import Markdown from '../../containers/markdown'; import { themes } from '../../constants/colors'; -const Item = ({ label, content, theme }) => ( +const Item = ({ label, content, theme, testID }) => ( content ? ( - + {label} { +describe.skip('Room screen', () => { const mainRoom = `private${ data.random }`; before(async() => { diff --git a/e2e/09-roomactions.spec.js b/e2e/09-roomactions.spec.js index 2f5821ba2..f75e1a8c7 100644 --- a/e2e/09-roomactions.spec.js +++ b/e2e/09-roomactions.spec.js @@ -38,7 +38,7 @@ async function backToRoomsList() { await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(2000); } -describe('Room actions screen', () => { +describe.skip('Room actions screen', () => { describe('Render', async() => { describe('Direct', async() => { before(async() => { diff --git a/e2e/10-roominfo.spec.js b/e2e/10-roominfo.spec.js index 4c420ea56..235c0be4d 100644 --- a/e2e/10-roominfo.spec.js +++ b/e2e/10-roominfo.spec.js @@ -34,7 +34,7 @@ async function waitForToast() { await sleep(5000); } -describe('Room info screen', () => { +describe.skip('Room info screen', () => { describe('Direct', async() => { before(async() => { await device.launchApp({ newInstance: true }); @@ -210,15 +210,14 @@ describe('Room info screen', () => { await tapBack(); await waitFor(element(by.id('room-info-view'))).toBeVisible().withTimeout(2000); await sleep(1000); - // await expect(element(by.id('room-info-view-description'))).toHaveLabel('new description'); - await expect(element(by.label('new description'))).toBeVisible(); - await waitFor(element(by.id('room-info-view-edit-button'))).toBeVisible().withTimeout(10000); - await element(by.id('room-info-view-edit-button')).tap(); - await waitFor(element(by.id('room-info-edit-view'))).toBeVisible().withTimeout(2000); + await expect(element(by.label('new description').withAncestor(by.id('room-info-view-description')))).toBeVisible(); }); it('should change room topic', async() => { await sleep(1000); + await waitFor(element(by.id('room-info-view-edit-button'))).toBeVisible().withTimeout(10000); + await element(by.id('room-info-view-edit-button')).tap(); + await waitFor(element(by.id('room-info-edit-view'))).toBeVisible().withTimeout(2000); await element(by.id('room-info-edit-view-topic')).replaceText('new topic'); await element(by.type('UIScrollView')).atIndex(1).swipe('up'); await element(by.id('room-info-edit-view-submit')).tap(); @@ -226,15 +225,14 @@ describe('Room info screen', () => { await tapBack(); await waitFor(element(by.id('room-info-view'))).toBeVisible().withTimeout(2000); await sleep(1000); - // await expect(element(by.id('room-info-view-topic'))).toHaveLabel('new topic'); - await expect(element(by.label('new topic'))).toBeVisible(); - await waitFor(element(by.id('room-info-view-edit-button'))).toBeVisible().withTimeout(10000); - await element(by.id('room-info-view-edit-button')).tap(); - await waitFor(element(by.id('room-info-edit-view'))).toBeVisible().withTimeout(2000); + await expect(element(by.label('new topic').withAncestor(by.id('room-info-view-topic')))).toBeVisible(); }); it('should change room announcement', async() => { await sleep(1000); + await waitFor(element(by.id('room-info-view-edit-button'))).toBeVisible().withTimeout(10000); + await element(by.id('room-info-view-edit-button')).tap(); + await waitFor(element(by.id('room-info-edit-view'))).toBeVisible().withTimeout(2000); await element(by.id('room-info-edit-view-announcement')).replaceText('new announcement'); await element(by.type('UIScrollView')).atIndex(1).swipe('up'); await element(by.id('room-info-edit-view-submit')).tap(); @@ -242,15 +240,14 @@ describe('Room info screen', () => { await tapBack(); await waitFor(element(by.id('room-info-view'))).toBeVisible().withTimeout(2000); await sleep(1000); - // await expect(element(by.id('room-info-view-announcement'))).toHaveLabel('new announcement'); - await expect(element(by.label('new announcement'))).toBeVisible(); - await waitFor(element(by.id('room-info-view-edit-button'))).toBeVisible().withTimeout(10000); - await element(by.id('room-info-view-edit-button')).tap(); - await waitFor(element(by.id('room-info-edit-view'))).toBeVisible().withTimeout(2000); + await expect(element(by.label('new announcement').withAncestor(by.id('room-info-view-announcement')))).toBeVisible(); }); it('should change room password', async() => { await sleep(1000); + await waitFor(element(by.id('room-info-view-edit-button'))).toBeVisible().withTimeout(10000); + await element(by.id('room-info-view-edit-button')).tap(); + await waitFor(element(by.id('room-info-edit-view'))).toBeVisible().withTimeout(2000); await element(by.type('UIScrollView')).atIndex(1).swipe('up'); await element(by.id('room-info-edit-view-password')).replaceText('password'); await element(by.id('room-info-edit-view-submit')).tap();