6 min read #OpenCloud#a11y

OpenCloud · Accessibility

Automated accessibility tests

Barriers usually hide in small things like a button without a name or a dialog that only works with a mouse. Between OpenCloud 2.3.0 and 3.6.0, required fields got consistent markers, image cropping and the new “Open” menu became keyboard-operable, and operators can put a link to their accessibility statement in the user menu. Since 3.6.0, the web UI's test setup rejects any change in which the axe testing tool finds a WCAG 2.1 A/AA violation.

If you work with a screen reader, a keyboard or magnification, you notice quickly whether a piece of software was built with you in mind. Usually it fails on small things. A button that consists only of an icon gets announced as “button” with no name. A form only tells you after submitting which field you should have filled in. A dialog for cropping an image can only be operated with a mouse. Public sector bodies have an additional obligation: under EU Directive 2016/2102, their websites and applications must be accessible, and they must publish an accessibility statement that says how far they meet that requirement and where to report shortcomings.

OpenCloud set out to make accessibility part of the core rather than an afterthought. In the rolling releases from 2.3.0 to 3.6.0, this shows in three places: forms and controls, a place for the accessibility statement, and tests that keep new barriers from slipping in unnoticed.

Required fields and keyboard operation

Until now, some field labels had an asterisk hardcoded into the text, while others didn't have one at all. A screen reader read it out as part of the label. Since 2.3.0, the design system's text input has a dedicated option for the required-field marker (web#675), and since 3.1.0 every form in which a value must be set uses it (web#798), including select lists. That covers, for example, creating users and groups in the admin settings, new spaces, files and folders, renaming, the password for a link and creating app tokens. The red asterisk now sits in the same place next to the label everywhere and is hidden from screen readers. As of this version, the component does not set aria-required, so the screen reader does not announce the field as required.

Dialog “Create user” in OpenCloud 3.0.0: labels “User name*”, “First and last name*”, “Email*” and “Password*”, with a black asterisk attached directly to the text.

Up to 3.0: the asterisk is part of the label (OpenCloud 3.0.0).

The same dialog in OpenCloud 3.1.0: a red asterisk with a bit of spacing after each label.

Since 3.1.0: a red asterisk next to the label, hidden from screen readers (OpenCloud 3.1.0).

Since 3.0.0 you can crop space images and profile pictures. Shortly after the feature shipped, an issue reported that cropping only worked with a mouse and pointed to the keyboard criterion of WCAG 2.1 (web#804). Since 3.0.0, cropping also works with the keyboard (web#805): the arrow keys move the image by 10 pixels at a time, and + and - zoom in steps of 10 percent. The dialog lists these keys itself, so you don't need to know them.

Cropping a profile picture with the keyboard only: + and - zoom, the arrow keys move the image. The key overlays were added for the recording (OpenCloud 3.1.0).

With 3.1.0, the file context menu replaced several “Open with...” entries with a single “Open” entry that has a submenu with the matching apps (web#820). The requirement for it stated explicitly that the submenu must be operable by keyboard and with a screen reader. On the desktop, it therefore opens not only on mouse hover but also when the entry receives keyboard focus.

Context menu with the keyboard only: Tab to the three-dot menu of “Readme.txt”, Enter opens it, and as soon as “Open with...” receives focus, the submenu with “Text Editor” and “CollaboraOnline” expands. The key overlays were added for the recording (OpenCloud 3.7.0).

The accessibility statement has to be findable where the application is used. Since 3.1.0, the OpenCloud theme has a dedicated entry for this, common.urls.accessibility (opencloud#1108). If it is set, an “Accessibility” link appears at the bottom of the user menu next to “Imprint” and “Privacy” (web#861). In the bundled theme the entry is empty, so the link only appears once the operator fills it in.

Alan Turing’s open user menu with “Preferences” and “Log out”, at the bottom the links “Imprint”, “Privacy” and, highlighted, “Accessibility”.

With an address configured, “Accessibility” appears at the bottom of the user menu next to “Imprint” and “Privacy” (OpenCloud 3.1.0, English UI).

You set it in the theme.json file. Custom themes go in the directory defined by WEB_ASSET_THEMES_PATH, which defaults to $OC_BASE_DATA_PATH/web/assets/themes. If that directory contains opencloud/theme.json, it replaces the bundled file. The safest approach is to copy the bundled theme.json and only add the address:

"urls": {
  "imprint": "https://example.org/impressum",
  "privacy": "https://example.org/datenschutz",
  "accessibility": "https://example.org/barrierefreiheit"
}

OpenCloud does not ship the text of the statement. It depends on your own setup, the version in use, the enabled apps and the contact for feedback, so it has to come from the organization that runs OpenCloud.

Automated a11y tests in CI

Individual improvements don't help much if the next change adds a new barrier somewhere else. Since 3.1.0, automated tests therefore check the web UI with axe, a widely used accessibility testing tool (web#819), and since 3.2.0 they run in CI on every change (web#886). The tests check against the rules for WCAG 2.0 and 2.1 at levels A and AA as well as axe's best practices. These include missing names on buttons and links, invalid attributes and insufficient color contrast.

With 3.5.0, the tests were extended to large parts of the UI (web#1164): personal files and spaces, shared content, trash bin, search, the right sidebar with shares, versions and activities, public links, the account menu and user, group and space management, plus the login page. The first full run found 13 critical, 19 serious and 6 minor violations. The most common were buttons without a recognizable name, such as the pencil icon for renaming in the file list, links without text, empty table headers and focusable elements that were hidden from screen readers.

OpenCloud 3.6.0 fixes these findings. Buttons and table headers in the file list and in the admin settings now have names, the avatar groups on shares read out the people's names, and a loading spinner without a label is hidden from screen readers (web#1296). On the login page, username and password now carry valid autocomplete values (opencloud#1588). That also helps password managers and browsers fill them in. After that, the test setup was switched over: previously the tests only reported violations, now the check fails on any violation (web#1319). If you introduce a new barrier that axe can detect into one of the tested views, your change won't get through.

Automated checks only find part of the problems, though. Whether the reading order makes sense, whether a workflow can be completed quickly with the keyboard or whether a message is understandable can't be determined this way. The tests don't replace testing by people with screen readers and keyboards. They also only cover the web UI. Embedded editors such as Collabora bring their own accessibility.

Sources