mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
integration-test: Start writing test for language change
This commit is contained in:
parent
ffdc90012e
commit
45e2b565ef
20
integration-tests/i18n.spec.ts
Normal file
20
integration-tests/i18n.spec.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import test, { expect } from "@playwright/test";
|
||||
|
||||
test("User can change language from settings", async ({ page }) => {
|
||||
// Clear all tabs
|
||||
await page.locator('.note-tab:first-of-type').locator("div").nth(1).click({ button: 'right' });
|
||||
await page.getByText('Close all tabs').click();
|
||||
|
||||
// Go to options
|
||||
await page.locator('#launcher-pane div').filter({ hasText: 'Options Open New Window' }).getByRole('button').click();
|
||||
await page.locator('#launcher-pane').getByText('Options').click();
|
||||
|
||||
// Check that the default value (English) is set.
|
||||
await expect(page.locator('#center-pane')).toContainText('Theme');
|
||||
const languageCombobox = await page.getByRole('combobox').first();
|
||||
expect(languageCombobox).toHaveValue("en");
|
||||
|
||||
// Select Chinese and ensure the translation is set.
|
||||
languageCombobox.selectOption("cn");
|
||||
await expect(page.locator('#center-pane')).toContainText('主题');
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user