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
4 changes: 4 additions & 0 deletions apps/meteor/tests/e2e/channel-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ test.describe.serial('channel-management', () => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello composer');
await poHomeChannel.roomHeaderFavoriteBtn.focus();
await expect(poHomeChannel.roomHeaderFavoriteBtn).toBeFocused();

await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
Expand All @@ -40,6 +41,7 @@ test.describe.serial('channel-management', () => {
test('should move the focus away from toolbar using tab key', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.roomHeaderFavoriteBtn.focus();
await expect(poHomeChannel.roomHeaderFavoriteBtn).toBeFocused();

await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
Expand Down Expand Up @@ -137,6 +139,7 @@ test.describe.serial('channel-management', () => {
test('should open room info when clicking on roomName', async ({ page }) => {
await poHomeChannel.navbar.openChat(targetChannel);
await page.getByRole('button', { name: targetChannel }).first().focus();
await expect(page.getByRole('button', { name: targetChannel }).first()).toBeFocused();
await page.keyboard.press('Space');
await page.getByRole('dialog').waitFor();

Expand All @@ -159,6 +162,7 @@ test.describe.serial('channel-management', () => {
await page.getByRole('listitem', { name: discussionName }).getByRole('button', { name: 'Reply' }).click();

await page.getByRole('button', { name: `Back to ${targetChannel} channel`, exact: true }).focus();
await expect(page.getByRole('button', { name: `Back to ${targetChannel} channel`, exact: true })).toBeFocused();
await page.keyboard.press('Space');

await expect(page).toHaveURL(`/channel/${targetChannel}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test.describe('E2EE File Encryption', () => {
await poHomeChannel.content.openLastMessageMenu();
await poHomeChannel.content.btnOptionEditMessage.click();

expect(await poHomeChannel.composer.inputMessage.inputValue()).toBe('any_description');
await expect(poHomeChannel.composer.inputMessage).toHaveValue('any_description');

await poHomeChannel.composer.inputMessage.fill('edited any_description');
await page.keyboard.press('Enter');
Expand Down
17 changes: 7 additions & 10 deletions apps/meteor/tests/e2e/feature-preview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ test.describe.serial('feature preview', () => {
test('should display new channel from team on the sidepanel', async ({ page, api }) => {
newChannelModal = new CreateNewChannelModal(page);

await page.goto(`/group/${sidepanelTeam}`);
await poHomeTeam.content.waitForChannel();
await poHomeTeam.gotoGroup(sidepanelTeam);

await poHomeTeam.headerToolbar.openTeamChannels();
await poHomeTeam.tabs.channels.btnCreateNew.click();
Expand Down Expand Up @@ -143,8 +142,8 @@ test.describe.serial('feature preview', () => {
await expect(poHomeChannel.sidepanel.getItemByName(sidepanelTeam)).not.toHaveText(parsedWrong);
});

test('should show channel in sidepanel after adding existing one', async ({ page }) => {
await page.goto(`/group/${sidepanelTeam}`);
test('should show channel in sidepanel after adding existing one', async () => {
await poHomeTeam.gotoGroup(sidepanelTeam);

await poHomeTeam.headerToolbar.openTeamChannels();
await poHomeTeam.tabs.channels.addExistingChannel(targetChannel);
Expand All @@ -156,7 +155,7 @@ test.describe.serial('feature preview', () => {
const user1Page = await browser.newPage({ storageState: Users.user1.state });
const user1Channel = new HomeChannel(user1Page);

await page.goto(`/group/${sidepanelTeam}`);
await poHomeTeam.gotoGroup(sidepanelTeam);

await poHomeTeam.headerToolbar.openTeamChannels();
await poHomeTeam.tabs.channels.addExistingChannel(targetChannel);
Expand Down Expand Up @@ -225,9 +224,8 @@ test.describe.serial('feature preview', () => {
await expect(poHomeChannel.sidebar.discussionsTeamCollabFilter).toBeVisible();
});

test('should show favorite team on the sidepanel', async ({ page }) => {
await page.goto(`/group/${sidepanelTeam}`);
await poHomeChannel.content.waitForChannel();
test('should show favorite team on the sidepanel', async () => {
await poHomeChannel.gotoGroup(sidepanelTeam);
await poHomeChannel.sidebar.favoritesTeamCollabFilter.click();

await expect(poHomeChannel.sidepanel.getTeamItemByName(sidepanelTeam)).not.toBeVisible();
Expand All @@ -239,8 +237,7 @@ test.describe.serial('feature preview', () => {

test('should show discussion in discussions and all sidepanel filter, should remove after deleting discussion', async ({ page }) => {
const poHomeDiscussion = new HomeDiscussion(page);
await page.goto(`/group/${sidepanelTeam}`);
await poHomeChannel.content.waitForChannel();
await poHomeChannel.gotoGroup(sidepanelTeam);

const discussionName = faker.string.uuid();

Expand Down
6 changes: 5 additions & 1 deletion apps/meteor/tests/e2e/messaging.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ test.describe('Messaging', () => {

test('should focus the latest message when moving the focus on the list and theres no previous focus', async ({ page }) => {
await page.getByRole('button', { name: targetChannel }).first().focus();
await expect(page.getByRole('button', { name: targetChannel }).first()).toBeFocused();

await test.step('move focus to the list', async () => {
await page.keyboard.press('Tab');
Expand All @@ -152,6 +153,7 @@ test.describe('Messaging', () => {

await test.step('move focus to the list again', async () => {
await page.getByRole('button', { name: targetChannel }).first().focus();
await expect(page.getByRole('button', { name: targetChannel }).first()).toBeFocused();
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
Expand All @@ -165,9 +167,10 @@ test.describe('Messaging', () => {
await channelPage.navbar.openChat(targetChannel);

await test.step('focus on the second message', async () => {
await expect(channelPage.composer.inputMessage).toBeFocused();
await page.keyboard.press('ArrowUp');

expect(await channelPage.composer.inputMessage.inputValue()).toBe('msg2');
await expect(channelPage.composer.inputMessage).toHaveValue('msg2');
});

await test.step('send edited message', async () => {
Expand All @@ -187,6 +190,7 @@ test.describe('Messaging', () => {
);

for (const element of ['edited msg2 a', 'edited msg2 b', 'edited msg2 c', 'edited msg2 d', 'edited msg2 e']) {
await expect(channelPage.composer.inputMessage).toBeFocused();
await page.keyboard.press('ArrowUp');

await channelPage.content.sendMessage(element, false);
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 @@ -101,6 +101,11 @@ export class HomeChannel {
await this.content.waitForChannel();
}

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

get btnContextualbarClose(): Locator {
return this.page.locator('[data-qa="ContextualbarActionClose"]');
}
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/tests/e2e/rooms-join.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ test.describe.serial('Join rooms', () => {
await api.post('/groups.delete', { roomId: group._id });
});

test('should let a parent member join a discussion in a private channel', async ({ page }) => {
await page.goto(`/group/${discussion.name}`);
test('should let a parent member join a discussion in a private channel', async () => {
await poHomeChannel.gotoGroup(discussion.name);

await expect(poHomeChannel.composer.btnJoinRoom).toBeVisible();
await poHomeChannel.composer.btnJoinRoom.click();
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/tests/e2e/sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ test.describe.serial('Sidebar', () => {
});
test('should navigate on navbar toolbar pressing tab', async ({ page }) => {
await poHomeChannel.navbar.btnHome.focus();
await expect(poHomeChannel.navbar.btnHome).toBeFocused();

await test.step('move focus to directory button', async () => {
await page.keyboard.press('Tab');
Expand Down Expand Up @@ -135,6 +136,7 @@ test.describe.serial('Sidebar', () => {

await expect(async () => {
await collapser.focus();
await expect(collapser).toBeFocused();
await page.keyboard.press('Space');
const isExpanded = (await collapser.getAttribute('aria-expanded')) === 'true';
expect(isExpanded).toBeTruthy();
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/tests/e2e/team-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ test.describe.serial('teams-management', () => {
test('should access team channel through targetTeam header', async ({ page }) => {
await poHomeTeam.navbar.openChat(targetChannel);
await page.getByRole('button', { name: targetChannel }).first().focus();
await expect(page.getByRole('button', { name: targetChannel }).first()).toBeFocused();
await page.keyboard.press('Shift+Tab');
await page.keyboard.press('Space');

Expand Down Expand Up @@ -437,8 +438,7 @@ test.describe.serial('teams-management', () => {
test('should user1 leave from targetTeam', async ({ browser }) => {
const user1Page = await browser.newPage({ storageState: Users.user1.state });
const user1Channel = new HomeTeam(user1Page);
await user1Page.goto(`/group/${targetTeam}`);
await user1Channel.content.waitForChannel();
await user1Channel.gotoGroup(targetTeam);

await user1Channel.headerToolbar.openTeamInfo();
await user1Channel.tabs.room.leaveRoom();
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/tests/e2e/video-conference.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ test.describe('video conference', () => {
await poHomeChannel.navbar.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello video conference');
await poHomeChannel.roomHeaderFavoriteBtn.focus();
await expect(poHomeChannel.roomHeaderFavoriteBtn).toBeFocused();

await test.step('opens video conference popup', async () => {
await page.keyboard.press('Tab');
Expand Down
Loading