Skip to content

Add data-page attribute for E2E test selectors#46

Merged
dtkav merged 2 commits intoNo-Instructions:mainfrom
mgmobrien:feature/test-attributes
Feb 3, 2026
Merged

Add data-page attribute for E2E test selectors#46
dtkav merged 2 commits intoNo-Instructions:mainfrom
mgmobrien:feature/test-attributes

Conversation

@mgmobrien
Copy link
Copy Markdown
Member

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.

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.
Copy link
Copy Markdown
Member

@dtkav dtkav left a comment

Choose a reason for hiding this comment

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

Slight mod -- it would be better if these were in the pages themselves:

Add data-view attributes to each settings view for stable E2E test selectors.

View Component Attribute
Home Relays.svelte data-view="relays"
Manage Relay ManageRelay.svelte data-view="manage-relay"
Manage Shared Folder ManageSharedFolder.svelte data-view="manage-shared-folder"
Manage Remote Folder ManageRemoteFolder.svelte data-view="manage-remote-folder"

Usage in tests:

await page.locator('[data-view="manage-relay"]').waitFor();

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>
@dtkav dtkav merged commit b009a92 into No-Instructions:main Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants