Fix flakiness in playwright tests (#12512)

* Remove redundant option

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Stabilise app download dialog screenshot test

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Try to stabilise user menu opening in playwright tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Stabilise one-to-one-chat.spec.ts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Stabilise kick.spec.ts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Discard changes to playwright/element-web-test.ts

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-05-13 17:58:49 +01:00 committed by GitHub
parent cc6958980b
commit b283b18898
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 4 deletions

View file

@ -25,8 +25,9 @@ export class Settings {
* Open the top left user menu, returning a Locator to the resulting context menu.
*/
public async openUserMenu(): Promise<Locator> {
await this.page.getByRole("button", { name: "User menu" }).click();
const locator = this.page.locator(".mx_ContextualMenu");
if (await locator.locator(".mx_UserMenu_contextMenu_header").isVisible()) return locator;
await this.page.getByRole("button", { name: "User menu" }).click();
await locator.waitFor();
return locator;
}