mirror of
https://github.com/oxynote/oxynote.git
synced 2026-10-17 10:59:20 +02:00
22 lines
622 B
TypeScript
22 lines
622 B
TypeScript
import { expect, type Locator, type Page } from "@playwright/test"
|
|
import { t } from "./i18n"
|
|
|
|
// openSettings opens the settings dialog from the workspace menu in the
|
|
// sidebar header and returns the dialog.
|
|
export async function openSettings(
|
|
page: Page,
|
|
workspaceName: string,
|
|
): Promise<Locator> {
|
|
await page.getByRole("button", { name: workspaceName }).click()
|
|
await page
|
|
.getByRole("menuitem", { name: t("sidebar.header.settings") })
|
|
.click()
|
|
|
|
const dialog = page.getByRole("dialog")
|
|
await expect(
|
|
dialog.getByRole("heading", { name: t("settings.workspace.title") }),
|
|
).toBeVisible()
|
|
|
|
return dialog
|
|
}
|