[PR #5553] [CLOSED] test(client): add data-testid attributes across client UI for stable E2E selectors #6815

Closed
opened 2026-10-23 04:13:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5553
Author: @Kranael
Created: 8/26/2026
Status: ❌ Closed

Base: staging ← Head: test-architecture-refactor-stage


📝 Commits (5)

  • 8d7d32e Add data-testid attributes for improved testability across components
  • 8972bb2 Add data-testid attributes for improved testing in Tracker Panel components
  • dc7db49 Add data-testid attributes for improved testing and accessibility
  • 07a3605 Apply Prettier formatting to data-testid changes
  • 98e9a03 test(client): make data-testid selectors unique per instance (CodeRabbit review)

📊 Changes

273 files changed (+4410 additions, -151 deletions)

View changed files

📝 packages/client/src/App.tsx (+2 -0)
📝 packages/client/src/components/agents/AgentCatalogView.tsx (+19 -1)
📝 packages/client/src/components/agents/AgentEditor.tsx (+99 -1)
📝 packages/client/src/components/agents/AgentModeFilter.tsx (+1 -0)
📝 packages/client/src/components/agents/ContextInjectionPanel.tsx (+5 -0)
📝 packages/client/src/components/agents/ContinuityIssueChecklist.tsx (+3 -0)
📝 packages/client/src/components/agents/CustomAgentRepositoriesModal.tsx (+5 -0)
📝 packages/client/src/components/agents/FeatureAgentDetailHost.tsx (+2 -0)
📝 packages/client/src/components/agents/RegexScriptEditor.tsx (+34 -1)
📝 packages/client/src/components/agents/SecretPlotPanel.tsx (+8 -0)
📝 packages/client/src/components/agents/StoryboardAgentSettingsPanel.tsx (+49 -0)
📝 packages/client/src/components/agents/ToolEditor.tsx (+25 -1)
📝 packages/client/src/components/bot-browser/BotBrowserView.tsx (+63 -3)
📝 packages/client/src/components/capabilities/CapabilityElement.tsx (+8 -0)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+147 -3)
📝 packages/client/src/components/characters/CharacterLibraryView.tsx (+10 -0)
📝 packages/client/src/components/characters/CharacterRegexSection.tsx (+13 -1)
📝 packages/client/src/components/characters/ConvoProfileFields.tsx (+10 -0)
📝 packages/client/src/components/chat/ActiveLorebookEntriesButton.tsx (+1 -0)
📝 packages/client/src/components/chat/AgentAddSetupFields.tsx (+56 -1)

...and 80 more files

📄 Description

Why

Automated UI testing needs stable, dedicated identifiers on interactive elements. Without them, Playwright tests must fall back to brittle CSS/XPath/positional/text selectors. This change instruments the client UI with data-testid attributes so future E2E coverage can target elements deterministically.

What changed

  • Added data-testid attributes to interactive elements (buttons, inputs, textareas, selects, clickable elements) across packages/client/src/ — 273 files, ~4,200 insertions.
  • Added optional testId / testIdPrefix passthrough props to a few shared local helper components so the testid lands on the actually rendered DOM element (no behavior change, props are optional and unused props default to nothing).
  • Applied Prettier formatting to the touched files.

Precisely:

  • data-testid added to production HTML → functionally inert (data-* attributes carry no behavior, no styling, no logic).
  • pnpm check → validates TypeScript compilation and linting of the changes.
  • Application functional tests → not required for this change: the attributes do not alter any runtime behavior, so there is zero impact on the production build beyond the attribute strings themselves.

Validation

  • pnpm check (clean stale artifacts, impeccable check, localization check, Prettier format check, ESLint, TypeScript + full production build) — run locally, passed; re-run by reviewer/CI
  • Manually verify in browser that UI renders and behaves unchanged (spot-check a few instrumented screens, e.g. settings panel, character editor, chat)

Notes

  • No linked issue exists for this work — if maintainers prefer, an issue can be opened to track the test-architecture effort.
  • No regression tests added: the change is test-infrastructure-only (inert HTML attributes), TypeScript compilation plus linting is the appropriate validation level.

Summary by CodeRabbit

  • Tests
    • Expanded automated UI test coverage across chat, game, agent, character, connection, lorebook, media, settings, tracker, and navigation experiences.
    • Improved test reliability for interactive workflows, including forms, dialogs, editors, pickers, uploads, playback controls, search, recovery actions, and import/export flows.
    • Standardized identification of controls throughout the interface, with no changes to user-facing functionality.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5553 **Author:** [@Kranael](https://github.com/Kranael) **Created:** 8/26/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `test-architecture-refactor-stage` --- ### 📝 Commits (5) - [`8d7d32e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8d7d32e2e2e3d055d227238e28412ec335f04d99) Add data-testid attributes for improved testability across components - [`8972bb2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8972bb2f8a7c085ccda61a9b0506c639d4ad4f9b) Add data-testid attributes for improved testing in Tracker Panel components - [`dc7db49`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dc7db497c66717ad14caeb5946cfe43c18e7817b) Add data-testid attributes for improved testing and accessibility - [`07a3605`](https://github.com/Pasta-Devs/Marinara-Engine/commit/07a3605b08169850e8d1d517b16e00a153925f03) Apply Prettier formatting to data-testid changes - [`98e9a03`](https://github.com/Pasta-Devs/Marinara-Engine/commit/98e9a0349a64279b288cd86070c7debdd1f17bbe) test(client): make data-testid selectors unique per instance (CodeRabbit review) ### 📊 Changes **273 files changed** (+4410 additions, -151 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/App.tsx` (+2 -0) 📝 `packages/client/src/components/agents/AgentCatalogView.tsx` (+19 -1) 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+99 -1) 📝 `packages/client/src/components/agents/AgentModeFilter.tsx` (+1 -0) 📝 `packages/client/src/components/agents/ContextInjectionPanel.tsx` (+5 -0) 📝 `packages/client/src/components/agents/ContinuityIssueChecklist.tsx` (+3 -0) 📝 `packages/client/src/components/agents/CustomAgentRepositoriesModal.tsx` (+5 -0) 📝 `packages/client/src/components/agents/FeatureAgentDetailHost.tsx` (+2 -0) 📝 `packages/client/src/components/agents/RegexScriptEditor.tsx` (+34 -1) 📝 `packages/client/src/components/agents/SecretPlotPanel.tsx` (+8 -0) 📝 `packages/client/src/components/agents/StoryboardAgentSettingsPanel.tsx` (+49 -0) 📝 `packages/client/src/components/agents/ToolEditor.tsx` (+25 -1) 📝 `packages/client/src/components/bot-browser/BotBrowserView.tsx` (+63 -3) 📝 `packages/client/src/components/capabilities/CapabilityElement.tsx` (+8 -0) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+147 -3) 📝 `packages/client/src/components/characters/CharacterLibraryView.tsx` (+10 -0) 📝 `packages/client/src/components/characters/CharacterRegexSection.tsx` (+13 -1) 📝 `packages/client/src/components/characters/ConvoProfileFields.tsx` (+10 -0) 📝 `packages/client/src/components/chat/ActiveLorebookEntriesButton.tsx` (+1 -0) 📝 `packages/client/src/components/chat/AgentAddSetupFields.tsx` (+56 -1) _...and 80 more files_ </details> ### 📄 Description ## Why Automated UI testing needs stable, dedicated identifiers on interactive elements. Without them, Playwright tests must fall back to brittle CSS/XPath/positional/text selectors. This change instruments the client UI with `data-testid` attributes so future E2E coverage can target elements deterministically. ## What changed - Added `data-testid` attributes to interactive elements (buttons, inputs, textareas, selects, clickable elements) across `packages/client/src/` — 273 files, ~4,200 insertions. - Added optional `testId` / `testIdPrefix` passthrough props to a few shared local helper components so the testid lands on the actually rendered DOM element (no behavior change, props are optional and unused props default to nothing). - Applied Prettier formatting to the touched files. Precisely: - `data-testid` added to production HTML → **functionally inert** (`data-*` attributes carry no behavior, no styling, no logic). - `pnpm check` → validates TypeScript compilation and linting of the changes. - Application functional tests → **not required** for this change: the attributes do not alter any runtime behavior, so there is zero impact on the production build beyond the attribute strings themselves. ## Validation - [x] `pnpm check` (clean stale artifacts, impeccable check, localization check, Prettier format check, ESLint, TypeScript + full production build) — run locally, passed; re-run by reviewer/CI - [x] Manually verify in browser that UI renders and behaves unchanged (spot-check a few instrumented screens, e.g. settings panel, character editor, chat) ## Notes - No linked issue exists for this work — if maintainers prefer, an issue can be opened to track the test-architecture effort. - No regression tests added: the change is test-infrastructure-only (inert HTML attributes), TypeScript compilation plus linting is the appropriate validation level. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Expanded automated UI test coverage across chat, game, agent, character, connection, lorebook, media, settings, tracker, and navigation experiences. * Improved test reliability for interactive workflows, including forms, dialogs, editors, pickers, uploads, playback controls, search, recovery actions, and import/export flows. * Standardized identification of controls throughout the interface, with no changes to user-facing functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:13:58 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6815
No description provided.