Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

Add 'data-cy' attributes on DOM elements to support best practices with Cypress

Open mirnasilva opened this issue 7 years ago • 2 comments

Request

As part of task #793, to improve our E2E test scripts, we would like to request the addition of the attribute data-cy in the list of DOM elements at the table below.

By having this feature implemented, we'll be able to improve the maintainability of the test scripts.

The usage of data-cy can be seen here.

DOM Element Selector Attribute to be added
Series Button: .pull-left > .RoundedButtonGroup > .roundedButtonWrapper > .roundedButton data-cy="series-btn"
Left Panel: section.sidepanel.from-left data-cy="series-panel"
Measurements Button: .pull-right > .RoundedButtonGroup > .roundedButtonWrapper > .roundedButton data-cy="measurements-btn"
Viewport: .viewport-element data-cy="viewport"
Viewport Overlay information
div.viewport-element > div.ViewportOverlay > div.top-left.overlay-element data-cy="viewport-info-top-left"
div.viewport-element > div.ViewportOverlay > div.top-right.overlay-element data-cy="viewport-info-top-right"
div.viewport-element > div.ViewportOverlay > div.bottom-left.overlay-element data-cy="viewport-info-bottom-left"
div.viewport-element > div.ViewportOverlay > div.bottom-right.overlay-element data-cy="viewport-info-bottom-right"
Cornerstone toolbar
.toolbar-button:nth-child(2) data-cy="stackScroll-btn"
.toolbar-button:nth-child(3) data-cy="zoom-btn"
.toolbar-button:nth-child(4) data-cy="levels-btn"
.toolbar-button:nth-child(5) data-cy="pan-btn"
.toolbar-button:nth-child(6) data-cy="length-btn"
.toolbar-button:nth-child(7) data-cy="annotate-btn"
.toolbar-button:nth-child(8) data-cy="angle-btn"
.toolbar-button:nth-child(9) data-cy="reset-btn"
.toolbar-button:nth-child(10) data-cy="cine-btn"
.expandableToolMenu data-cy="more-btn"
.PluginSwitch > .toolbar-button data-cy="2dmpr-btn"
.btn-group > .toolbar-button data-cy="layout-btn"
.layoutChooser data-cy="layoutChooser-overlay"
More Tools overlay (Cornerstone toolbar)
body > div.fade.in.tooltip-toolbar-overlay.tooltip.bottom data-cy="more-tools-overlay"
.tooltip-inner > :nth-child(1) data-cy="magnify-btn"
.tooltip-inner > :nth-child(2) data-cy="roi-window-btn"
.tooltip-inner > :nth-child(3) data-cy="probe-btn"
.tooltip-inner > :nth-child(4) data-cy="ellipse-btn"
.tooltip-inner > :nth-child(5) data-cy="rectangle-btn"
.tooltip-inner > :nth-child(6) data-cy="invert-btn"
.tooltip-inner > :nth-child(7) data-cy="rotate-btn"
.tooltip-inner > :nth-child(8) data-cy="flipH-btn"
.tooltip-inner > :nth-child(9) data-cy="flipV-btn"
.tooltip-inner > :nth-child(10) data-cy="clear-btn"
.tooltip-inner > :nth-child(11) data-cy="bidirectional-btn"
.tooltip-inner > :nth-child(12) data-cy="eraser-btn"
Measurements Panel
.tableListItem data-cy="measurementItem"
.rowActions > :nth-child(1) data-cy="relabel-btn"
.rowActions > :nth-child(2) data-cy="description-btn"
Right-click overlay on viewport
.ToolContextMenu data-cy="context-menu-overlay"
:nth-child(1) > .form-action > span data-cy="delete-measurement"
:nth-child(2) > .form-action > span data-cy="relabel-measurement"
:nth-child(3) > .form-action > span data-cy="add-description-measurement"
VTK Toolbar
.ToolbarRow > :nth-child(2) data-cy="crosshairs-btn"
.ToolbarRow > :nth-child(3) data-cy="wwwc-btn"
.ToolbarRow > :nth-child(4) data-cy="rotate-btn"
.ToolbarRow > :nth-child(5) data-cy="disableMIP-btn"
.ToolbarRow > :nth-child(6) data-cy="enableMIP-btn"
.ToolbarRow > :nth-child(7) data-cy="increaseSlabThickness-btn"
.ToolbarRow > :nth-child(8) data-cy="decreaseSlabThickness-btn"
.ToolbarRow > .btn-group > .toolbar-button data-cy="layout-btn"
.ToolbarRow > .PluginSwitch > .toolbar-button data-cy="2dmpr-btn"

mirnasilva avatar Sep 27 '19 22:09 mirnasilva

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 31 '19 20:10 stale[bot]

We've been doing these as needed. I'm okay with this close as there was not a good way to action these in bulk and as stand-alone PRs

dannyrb avatar Nov 12 '19 02:11 dannyrb