e2e: add tests for translations (#114390)

e2e: add tests for translations
This commit is contained in:
Hugo Häggmark
2025-12-08 10:19:44 +01:00
committed by GitHub
parent 8bf3ac9710
commit 3490c3b0fd
46 changed files with 678 additions and 20 deletions
@@ -0,0 +1,13 @@
import { FRENCH_FRANCE } from '@grafana/i18n';
import { expect, test } from '@grafana/plugin-e2e';
test.use({ userPreferences: { language: FRENCH_FRANCE } });
test('should display default translation (en-US)', async ({ panelEditPage }) => {
panelEditPage.setVisualization('Grafana E2ETest Panel');
await expect(panelEditPage.panel.locator.getByText('Text option value:')).toBeVisible();
const options = panelEditPage.getCustomOptions('Grafana E2ETest Panel');
const showSeriesCounter = options.getSwitch('Show series counter');
await expect(showSeriesCounter.locator()).toBeVisible();
});
@@ -0,0 +1,13 @@
import { SWEDISH_SWEDEN } from '@grafana/i18n';
import { expect, test } from '@grafana/plugin-e2e';
test.use({ userPreferences: { language: SWEDISH_SWEDEN } });
test('should display correct translation', async ({ panelEditPage }) => {
panelEditPage.setVisualization('Grafana E2ETest Panel');
await expect(panelEditPage.panel.locator.getByText('Textalternativ värde:')).toBeVisible();
const options = panelEditPage.getCustomOptions('Grafana E2ETest Panel');
const showSeriesCounter = options.getSwitch('Visa serieräknare');
await expect(showSeriesCounter.locator()).toBeVisible();
});