|
| 1 | +# Testing: https://w3c.github.io/core-aam/#role-map-grid |
| 2 | + |
| 3 | +TEST_HTML = "<div role='grid' id='test'> <div role='row' id='headerrow'> <div role='columnheader' id='colheader1'>content</div> <div role='columnheader' id='colheader2'>content</div> </div> <div role='row'> <div role='rowheader' id='rowheader1'>content</div> <div role='gridcell'>content</div> </div> <div role='row'> <div role='rowheader' id='rowheader2'>content</div> <div role='gridcell'>content</div> </div> </div>" |
| 4 | + |
| 5 | +def test_atspi(atspi, session, inline): |
| 6 | + session.url = inline(TEST_HTML) |
| 7 | + |
| 8 | + # Spec: |
| 9 | + # Role: ROLE_TABLE |
| 10 | + # Object Attribute: xml-roles:grid |
| 11 | + # Interface: Table |
| 12 | + # Interface: Selection |
| 13 | + # Because WAI-ARIA does not support modifying the selection via the accessibility API, user agents MUST return false for all Selection methods that provide a means to modify the selection. |
| 14 | + |
| 15 | + node = atspi.find_node("test", session.url) |
| 16 | + assert atspi.Accessible.get_role(node) == atspi.Role.TABLE |
| 17 | + assert "xml-roles:grid" in atspi.Accessible.get_attributes_as_array(node) |
| 18 | + assert atspi.Accessible.get_table_iface(node) is not None |
| 19 | + assert atspi.Accessible.get_selection_iface(node) is not None |
| 20 | + |
| 21 | +# def test_axapi(axapi, session, inline): |
| 22 | +# session.url = inline(TEST_HTML) |
| 23 | +# |
| 24 | +# # Spec: |
| 25 | +# # AXRole: AXTable |
| 26 | +# # AXSubrole: <nil> |
| 27 | +# # AXColumnHeaderUIElements: a list of pointers to the columnheader elements |
| 28 | +# # AXHeader: a pointer to the row or group containing those columnheader elements |
| 29 | +# # AXRowHeaderUIElements: a list of pointers to the rowheader elements |
| 30 | + |
| 31 | +# def test_ia2(ia2, session, inline): |
| 32 | +# session.url = inline(TEST_HTML) |
| 33 | +# |
| 34 | +# # Spec: |
| 35 | +# # Role: ROLE_SYSTEM_TABLE |
| 36 | +# # Object Attribute: xml-roles:grid |
| 37 | +# # Interface: IAccessibleTable2 |
| 38 | +# # Method: IAccessible::accSelect() |
| 39 | +# # Method: IAccessible::get_accSelection() |
| 40 | + |
| 41 | +# def test_uia(uia, session, inline): |
| 42 | +# session.url = inline(TEST_HTML) |
| 43 | +# |
| 44 | +# # Spec: |
| 45 | +# # Control Type: DataGrid |
| 46 | +# # Control Pattern: Grid |
| 47 | +# # Control Pattern: Table |
| 48 | +# # Control Pattern: Selection |
0 commit comments