feat(e2e): add test for settings translations

This commit is contained in:
Elian Doran 2025-01-12 17:28:41 +02:00
parent 1abc8abee6
commit 0db3bfd8ae
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

13
e2e/i18n.spec.ts Normal file
View File

@ -0,0 +1,13 @@
import { test, expect, Page } from "@playwright/test";
import App from "./support/app";
test("Displays translations in Settings", async ({ page }) => {
const app = new App(page);
await app.goto();
await app.closeAllTabs();
await app.goToSettings();
await app.noteTree.getByText("Appearance").click();
expect(app.currentNoteSplit).toContainText("Localization");
expect(app.currentNoteSplit).toContainText("Language");
});

View File

@ -31,6 +31,10 @@ export default class App {
await autocomplete.press("Enter");
}
async goToSettings() {
await this.page.locator(".launcher-button.bx-cog").click();
}
getTab(tabIndex: number) {
return this.tabBar.locator(".note-tab-wrapper").nth(tabIndex);
}
@ -43,6 +47,7 @@ export default class App {
await this.getTab(0).click({ button: "right" });
await this.page.waitForTimeout(500); // TODO: context menu won't dismiss otherwise
await this.page.getByText("Close all tabs").click({ force: true });
await this.page.waitForTimeout(500); // TODO: context menu won't dismiss otherwise
}
async addNewTab() {