Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions e2e/tests/room/02-room.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ async function navigateToRoom(roomName) {
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
}

const mainRoom = data.groups.private.name;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary changes.

describe('Room screen', () => {
const mainRoom = data.groups.private.name;

before(async() => {
await navigateToRoom(mainRoom);
Expand Down Expand Up @@ -126,6 +126,17 @@ describe('Room screen', () => {
await expect(element(by.id('messagebox-input'))).toHaveText('#general ');
await element(by.id('messagebox-input')).clearText();
});

it('should draft message', async () => {
await element(by.id('messagebox-input')).atIndex(0).tap();
await element(by.id('messagebox-input')).atIndex(0).typeText(`${ data.random }draft`);
await tapBack();
await element(by.id(`rooms-list-view-item-${ mainRoom }`)).tap();
await expect(element(by.id('messagebox-input'))).toHaveText(`${ data.random }draft`);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should test if the room has rendered before testing messagebox content.

await element(by.id('messagebox-input')).clearText();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should test if draft was removed after messagebox is cleared.

});


});

describe('Message', async() => {
Expand Down Expand Up @@ -280,11 +291,18 @@ describe('Room screen', () => {
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
await waitFor(element(by.id(`room-view-title-${ thread }`))).toExist().withTimeout(5000);
await expect(element(by.id(`room-view-title-${ thread }`))).toExist();
});

it('should draft thread message', async () => {
await element(by.id('messagebox-input')).atIndex(0).tap();
await element(by.id('messagebox-input')).atIndex(0).typeText(`${ thread }draft`);
await tapBack();
await element(by.id(`message-thread-button-${ thread }`)).tap();
await expect(element(by.id('messagebox-input')).atIndex(0)).toHaveText(`${ thread }draft`);
await element(by.id('messagebox-input')).atIndex(0).clearText();
});

it('should toggle follow thread', async() => {
await element(by.id(`message-thread-button-${ thread }`)).tap();
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
await waitFor(element(by.id(`room-view-title-${ thread }`))).toExist().withTimeout(5000);
await expect(element(by.id(`room-view-title-${ thread }`))).toExist();
Expand Down