Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 3 additions & 8 deletions apps/meteor/tests/e2e/emojis.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ test.describe.serial('emoji', () => {
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);

await page.goto('/home');
await poHomeChannel.gotoChannel(targetChannel);
});

test('should display emoji picker properly', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.composer.btnEmoji.click();

await test.step('should display scroller', async () => {
Expand All @@ -37,7 +36,6 @@ test.describe.serial('emoji', () => {
});

await test.step('should pick and send grinning emoji', async () => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.pickEmoji('grinning');
await page.keyboard.press('Enter');

Expand All @@ -46,16 +44,13 @@ test.describe.serial('emoji', () => {
});

test('expect send emoji via text', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage(':innocent:');
await page.keyboard.press('Enter');

await expect(poHomeChannel.content.lastUserMessage).toContainText('😇');
});

test('expect render special characters and numbers properly', async () => {
await poHomeChannel.navbar.openChat(targetChannel);

await poHomeChannel.content.sendMessage('® © ™ # *');
await expect(poHomeChannel.content.lastUserMessage).toContainText('® © ™ # *');
});
Expand All @@ -79,7 +74,7 @@ test.describe.serial('emoji', () => {
await poAdminEmoji.addEmojiFlexTab.save();
await poAdminEmoji.sidebar.close();

await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.gotoChannel(targetChannel);

await poHomeChannel.content.sendMessage(`:${emojiName}:`);
await page.keyboard.press('Enter');
Expand All @@ -94,7 +89,7 @@ test.describe.serial('emoji', () => {
await poAdminEmoji.editEmojiFlexTab.save();
await poAdminEmoji.sidebar.close();

await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.gotoChannel(targetChannel);

await poHomeChannel.content.sendMessage(`:${newEmojiName}:`);
await page.keyboard.press('Enter');
Expand Down
9 changes: 1 addition & 8 deletions apps/meteor/tests/e2e/export-messages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.describe('export-messages', () => {
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);

await page.goto('/home');
await poHomeChannel.gotoChannel(targetChannel);
});

test.afterAll(async ({ api }) => {
Expand All @@ -31,7 +31,6 @@ test.describe('export-messages', () => {
});

test('should all export methods be available in targetChannel', async () => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.roomToolbar.openMoreOptions();
await poHomeChannel.roomToolbar.menuItemExportMessages.click();

Expand All @@ -42,7 +41,6 @@ test.describe('export-messages', () => {
});

test('should display export output format correctly depending on the selected method', async () => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.roomToolbar.openMoreOptions();
await poHomeChannel.roomToolbar.menuItemExportMessages.click();

Expand Down Expand Up @@ -71,7 +69,6 @@ test.describe('export-messages', () => {
test('when trying to send email without filling to users or to additional emails, should mark both fields as invalid', async () => {
const testMessage = uniqueMessage();

await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage(testMessage);
await poHomeChannel.roomToolbar.openMoreOptions();
await poHomeChannel.roomToolbar.menuItemExportMessages.click();
Expand All @@ -94,7 +91,6 @@ test.describe('export-messages', () => {
});

test('should display an error when trying to send email without selecting any message', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.roomToolbar.openMoreOptions();
await poHomeChannel.roomToolbar.menuItemExportMessages.click();

Expand All @@ -112,7 +108,6 @@ test.describe('export-messages', () => {
const message1 = uniqueMessage();
const message2 = uniqueMessage();

await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage(message1);
await poHomeChannel.roomToolbar.openMoreOptions();
await poHomeChannel.roomToolbar.menuItemExportMessages.click();
Expand All @@ -128,7 +123,6 @@ test.describe('export-messages', () => {
const message1 = uniqueMessage();
const message2 = uniqueMessage();

await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage(message1);
await poHomeChannel.content.sendMessage(message2);

Expand All @@ -153,7 +147,6 @@ test.describe('export-messages', () => {
const message1 = uniqueMessage();
const message2 = uniqueMessage();

await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage(message1);
await poHomeChannel.content.sendMessage(message2);

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/files-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ test.describe.serial('files-management', () => {
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);

await page.goto('/home');
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.gotoChannel(targetChannel);
});

test.afterAll(async ({ api }) => {
Expand Down
20 changes: 9 additions & 11 deletions apps/meteor/tests/e2e/message-actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ test.describe.serial('message-actions', () => {
});
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);
await page.goto('/home');
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.gotoChannel(targetChannel);
});

test('expect reply the message', async ({ page }) => {
Expand Down Expand Up @@ -127,7 +126,7 @@ test.describe.serial('message-actions', () => {
await createDiscussionModal.inputName.fill(discussionName);
await createButton.click();
await expect(page.locator('header h1')).toHaveText(discussionName);
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.gotoChannel(targetChannel);
// Should fail if more than one discussion has been created
await expect(poHomeChannel.content.getMessageByText(discussionName)).toHaveCount(1);
});
Expand Down Expand Up @@ -203,8 +202,7 @@ test.describe.serial('message-actions', () => {
});
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);
await page.goto('/home');
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.gotoChannel(targetChannel);
});
test('expect reply the message in direct', async ({ page }) => {
await poHomeChannel.content.sendMessage('this is a message for reply in direct');
Expand All @@ -220,7 +218,7 @@ test.describe.serial('message-actions', () => {
await poHomeChannel.content.sendMessage(message);
await poHomeChannel.content.forwardMessage(forwardChannel);

await poHomeChannel.navbar.openChat(forwardChannel);
await poHomeChannel.gotoChannel(forwardChannel);
await expect(poHomeChannel.content.lastUserMessage).toContainText(message);
});

Expand Down Expand Up @@ -253,7 +251,7 @@ test.describe.serial('message-actions', () => {

await poHomeChannel.content.forwardMessage(forwardChannel);

await poHomeChannel.navbar.openChat(forwardChannel);
await poHomeChannel.gotoChannel(forwardChannel);
await expect(poHomeChannel.content.lastUserMessage).toContainText(filename);
});

Expand All @@ -265,7 +263,7 @@ test.describe.serial('message-actions', () => {

await poHomeChannel.content.forwardMessage(forwardChannel);

await poHomeChannel.navbar.openChat(forwardChannel);
await poHomeChannel.gotoChannel(forwardChannel);
await expect(poHomeChannel.content.lastUserMessage).toContainText(filename);
});

Expand All @@ -277,7 +275,7 @@ test.describe.serial('message-actions', () => {

await poHomeChannel.content.forwardMessage(forwardChannel);

await poHomeChannel.navbar.openChat(forwardChannel);
await poHomeChannel.gotoChannel(forwardChannel);
await expect(poHomeChannel.content.lastUserMessage).toContainText(filename);
});

Expand All @@ -289,7 +287,7 @@ test.describe.serial('message-actions', () => {

await poHomeChannel.content.forwardMessage(forwardChannel);

await poHomeChannel.navbar.openChat(forwardChannel);
await poHomeChannel.gotoChannel(forwardChannel);
await expect(poHomeChannel.content.lastUserMessage).toContainText(filename);
});

Expand All @@ -301,7 +299,7 @@ test.describe.serial('message-actions', () => {

await poHomeChannel.content.forwardMessage(forwardChannel);

await poHomeChannel.navbar.openChat(forwardChannel);
await poHomeChannel.gotoChannel(forwardChannel);
await expect(poHomeChannel.content.lastUserMessage).toContainText(filename);
});
});
17 changes: 1 addition & 16 deletions apps/meteor/tests/e2e/message-composer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,22 @@ test.describe.serial('message-composer', () => {
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);

await page.goto('/home');
await poHomeChannel.gotoChannel(targetChannel);
});

test('should have all formatters and the main actions visible on toolbar', async () => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello composer');

await expect(poHomeChannel.composer.allPrimaryActions).toHaveCount(12);
});

test('should have only the main formatter and the main action', async ({ page }) => {
await page.setViewportSize({ width: 768, height: 600 });
await poHomeChannel.navbar.openChat(targetChannel);

await expect(poHomeChannel.composer.allPrimaryActions).toHaveCount(6);
});

test('should navigate on toolbar using arrow keys', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);

await page.keyboard.press('Tab');
await page.keyboard.press('ArrowRight');
await page.keyboard.press('ArrowRight');
Expand All @@ -48,8 +44,6 @@ test.describe.serial('message-composer', () => {
});

test('should move the focus away from toolbar using tab key', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);

await page.keyboard.press('Tab');
await page.keyboard.press('Tab');

Expand All @@ -58,7 +52,6 @@ test.describe.serial('message-composer', () => {

test('should add a link to the selected text', async ({ page }) => {
const url = faker.internet.url();
await poHomeChannel.navbar.openChat(targetChannel);

await page.keyboard.type('hello composer');
await page.keyboard.press('Control+A'); // on Windows and Linux
Expand All @@ -71,7 +64,6 @@ test.describe.serial('message-composer', () => {
});

test('should select popup item and not send the message when pressing enter', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello composer');

await test.step('mention popup', async () => {
Expand Down Expand Up @@ -106,7 +98,6 @@ test.describe.serial('message-composer', () => {
});

test('should list popup items correctly', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello composer');

await test.step('mention popup', async () => {
Expand All @@ -117,7 +108,6 @@ test.describe.serial('message-composer', () => {
});

test('should close mention popup when canceling a message edit via "Cancel" button', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello composer');

await test.step('expect to edit last message', async () => {
Expand Down Expand Up @@ -145,7 +135,6 @@ test.describe.serial('message-composer', () => {
});

test('should close mention popup when canceling a message edit via keyboard', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello composer');

await test.step('expect to edit last message', async () => {
Expand Down Expand Up @@ -174,8 +163,6 @@ test.describe.serial('message-composer', () => {

test.describe('audio recorder', () => {
test('should open audio recorder', async () => {
await poHomeChannel.navbar.openChat(targetChannel);

await test.step('should be able to record an audio with text content in composer ', async () => {
await poHomeChannel.composer.inputMessage.fill('this is a message with audio message');
await expect(poHomeChannel.composer.btnAudioMessage).toBeEnabled();
Expand All @@ -186,7 +173,6 @@ test.describe.serial('message-composer', () => {
});

test('should stop recording when clicking on cancel', async () => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.composer.btnAudioMessage.click();
await expect(poHomeChannel.audioRecorder).toBeVisible();

Expand All @@ -195,7 +181,6 @@ test.describe.serial('message-composer', () => {
});

test('should attach file to the composer when clicking on "Finish recording"', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.composer.btnAudioMessage.click();
await expect(poHomeChannel.audioRecorder).toBeVisible();

Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/tests/e2e/page-objects/home-channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export class HomeChannel {
return this.page.goto('/home');
}

async gotoChannel(name: string) {
await this.page.goto(`/channel/${name}`);
await this.content.waitForChannel();
}

get btnContextualbarClose(): Locator {
return this.page.locator('[data-qa="ContextualbarActionClose"]');
}
Expand Down
7 changes: 2 additions & 5 deletions apps/meteor/tests/e2e/read-receipts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ test.describe.serial('read-receipts', () => {
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);

await page.goto('/home');
await poHomeChannel.gotoChannel(targetChannel);
});

test.describe('read receipt settings disabled', async () => {
test('should not show read receipts item menu', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello world');
await poHomeChannel.content.openLastMessageMenu();
await expect(page.locator('role=menuitem[name="Read receipts"]')).not.toBeVisible();
Expand Down Expand Up @@ -57,19 +56,17 @@ test.describe.serial('read-receipts', () => {
test('should show read receipts message sent status in the sent message', async ({ browser }) => {
const { page } = await createAuxContext(browser, Users.user1);
auxContext = { page, poHomeChannel: new HomeChannel(page) };
await auxContext.poHomeChannel.navbar.openChat(targetChannel);
await auxContext.poHomeChannel.gotoChannel(targetChannel);
await auxContext.poHomeChannel.content.sendMessage('hello admin');

await expect(auxContext.poHomeChannel.content.lastUserMessage.getByRole('status', { name: 'Message sent' })).toBeVisible();
});

test('should show read receipts message viewed status in the sent message', async () => {
await poHomeChannel.navbar.openChat(targetChannel);
await expect(poHomeChannel.content.lastUserMessage.getByRole('status', { name: 'Message viewed' })).toBeVisible();
});

test('should show the reads receipt modal with the users who read the message', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.openLastMessageMenu();
await page.locator('role=menuitem[name="Read receipts"]').click();

Expand Down
Loading
Loading