-
Notifications
You must be signed in to change notification settings - Fork 671
PivotGrid - A11y: describe field areas, open field context menu from keyboard, axe tests #34375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aleksei-semikozov
wants to merge
22
commits into
DevExpress:main
Choose a base branch
from
aleksei-semikozov:pivotgrid-a11y-4196-polish
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3025411
PivotGrid - KBN - Add ARIA attributes to area fields
eaa4083
PivotGrid - KBN - Fix ascending sort ARIA field message key typo
ffafcff
Merge branch 'main' into pivotgrid-kbn-fields-aria-attrs-main
745ab50
PivotGrid - KBN - Reset stale menubar role on hidden field areas
683a793
Merge remote-tracking branch 'upstream/main' into pivotgrid-a11y-4196…
aleksei-semikozov 81b084a
PivotGrid - Add axe accessibility tests
827e285
PivotGrid - Describe field area keyboard interactions via aria-descri…
089cf97
PivotGrid - Open field context menu from keyboard
982706d
PivotGrid - Handle the context menu handler option change and dispatc…
1a46891
PivotGrid - Describe data cells with their row and column headers
c201add
PivotGrid - Resolve area sections defensively for partially stubbed a…
e32ae6d
PivotGrid - Revert data-cell aria-describedby; deliver field-area key…
3ec81ca
Merge branch 'main' into pivotgrid-a11y-4196-polish
06e0710
PivotGrid - Stabilize axe a11y tests and guard empty field-area caption
1835da0
PivotGrid - Disable best-practice region rule for overlay axe scenarios
f312718
PivotGrid - Trim self-evident comments and address review nits (preve…
898b050
PivotGrid - Stop announcing expandable header cell captions twice
edd81fc
PivotGrid - Reserve aria-colindex columns for row headers so they are…
ff497a7
PivotGrid - Drop explanatory comments from a11y source changes
b9ef650
PivotGrid - Announce field hotkeys once on the component instead of p…
d80a192
PivotGrid - Derive reserved row-header width from the model and guard…
4b5d464
PivotGrid - Rename the field hotkeys aria message to dxPivotGrid-aria…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
116 changes: 116 additions & 0 deletions
116
e2e/testcafe-devextreme/tests/accessibility/pivotGrid.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| import PivotGrid from 'devextreme-testcafe-models/pivotGrid'; | ||
| import { Selector } from 'testcafe'; | ||
| import url from '../../helpers/getPageUrl'; | ||
| import { createWidget } from '../../helpers/createWidget'; | ||
| import { a11yCheck } from '../../helpers/accessibility/utils'; | ||
|
|
||
| fixture.disablePageReloads`PivotGrid - Accessibility` | ||
| .page(url(__dirname, '../container.html')); | ||
|
|
||
| const PIVOT_GRID_SELECTOR = '#container'; | ||
|
|
||
| const createConfig = () => ({ | ||
| width: 1000, | ||
| allowSorting: true, | ||
| allowSortingBySummary: true, | ||
| allowFiltering: true, | ||
| allowExpandAll: true, | ||
| showBorders: true, | ||
| fieldPanel: { | ||
| visible: true, | ||
| }, | ||
| fieldChooser: { | ||
| enabled: true, | ||
| height: 500, | ||
| }, | ||
| dataSource: { | ||
| fields: [{ | ||
| dataField: 'country', | ||
| area: 'filter', | ||
| }, { | ||
| caption: 'Region', | ||
| width: 120, | ||
| dataField: 'region', | ||
| area: 'row', | ||
| }, { | ||
| caption: 'City', | ||
| dataField: 'city', | ||
| width: 150, | ||
| area: 'row', | ||
| }, { | ||
| caption: 'Country', | ||
| dataField: 'country', | ||
| area: 'column', | ||
| }, { | ||
| dataField: 'date', | ||
| dataType: 'date', | ||
| area: 'column', | ||
| }, { | ||
| groupName: 'date', | ||
| groupInterval: 'year', | ||
| expanded: true, | ||
| area: 'column', | ||
| }, { | ||
| caption: 'Sales', | ||
| dataField: 'amount', | ||
| dataType: 'number', | ||
| summaryType: 'sum', | ||
| area: 'data', | ||
| }], | ||
| store: [{ | ||
| region: 'Africa', | ||
| country: 'Egypt', | ||
| city: 'Cairo', | ||
| amount: 500, | ||
| date: new Date('2015-05-26'), | ||
| }, { | ||
| region: 'South America', | ||
| country: 'Argentina', | ||
| city: 'Buenos Aires', | ||
| amount: 780, | ||
| date: new Date('2015-05-07'), | ||
| }], | ||
| }, | ||
| }); | ||
|
|
||
| test('grid with field panel', async (t) => { | ||
| await a11yCheck(t, {}, PIVOT_GRID_SELECTOR); | ||
| }).before(async () => createWidget('dxPivotGrid', createConfig())); | ||
|
|
||
| // The popup/menu widgets are portaled to <body>, outside the harness page | ||
| // landmarks, so the best-practice 'region' rule fires on them regardless of | ||
| // the widget's own accessibility (same convention as dataGrid/cardView a11y | ||
| // tests). It is disabled for the overlay scenarios. | ||
| const overlayA11yOptions = { rules: { region: { enabled: false } } }; | ||
|
|
||
| test('field chooser popup', async (t) => { | ||
| const pivotGrid = new PivotGrid(PIVOT_GRID_SELECTOR); | ||
|
|
||
| await t.click(pivotGrid.getFieldChooserButton()); | ||
|
|
||
| await a11yCheck(t, overlayA11yOptions); | ||
| }).before(async () => createWidget('dxPivotGrid', createConfig())); | ||
|
|
||
| test('header filter popup', async (t) => { | ||
| const pivotGrid = new PivotGrid(PIVOT_GRID_SELECTOR); | ||
| const filterIcon = pivotGrid | ||
| .getColumnHeaderArea() | ||
| .getHeaderFilterIcon() | ||
| .element; | ||
|
|
||
| await t.click(filterIcon); | ||
|
|
||
| await t.expect(Selector('.dx-header-filter-menu .dx-list-item').visible).ok(); | ||
|
|
||
| await a11yCheck(t, overlayA11yOptions); | ||
| }).before(async () => createWidget('dxPivotGrid', createConfig())); | ||
|
|
||
| test('cell context menu', async (t) => { | ||
| const columnHeaderCell = Selector('.dx-pivotgrid-horizontal-headers td[tabindex]'); | ||
|
|
||
| await t.rightClick(columnHeaderCell); | ||
|
|
||
| await t.expect(Selector('.dx-context-menu .dx-menu-item').visible).ok(); | ||
|
|
||
| await a11yCheck(t, overlayA11yOptions); | ||
| }).before(async () => createWidget('dxPivotGrid', createConfig())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.