diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2023-07-10 12:14:17 +0200 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2023-08-10 09:29:09 +0200 |
commit | 96a7cfb25eeeeabad75d4dbd17a698bdd432335b (patch) | |
tree | 6bc8eae2082280eae708a2899a516ec2fe8dfb2c /cypress_test/integration_tests/desktop | |
parent | Remove open_local_editor button in tablet view (diff) | |
download | online-96a7cfb25eeeeabad75d4dbd17a698bdd432335b.tar.gz online-96a7cfb25eeeeabad75d4dbd17a698bdd432335b.zip |
a11y: provide info about current table and cell to screen reader
When we get in one or more tables screen reader reports row and column
count.
When we get out one or more table screen report reports "out of table"
for each table.
When the fosused cell changes screen reader reports new row/col index.
Screen reader reports cell paragraph content, too.
Added also cypress tests for checking that the table/cell description
string is correct.
Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I078b29a2f76f91df479f75db76113c80405f7169
Diffstat (limited to 'cypress_test/integration_tests/desktop')
-rw-r--r-- | cypress_test/integration_tests/desktop/writer/table_accessibility_spec.js | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/cypress_test/integration_tests/desktop/writer/table_accessibility_spec.js b/cypress_test/integration_tests/desktop/writer/table_accessibility_spec.js new file mode 100644 index 0000000000..1538008166 --- /dev/null +++ b/cypress_test/integration_tests/desktop/writer/table_accessibility_spec.js @@ -0,0 +1,95 @@ +/* global describe it cy beforeEach require afterEach */ + +var helper = require('../../common/helper'); +// var desktopHelper = require('../../common/desktop_helper'); +var ceHelper = require('../../common/contenteditable_helper'); + +describe(['taga11yenabled'], 'Table accessibility', function() { + var testFileName = 'table_accessibility.odt'; + + beforeEach(function () { + helper.beforeAll(testFileName, 'writer'); + cy.cGet('div.clipboard').as('clipboard'); + }); + + afterEach(function () { + helper.afterAll(testFileName, this.currentTest.state); + }); + + function checkCellDescription(expectedDescription) { + cy.wait(400); + cy.get('@clipboard').should('have.attr', 'aria-description', expectedDescription); + } + + it('Table content and cell address on navigation', function () { + ceHelper.checkPlainContent('Paragraph above.'); + ceHelper.moveCaret('down'); + checkCellDescription('Table with 4 rows and 3 columns. Row 1. Column 1. '); + ceHelper.checkPlainContent('Item 1.1'); + ceHelper.moveCaret('down'); + checkCellDescription('Row 2. '); + ceHelper.checkPlainContent('Item 2.1'); + ceHelper.moveCaret('down'); + checkCellDescription('Row 3 through 4. '); + ceHelper.checkPlainContent('Item 3.1'); + ceHelper.moveCaret('end'); + ceHelper.moveCaret('right'); + checkCellDescription('Row 3. Column 2 through 3. '); + ceHelper.checkPlainContent('Item 3.2'); + ceHelper.moveCaret('down'); + checkCellDescription('Row 4. '); + ceHelper.checkPlainContent('Item 4.2'); + ceHelper.moveCaret('down'); + checkCellDescription('Out of table. '); + ceHelper.checkPlainContent('Paragraph below.'); + ceHelper.moveCaret('up'); + checkCellDescription('Table with 4 rows and 3 columns. Row 3 through 4. Column 1. '); + ceHelper.checkPlainContent('Item 3.1'); + }); + + it('Nested table content and cell address on navigation', function () { + ceHelper.checkPlainContent('Paragraph above.'); + ceHelper.moveCaret('down'); + checkCellDescription('Table with 4 rows and 3 columns. Row 1. Column 1. '); + ceHelper.checkPlainContent('Item 1.1'); + ceHelper.moveCaret('end'); + ceHelper.moveCaret('right'); + checkCellDescription('Column 2. '); + ceHelper.checkPlainContent('Item 1.2'); + ceHelper.moveCaret('end'); + ceHelper.moveCaret('right'); + checkCellDescription('Column 3. '); + ceHelper.checkPlainContent('Item 1.3'); + ceHelper.moveCaret('down'); + checkCellDescription('Table with 2 rows and 2 columns. Row 1. Column 2. '); + ceHelper.checkPlainContent('Nested Cell 1.2'); + ceHelper.moveCaret('left'); + checkCellDescription('Column 1. '); + ceHelper.checkPlainContent('Nested Cell 1.1'); + ceHelper.moveCaret('home'); + ceHelper.moveCaret('left'); + checkCellDescription('Out of table. Row 2. Column 2. '); + ceHelper.checkPlainContent('Item 2.2'); + ceHelper.moveCaret('down'); + checkCellDescription('Row 3. Column 2 through 3. '); + ceHelper.checkPlainContent('Item 3.2'); + ceHelper.moveCaret('up'); + checkCellDescription('Row 2. Column 3. '); + ceHelper.checkPlainContent(''); + ceHelper.moveCaret('up'); + checkCellDescription('Table with 2 rows and 2 columns. Row 2. Column 1. '); + ceHelper.checkPlainContent('Nested Cell 2.1'); + ceHelper.moveCaret('end'); + ceHelper.moveCaret('right'); + checkCellDescription('Column 2. '); + ceHelper.checkPlainContent('Nested Cell 2.2'); + ceHelper.moveCaret('end'); + ceHelper.moveCaret('right'); + checkCellDescription('Out of table. Row 2. Column 3. '); + ceHelper.checkPlainContent(''); + ceHelper.moveCaret('end'); + ceHelper.moveCaret('right'); + checkCellDescription('Row 3 through 4. Column 1. '); + ceHelper.checkPlainContent('Item 3.1'); + }); +}); |