Skip to content

Add data-view attributes for E2E test selectors#56

Open
mgmobrien wants to merge 2 commits intoNo-Instructions:mainfrom
mgmobrien:feature/test-attributes
Open

Add data-view attributes for E2E test selectors#56
mgmobrien wants to merge 2 commits intoNo-Instructions:mainfrom
mgmobrien:feature/test-attributes

Conversation

@mgmobrien
Copy link
Member

Summary

Adds data-view attributes to Svelte components, providing stable selectors for E2E tests.

  • data-view="relays" on main relays list
  • data-view="manage-relay" on relay management view

This allows tests to target views reliably without depending on class names that may change.

Testing

E2E suite run against this branch (relay-e2e-testing):

Level Result
Level 2 7/7 pass + 1 expected fail
Level 3 1/1 pass (two-user sync)

Verified attributes appear in DOM:

data-view="relays"        # main relays list view
data-view="manage-relay"  # individual relay management view

🤖 Generated with Claude Code

mgmobrien and others added 2 commits February 3, 2026 19:49
Adds a data-page attribute to the settings container that exposes
which view is currently active. This gives E2E tests a stable way
to detect the current page without fingerprint-matching on content.

Values: relay-home, relay-detail, folder-detail, shared-folder-orphan

No user-visible changes - just a data attribute for test automation.
Per review feedback, each view component now owns its own data-view
attribute rather than having the parent calculate it. This is cleaner
because:
- Each component owns its identity
- No central routing logic needed for test selectors
- Adding new views doesn't require touching PluginSettings

Attributes:
- Relays.svelte: data-view="relays"
- ManageRelay.svelte: data-view="manage-relay"
- ManageSharedFolder.svelte: data-view="manage-shared-folder"
- ManageRemoteFolder.svelte: data-view="manage-remote-folder"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mgmobrien mgmobrien requested a review from dtkav February 4, 2026 04:17
@dtkav dtkav added the low risk label Feb 4, 2026
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.

2 participants