feat: Extract available options/items for selection components in page scanner#219
feat: Extract available options/items for selection components in page scanner#219gethinwebster wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #219 +/- ##
==========================================
+ Coverage 98.90% 98.97% +0.07%
==========================================
Files 44 44
Lines 1190 1272 +82
Branches 320 348 +28
==========================================
+ Hits 1177 1259 +82
Misses 12 12
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ba3a78f to
8ac882e
Compare
…abs, and Table
Add DOM-based extraction of available items to the page scanner for
selection-style components. This enables consumers to see all available
choices, not just the currently selected one.
Components affected:
- RadioGroup/Tiles: options array with {value, label, description?}
- Cards: items array with {value, label, description?}
- Tabs: tabs array with {value, label, position}
- Table: rows array (opt-in via includeTableData option)
The getComponentsTree function now accepts an optional second parameter
GetComponentsTreeOptions to control opt-in features like table data.
8ac882e to
9cf66dc
Compare
|
"Components unit tests" are expected to fail, as those are snapshot tests that use/verify this scanner output. To merge we will temporarily disable checks then update snapshot & re-enable. |
| if (columns.length) { | ||
| acc[key].columnLabels = columns; | ||
| } | ||
| if (options?.includeAllTableRows) { |
There was a problem hiding this comment.
Why does only table have its item fetched gated behind an opt-in flag? The other component types add context by default.
Also, is it worth checking the component metadata name like we do for the other components below?
There was a problem hiding this comment.
Table data could potentially be relatively large, so I want to be cautious about performance and ensure it's only extracted if requested.
The metadata name check is there a few lines above
There was a problem hiding this comment.
Ah, it's nested, didn't realize!
Description
Add DOM-based extraction of available options/items to the page scanner for selection-style components. This enables page scanner consumers to see all available choices on a page, not just the currently selected ones.
Components affected:
awsui.RadioGroup/awsui.Tiles/awsui.Cards: newoptionsproperty —Array<{value, label, description?}>awsui.Tabs: newtabsproperty —Array<{value, label, disabled?}>awsui.Table: newrowsproperty —Array<Array<string>>(opt-in viaincludeAllTableRowsoption)API change:
getComponentsTreenow accepts an optional second parameterGetComponentsTreeOptions:The extraction uses stable ARIA semantics (
aria-labelledby,aria-label,aria-describedby,aria-disabled) and existing DOM structure — no changes required to component source code.Related links, issue #, if available: n/a
How has this been tested?
Review checklist
Correctness
getComponentsTreesecond parameter is optional, existing callers are unaffected.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.