Skip to content

Commit

Permalink
test: fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Dec 23, 2024
1 parent 33dbac1 commit 8e624c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
16 changes: 4 additions & 12 deletions apps/meteor/tests/e2e/page-objects/fragments/home-flextab-room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,20 @@ export class HomeFlextabRoom {
this.page = page;
}

get roomInfoTab(): Locator {
return this.page.getByRole('dialog', { exact: true });
}

get btnEdit(): Locator {
return this.page.locator('role=button[name="Edit"]');
}

get btnMore(): Locator {
return this.page.locator('role=button[name="More"]');
}

get btnLeave(): Locator {
return this.roomInfoTab.locator('role=button[name="Leave"]');
return this.page.locator('role=button[name="Leave"]');
}

get btnDelete(): Locator {
return this.roomInfoTab.locator('role=button[name="Delete"]');
get btnMore(): Locator {
return this.page.locator('role=button[name="More"]');
}

getMoreOption(option: string) {
return this.roomInfoTab.locator(`role=menuitem[name="${option}"]`);
return this.page.locator(`role=menuitem[name="${option}"]`);
}

get confirmLeaveModal(): Locator {
Expand Down
7 changes: 4 additions & 3 deletions apps/meteor/tests/e2e/team-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ test.describe.serial('teams-management', () => {
test('should delete targetTeamNonPrivate', async () => {
await poHomeTeam.sidenav.openChat(targetTeamNonPrivate);
await poHomeTeam.tabs.btnRoomInfo.click();
await poHomeTeam.tabs.room.btnDelete.click();
await poHomeTeam.tabs.room.btnMore.click();
await poHomeTeam.tabs.room.getMoreOption('Delete').click();
await expect(poHomeTeam.tabs.room.confirmDeleteTeamModal).toBeVisible();

await poHomeTeam.tabs.room.confirmDeleteTeam();
Expand Down Expand Up @@ -406,11 +407,11 @@ test.describe.serial('teams-management', () => {
await expect(poHomeTeam.tabs.members.memberOption('user1')).not.toBeVisible();
});

test('should convert team into a channel', async ({ page }) => {
test('should convert team into a channel', async () => {
await poHomeTeam.sidenav.openChat(targetTeam);
await poHomeTeam.tabs.btnRoomInfo.click();
await poHomeTeam.tabs.room.btnMore.click();
await page.getByRole('listbox', { exact: true }).getByRole('option', { name: 'Convert to Channel' }).click();
await poHomeTeam.tabs.room.getMoreOption('Convert to Channel').click();
await expect(poHomeTeam.tabs.room.confirmConvertModal).toBeVisible();

await poHomeTeam.tabs.room.confirmConvert();
Expand Down

0 comments on commit 8e624c4

Please sign in to comment.