Skip to content

feat(e2e): add German and Spanish locale support for e2e tests#2502

Merged
jrichter1 merged 10 commits intoredhat-developer:mainfrom
HusneShabbir:feat/e2e-de-es-locale
Mar 12, 2026
Merged

feat(e2e): add German and Spanish locale support for e2e tests#2502
jrichter1 merged 10 commits intoredhat-developer:mainfrom
HusneShabbir:feat/e2e-de-es-locale

Conversation

@HusneShabbir
Copy link
Contributor

@HusneShabbir HusneShabbir commented Mar 9, 2026

E2e: Add German (de) and Spanish (es) locale support across workspaces

This PR enables e2e tests to run on Deutsch and Español in addition to existing locales (en, fr, it, ja). Tests run on all six locales (en, de, es, fr, it, ja) where supported; for workspaces with missing de/es translations, affected tests skip only on de/es via skipIfLocales (or the full suite in lightspeed and scorecard) until the translation Jira issues are resolved.

Resolves:
https://issues.redhat.com/browse/RHIDP-12537

Workspaces updated

Workspace Change de/es skip
adoption-insights 6-locale Playwright + app-config; skipIfLocales in e2e utils 3 tests skip on de/es (RHDHBUGS-2791)
bulk-import 6-locale Playwright + app-config; skipIfLocales in e2e utils 3 tests skip on de/es (RHDHBUGS-2792)
extensions de/es projects + LOCALE_DISPLAY_NAMES; single frontend, locale switch in UI 7 badge-related tests skip on de/es (RHDHBUGS-2793)
global-floating-action-button de/es projects + LOCALE_DISPLAY_NAMES in helpers None – translations complete
global-header de/es projects + LOCALE_DISPLAY_NAMES; skipIfLocales in e2e utils 8 tests using create.* skip on de/es (RHDHBUGS-2795)
lightspeed de/es projects + LOCALE_DISPLAY_NAMES in testHelper; suite-level skip via beforeEach Entire suite skips on de/es (RHDHBUGS-2797) – tests are serial and dependent
quickstart de/es projects + dev-config-de, dev-config-es; LOCALE_DISPLAY_NAMES in helper; skipIfLocales in e2e utils All quickstart tests skip on de, es, dev-config-de, dev-config-es (RHDHBUGS-2800)
scorecard de/es projects + LOCALE_DISPLAY_NAMES in CatalogPage; skipIfLocales in e2e utils Entire suite skips on de/es (RHDHBUGS-2801)
homepage 6-locale Playwright (generated from LOCALES); LOCALE_DISPLAY_NAMES in testUtils; timeout 2 min None – translations complete

Changes

  • Playwright / app-config: Locale-specific projects and, where applicable, port mapping (adoption-insights, bulk-import) or extra projects sharing one server (extensions, global-floating-action-button, global-header, lightspeed, quickstart, scorecard, homepage). App-config YAMLs added/updated for de and es where needed. Quickstart also adds dev-config-de and dev-config-es for the developer spec.
  • Generated locale projects: All updated workspaces now derive Playwright projects from a single LOCALES array (e.g. ['en', 'de', 'es', 'fr', 'it', 'ja']) instead of listing each locale by hand. Adding a new locale is a one-line change per workspace.
  • Locale helpers: LOCALE_DISPLAY_NAMES (and switchToLocale where used) extended with de: 'Deutsch', es: 'Español' in each workspace that switches locale in the UI.
  • Skip helper: skipIfLocales(testInfo, locales, reason) in each affected workspace’s e2e utils. Used so tests run on en, fr, it, ja and skip only on de/es with a reason that includes the Jira link.
  • Lightspeed / scorecard: Full suite skips on de/es in a single test.beforeEach (no per-test skip)—lightspeed because tests run serially and depend on each other; scorecard because metric, thresholds, and error keys are missing in de/es.
  • Homepage: Test timeout increased to 2 minutes so beforeAll (e.g. guest login and load wait) can complete; no skip—de/es translations are complete for the keys used in tests.
  • Tests: No extra describe grouping; affected tests keep a single skipIfLocales(testInfo, ['de', 'es'], '...') at the top (or a suite-level beforeEach). Playwright fixture usage uses ({}, testInfo) where only testInfo is needed.

Translation gaps (Jira; not fixed in this PR)

Workspace Jira Missing in de/es (summary)
adoption-insights RHDHBUGS-2791 e.g. activeUsers.hour, filter.selectKind, searches.hour
bulk-import RHDHBUGS-2792 e.g. addRepositories.approvalTool.github, previewFile.preview, repositories.pr
extensions RHDHBUGS-2793 Entire badges section
global-header RHDHBUGS-2795 Entire create section (e.g. create.title)
lightspeed RHDHBUGS-2797 e.g. disclaimer.withValidation, chatbox.welcome.description, user.guest, aria.chatbotSelector, conversation rename/delete confirm keys
quickstart RHDHBUGS-2800 Step CTA keys: steps.configureRbac.ctaTitle, steps.configureGit.ctaTitle, steps.managePlugins.ctaTitle, steps.learnAboutCatalog.ctaTitle, steps.exploreSelfServiceTemplates.ctaTitle, steps.findAllLearningPaths.ctaTitle
scorecard RHDHBUGS-2801 metric.*, thresholds.*, emptyState.button, errors.metricDataUnavailable, errors.noDataFound
Once those are fixed, the corresponding skipIfLocales calls (or suite-level beforeEach skip) can be removed and the tests will run on de/es as well.

Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes (e2e extended to de/es; existing tests unchanged except locale skip where needed)
  • Screenshots attached (for UI changes) — N/A

- Add app-config-e2e-de.yaml and app-config-e2e-es.yaml per workspace
- Update playwright.config to run e2e on all locales (en, de, es, fr, it, ja)
- Skip tests that fail due to missing de/es translation keys; add comment
  to re-enable after https://issues.redhat.com/browse/RHDHBUGS-2791

This change applies to adoption-insights workspace; same pattern can be
used for other workspaces with localized e2e.

Made-with: Cursor
@rhdh-qodo-merge
Copy link

Review Summary by Qodo

Add German and Spanish locale support for e2e tests

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• Add German and Spanish locale e2e test configurations
• Expand e2e test coverage to six locales (en, de, es, fr, it, ja)
• Reassign port mappings to accommodate new German and Spanish configs
• Skip three tests pending translation key fixes for de/es locales
Diagram
flowchart LR
  A["E2E Test Suite"] -->|"Add de/es configs"| B["6 Locale Support"]
  B -->|"Reassign ports"| C["Port Mapping Updated"]
  A -->|"Skip failing tests"| D["Pending Translation Fixes"]
  C -->|"en:3000, de:3001, es:3002, fr:3003, it:3004, ja:3005"| E["Playwright Config"]
Loading

Grey Divider

File Changes

1. workspaces/adoption-insights/e2e-tests/insights.test.ts 🧪 Tests +6/-3

Skip tests pending de/es translation fixes

• Skip three tests that fail due to missing German and Spanish translation keys
• Add comments referencing RHDHBUGS-2791 for future re-enablement
• Tests affected: 'Active users panel shows 1 visitor', 'Visited component shows up in top catalog
 entities', 'New data shows in searches'

workspaces/adoption-insights/e2e-tests/insights.test.ts


2. workspaces/adoption-insights/playwright.config.ts ⚙️ Configuration changes +36/-6

Configure Playwright for six locale e2e testing

• Add German (de) and Spanish (es) locale configurations to webServer array
• Reassign port mappings for all six locales to avoid conflicts
• Update baseURL mappings in projects array for de, es, fr, it, ja locales
• German uses ports 3001/7008, Spanish uses ports 3002/7009

workspaces/adoption-insights/playwright.config.ts


3. workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-de.yaml ⚙️ Configuration changes +10/-0

Add German locale e2e configuration

• Create new German locale configuration file
• Set frontend baseUrl to http://localhost:3001
• Set backend baseUrl and port to http://localhost:7008
• Configure CORS origin for German locale

workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-de.yaml


View more (4)
4. workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-es.yaml ⚙️ Configuration changes +10/-0

Add Spanish locale e2e configuration

• Create new Spanish locale configuration file
• Set frontend baseUrl to http://localhost:3002
• Set backend baseUrl and port to http://localhost:7009
• Configure CORS origin for Spanish locale

workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-es.yaml


5. workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-fr.yaml ⚙️ Configuration changes +5/-5

Update French locale port mappings

• Update French locale port mappings due to new de/es configs
• Change frontend baseUrl from 3001 to 3003
• Change backend baseUrl and port from 7008 to 7010
• Update CORS origin accordingly

workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-fr.yaml


6. workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-it.yaml ⚙️ Configuration changes +5/-5

Update Italian locale port mappings

• Update Italian locale port mappings due to new de/es configs
• Change frontend baseUrl from 3002 to 3004
• Change backend baseUrl and port from 7009 to 7011
• Update CORS origin accordingly

workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-it.yaml


7. workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-ja.yaml ⚙️ Configuration changes +5/-5

Update Japanese locale port mappings

• Update Japanese locale port mappings due to new de/es configs
• Change frontend baseUrl from 3003 to 3005
• Change backend baseUrl and port from 7010 to 7012
• Update CORS origin accordingly

workspaces/adoption-insights/e2e-tests/test_yamls/app-config-e2e-ja.yaml


Grey Divider

Qodo Logo

@rhdh-qodo-merge
Copy link

rhdh-qodo-merge bot commented Mar 9, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Missing de/es locale names🐞 Bug ✓ Correctness
Description
The PR adds de/es Playwright projects, but the locale switcher falls back to clicking an option
named the raw locale (e.g. "de"/"es"), because German/Spanish are not in the display-name map. Since
the app default language is configured as English, de/es runs will likely fail during locale
switching (or run in English while assertions use de/es translations).
Code

workspaces/adoption-insights/playwright.config.ts[R106-121]

+    {
+      name: 'de',
+      use: {
+        channel: 'chrome',
+        locale: 'de',
+        baseURL: 'http://localhost:3001',
+      },
+    },
+    {
+      name: 'es',
+      use: {
+        channel: 'chrome',
+        locale: 'es',
+        baseURL: 'http://localhost:3002',
+      },
+    },
Evidence
Playwright is configured to run additional projects for locales de and es. The test suite
switches language via switchToLocale, which uses a hardcoded LOCALE_DISPLAY_NAMES mapping to
find the *visible option label* in the Settings language picker. That map does not include de or
es, and the fallback returns the raw locale string, which is then used as the accessible name for
the option click. Separately, the app is configured with defaultLanguage: 'en', so non-English
projects must successfully switch languages to match expectations.

workspaces/adoption-insights/playwright.config.ts[97-121]
workspaces/adoption-insights/e2e-tests/utils/insightsHelpers.ts[21-34]
workspaces/adoption-insights/e2e-tests/utils/insightsHelpers.ts[96-109]
workspaces/adoption-insights/app-config.yaml[10-14]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New `de`/`es` Playwright projects were added, but the e2e language-switch helper cannot select German/Spanish because `LOCALE_DISPLAY_NAMES` lacks `de` and `es`, and the fallback uses the raw locale string as the option name.
### Issue Context
The app is configured with `defaultLanguage: 'en'`, so non-English projects must successfully switch the UI language in Settings.
### Fix Focus Areas
- workspaces/adoption-insights/e2e-tests/utils/insightsHelpers.ts[21-34]
- workspaces/adoption-insights/e2e-tests/utils/insightsHelpers.ts[96-109]
- (optional hardening) workspaces/adoption-insights/e2e-tests/utils/translations.ts[44-61]
- (optional hardening) workspaces/adoption-insights/e2e-tests/insights.test.ts[53-64]
### Suggested changes
- Add entries:
- `de: 'Deutsch'`
- `es: 'Español'`
- Consider changing the fallback to `baseLocale` (not the full locale like `de-DE`) to avoid clicking a value that cannot appear as an option label.
- Optionally normalize translation selection to `locale.split('-')[0]` so `de-DE`/`es-ES` works too.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Unconditional skips reduce coverage🐞 Bug ⛯ Reliability
Description
Three tests were converted to unconditional test.skip, so they will not run for *any* locale
(including en/fr/it/ja), reducing regression coverage beyond the stated de/es translation issue.
Consider skipping only for the affected projects/locales until the linked bug is fixed.
Code

workspaces/adoption-insights/e2e-tests/insights.test.ts[R114-116]

+// Will be re-enabled after https://issues.redhat.com/browse/RHDHBUGS-2791 is fixed
+test.skip('Active users panel shows 1 visitor', async () => {
 const panel = getPanel(page, translations.activeUsers.title);
Evidence
The PR changes multiple tests to test.skip(...) (not conditional), which disables them across the
whole matrix. The Playwright config defines projects for 6 locales, so these tests are skipped in
all 6 projects, not just de/es.

workspaces/adoption-insights/e2e-tests/insights.test.ts[114-116]
workspaces/adoption-insights/e2e-tests/insights.test.ts[214-216]
workspaces/adoption-insights/e2e-tests/insights.test.ts[262-264]
workspaces/adoption-insights/playwright.config.ts[97-146]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`test.skip(...)` is unconditional, so the tests are skipped for all locales/projects.
### Issue Context
The comment indicates the intent is to skip due to missing `de`/`es` translation keys until RHDHBUGS-2791 is fixed.
### Fix Focus Areas
- workspaces/adoption-insights/e2e-tests/insights.test.ts[114-116]
- workspaces/adoption-insights/e2e-tests/insights.test.ts[214-216]
- workspaces/adoption-insights/e2e-tests/insights.test.ts[262-264]
### Suggested changes
Convert to conditional skip using the project name, e.g. inside each test body:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

- Add app-config-e2e-de.yaml and app-config-e2e-es.yaml
- Update playwright.config to run e2e on all 6 locales (en, de, es, fr, it, ja)
- Update locale yaml port mapping; use __dirname for config paths
- Skip tests blocked by missing de/es translations; re-enable after RHDHBUGS-2792

Made-with: Cursor
@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Mar 9, 2026

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/bulk-import/packages/app none v0.0.3

…ghts, bulk-import, extensions)

- Add shared skipIfLocales(testInfo, locales, reason) in each workspace utils
- Use per-test skip for de/es instead of test.skip so tests run on en, fr, it, ja
- Fix Playwright fixture: use ({}, testInfo) instead of (_, testInfo)
- No extra describe grouping; tests stay in place with one-line skip at start

Made-with: Cursor
- Add de and es projects to playwright.config.ts
- Add Deutsch and Español to LOCALE_DISPLAY_NAMES in helpers for switchToLocale

Made-with: Cursor
- Add de and es projects to playwright.config.ts
- Add Deutsch and Español to LOCALE_DISPLAY_NAMES in globalHeaderHelper
- Add skipIfLocales for de/es on tests that use create.* (missing in de/es)
- Skip reason links to RHDHBUGS-2795

Made-with: Cursor
@HusneShabbir HusneShabbir requested a review from ciiay as a code owner March 10, 2026 09:50
@HusneShabbir HusneShabbir requested a review from yangcao77 as a code owner March 10, 2026 11:14
HusneShabbir added 2 commits March 11, 2026 00:38
@HusneShabbir HusneShabbir force-pushed the feat/e2e-de-es-locale branch from 1ba3d43 to 835ea1f Compare March 12, 2026 09:34
@sonarqubecloud
Copy link

Copy link
Member

@lokanandaprabhu lokanandaprabhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Mar 12, 2026
@jrichter1 jrichter1 merged commit 6394d89 into redhat-developer:main Mar 12, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants