Default the room header to on (#12803)

* Default the room header to on

* Refactor code into helper method

Add a method to open/close the room info panel and use it everywhere.

* Fix broken tests, update snapshots and screenshots

* Update room header tests to make sense with the new header
This commit is contained in:
R Midhun Suresh 2024-07-23 16:26:25 +05:30 committed by GitHub
parent 25fcd6a65f
commit bb1b7f1fd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
59 changed files with 595 additions and 397 deletions

View file

@ -171,4 +171,13 @@ export class ElementAppPage {
await spotlight.open();
return spotlight;
}
/**
* Opens/closes the room info panel
* @returns locator to the right panel
*/
public async toggleRoomInfoPanel(): Promise<Locator> {
await this.page.getByRole("button", { name: "Room info" }).first().click();
return this.page.locator(".mx_RightPanel");
}
}

View file

@ -91,12 +91,17 @@ export class Settings {
}
/**
* Open room settings (via room header menu), returns a locator to the dialog
* Open room settings (via room info panel), returns a locator to the dialog
* @param tab the name of the tab to switch to after opening, optional.
*/
public async openRoomSettings(tab?: string): Promise<Locator> {
await this.page.getByRole("banner").getByRole("button", { name: "Room options", exact: true }).click();
await this.page.locator(".mx_RoomTile_contextMenu").getByRole("menuitem", { name: "Settings" }).click();
// Open right panel if not open
const rightPanel = this.page.locator(".mx_RightPanel");
if ((await rightPanel.count()) === 0) {
await this.page.getByRole("button", { name: "Room info" }).first().click();
}
await rightPanel.getByRole("menuitem", { name: "Settings" }).click();
if (tab) await this.switchTab(tab);
return this.page.locator(".mx_Dialog").filter({ has: this.page.locator(".mx_RoomSettingsDialog") });
}