Migrate location.spec.ts from Cypress to Playwright (#11945)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
0bbb9e8c89
commit
33d527ee5e
3 changed files with 93 additions and 74 deletions
|
@ -61,6 +61,13 @@ export class ElementAppPage {
|
|||
return this.page.locator(".mx_CreateRoomDialog");
|
||||
}
|
||||
|
||||
/**
|
||||
* Close dialog currently open dialog
|
||||
*/
|
||||
public async closeDialog(): Promise<void> {
|
||||
return this.page.getByRole("button", { name: "Close dialog", exact: true }).click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a room with given options.
|
||||
* @param options the options to apply when creating the room
|
||||
|
@ -74,4 +81,23 @@ export class ElementAppPage {
|
|||
.then((res) => res.room_id);
|
||||
}, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the composer element
|
||||
* @param isRightPanel whether to select the right panel composer, otherwise the main timeline composer
|
||||
*/
|
||||
public async getComposer(isRightPanel?: boolean): Promise<Locator> {
|
||||
const panelClass = isRightPanel ? ".mx_RightPanel" : ".mx_RoomView_body";
|
||||
return this.page.locator(`${panelClass} .mx_MessageComposer`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the message composer kebab menu
|
||||
* @param isRightPanel whether to select the right panel composer, otherwise the main timeline composer
|
||||
*/
|
||||
public async openMessageComposerOptions(isRightPanel?: boolean): Promise<Locator> {
|
||||
const composer = await this.getComposer(isRightPanel);
|
||||
await composer.getByRole("button", { name: "More options", exact: true }).click();
|
||||
return this.page.getByRole("menu");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue