oroinc / platform

Main OroPlatform package with core functionality.
Other
628 stars 351 forks source link

Add widget type unique ID to html for better testing #516

Open StephenOTT opened 8 years ago

StephenOTT commented 8 years ago

Currently there does not appear to be anything that tells us the specific Widget that was sent to the dashboard. Would be great if there was a class/div/...etc that was applied that allows us to be able to check/target for a specific type of widget.

Grygir commented 8 years ago

Hi @StephenOTT. Could you provide an example of widgets identification and test case that uses that identification?

For now, in widget configuration we have widgetName attribute, with values 'recent_emails', 'my_calendar' etc. Would it be enough for you case to have this value in some data attribute on widget element, e.g. data-dashboard-widget-type="recent_emails"?

StephenOTT commented 8 years ago

The type as you listed I think would be good.

The use cases is for testing. Say you are testing that specific widgets are loading in your config. You could target based on titles until you have two widgets with the same title and are different widget types. So being able to identify a widget type would be helpful