Skip to content
Draft
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
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 gotoPrivateChannel(name: string) {
await this.page.goto(`/group/${name}`);
await this.content.waitForChannel();
}

get btnContextualbarClose(): Locator {
return this.page.locator('[data-qa="ContextualbarActionClose"]');
}
Expand Down
14 changes: 8 additions & 6 deletions apps/meteor/tests/e2e/rooms-join.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ test.describe.serial('Join rooms', () => {

test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);
// poHomeChannel.goToRoom cannot be used here because it waits for specific selectors to ensure the whole room is loaded.
// Since the user does not have permission to preview the user, there's never a room to wait for.
await page.goto(`/channel/${targetChannel}`);
});

Expand All @@ -44,7 +46,7 @@ test.describe.serial('Join rooms', () => {
});

test('should let a non-member join a public channel', async () => {
await expect(poHomeChannel.btnJoinChannel).toBeVisible();
await expect(poHomeChannel.btnJoinChannel).toBeVisible({ timeout: 10000 });
await poHomeChannel.btnJoinChannel.click();
await expect(poHomeChannel.btnJoinChannel).not.toBeVisible();
await expect(poHomeChannel.composer.inputMessage).toBeEnabled();
Expand All @@ -66,7 +68,7 @@ test.describe.serial('Join rooms', () => {

test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);
await page.goto(`/channel/${targetChannel}`);
await poHomeChannel.gotoChannel(targetChannel);
});

test.afterEach(async ({ api }) => {
Expand Down Expand Up @@ -100,8 +102,8 @@ test.describe.serial('Join rooms', () => {
await deleteRoom(api, discussion._id);
});

test('should let a non-member join a discussion', async ({ page }) => {
await page.goto(`/channel/${discussion.name}`);
test('should let a non-member join a discussion', async () => {
await poHomeChannel.gotoChannel(discussion.name);

await expect(poHomeChannel.composer.btnJoinRoom).toBeVisible();

Expand Down Expand Up @@ -135,8 +137,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.gotoPrivateChannel(discussion.name);

await expect(poHomeChannel.composer.btnJoinRoom).toBeVisible();
await poHomeChannel.composer.btnJoinRoom.click();
Expand Down
Loading