Skip to content

Adding HTML Attributes (data-ms-id) to Elements to Make UI Testing Easier #12203

Description

@MarkBremer

MIP - Adding HTML Attributes (cy-data) to Elements to Make UI Testing Easier

Overview

This proposal adds Cypress selectors across the UI by adding consistent 'data-ms-id' attributes to key elements

We are currently working on automated UI testing with Cypress for GeoNode, and right now even small UI changes can break tests.
By adding consistent attributes, we decouple tests from visual/layout changes and make the suite more robust and maintainable.

Here are some proposals: cy-tags.pdf
These are already implemented in a forked project.
Of course, we can discuss the naming conventions.

Here is an example:

"data-ms-id": "btn-add-resource"
"data-ms-id": "btn-add-resource-upload-dataset"
"data-ms-id": "btn-add-resource-upload-document"
"data-ms-id": "btn-add-resource-create-dataset"

Affected projects:

  • MapStore2
  • Geonode MapStore Client

Proposed By

@ffischer1984
@jo-schie
@mapme-initiative

Assigned to Release

State

  • Under Discussion
  • In Progress
  • Completed
  • Rejected
  • Deferred

Motivation

The current UI is missing consistent HTML attributes for automated testing, which makes Cypress tests fragile and harder to maintain.

Key benefits:
Higher test stability: selectors are explicit and less sensitive to layout or style changes.
Better maintainability: a consistent naming convention reduces ambiguity and duplicate selector logic.
Safer UI evolution: teams can refactor visuals/classes without breaking end-to-end tests.

Proposal

Backwards Compatibility

This change is fully backward compatible.

It only adds HTML attributes and does not alter API contracts, routing, permissions, or user-facing behavior. Existing functionality remains unchanged, while automated tests gain stable selectors.

Future evolution

Feedback

Voting

Project Steering Committee:

Links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions