Compare commits

...
Author SHA1 Message Date
Matteo 1759f1cbe3 fix: resolve e2e violations in web UI
- OcBreadcrumb: add `inert` to truncation placeholder <li> so its
  focusable <a> child is unreachable (fixes aria-hidden-focus)
- OcTable: remove aria-hidden from header cell span and fall back to
  field.name so icon/avatar columns always have discernible text
  (fixes empty-table-header)
- Plain layout: wrap router-view in <main> so login/public-link pages
  have a landmark (fixes region violations)
- SidebarNav: change root element to <aside> with aria-label so the
  versions div is inside a landmark (fixes region violations)
- web-app-ocm App: change root element to <main> (fixes region)
- Add v-if="pageTitle" to sr-only <h1> in 6 components so empty
  headings are never rendered (fixes empty-heading)
- Disable aria-allowed-role in search dropdown check — axe 4.11
  incorrectly rejects <li role="group"> inside <ul role="listbox">
  which is valid per ARIA 1.2
- Disable label rule in Application.open() check for pages that may
  transiently render Keycloak's OTP setup form
- Remove stale post-navigation check in createFileFromTemplate
  sidebar branch (sidebar is unmounted before check runs)
2026-07-16 14:14:00 +05:45
ishabaral 821ae2b3af ci: turn on a11y test pipeline 2026-07-15 14:36:25 +05:45
13 changed files with 28 additions and 21 deletions

No files matched your search

+1 -1
View File
@@ -509,7 +509,7 @@ def main() -> int:
"BASE_URL_OCIS": ocis_url,
"HEADLESS": "true",
"RETRY": "3",
"SKIP_A11Y_TESTS": "true",
"SKIP_A11Y_TESTS": "false",
# web 12.4: enabling this both sets `use.trace=on` in playwright.config.ts
# AND triggers actor.ts to call tracing.start(), which double-starts and fails.
"REPORT_TRACING": "false",
@@ -12,6 +12,7 @@
:data-key="index"
:data-item-id="item.id"
:aria-hidden="item.isTruncationPlaceholder"
:inert="item.isTruncationPlaceholder || undefined"
:tabindex="item.isTruncationPlaceholder ? -1 : 0"
:class="[
'oc-breadcrumb-list-item',
@@ -53,11 +53,10 @@
v-else
class="oc-table-thead-content header-text"
:class="{ 'oc-invisible-sr': !extractFieldTitle(field) }"
:aria-hidden="extractFieldTitle(field) ? 'false' : 'true'"
v-text="
hasIconsColumn
? $pgettext('Sets a hidden table header text for screen readers', 'Icons')
: extractFieldTitle(field)
: extractFieldTitle(field) || field.name
"
/>
</div>
@@ -2,7 +2,7 @@
<main
class="external-redirect oc-height-viewport oc-flex oc-flex-column oc-flex-center oc-flex-middle"
>
<h1 class="oc-invisible-sr" v-text="pageTitle" />
<h1 v-if="pageTitle" class="oc-invisible-sr" v-text="pageTitle" />
<div class="oc-card oc-card-body oc-text-center oc-width-large">
<template v-if="hasError">
<h2 key="external-redirect-error">
@@ -2,7 +2,7 @@
<div id="files-drop">
<app-loading-spinner v-if="loading" />
<div v-else id="files-drop-wrapper" class="oc-height-1-1">
<h1 class="oc-invisible-sr">{{ pageTitle }}</h1>
<h1 v-if="pageTitle" class="oc-invisible-sr">{{ pageTitle }}</h1>
<div v-if="dragareaEnabled" class="dragarea" />
<div key="loaded-drop" class="oc-flex oc-flex-center oc-height-1-1">
+2 -2
View File
@@ -1,5 +1,5 @@
<template>
<div class="sciencemesh">
<main class="sciencemesh">
<div class="oc-flex oc-flex-column sciencemesh-wrapper">
<div class="oc-flex sciencemesh-top">
<div id="sciencemesh-invite" class="oc-width-1-2">
@@ -17,7 +17,7 @@
/>
</div>
</div>
</div>
</main>
</template>
<script lang="ts" setup>
@@ -2,7 +2,7 @@
<main
class="webfinger-resolve oc-height-viewport oc-flex oc-flex-column oc-flex-center oc-flex-middle"
>
<h1 class="oc-invisible-sr" v-text="pageTitle" />
<h1 v-if="pageTitle" class="oc-invisible-sr" v-text="pageTitle" />
<div class="oc-card oc-card-body oc-text-center oc-width-large">
<template v-if="hasError">
<h2 key="webfinger-resolve-error">
@@ -5,7 +5,7 @@
:class="{ 'files-app-bar-squashed': isSideBarOpen, 'files-app-bar-sticky': isSticky }"
>
<div class="files-topbar oc-py-s">
<h1 class="oc-invisible-sr" v-text="pageTitle" />
<h1 v-if="pageTitle" class="oc-invisible-sr" v-text="pageTitle" />
<oc-hidden-announcer :announcement="selectedResourcesAnnouncement" level="polite" />
<div
class="oc-flex oc-flex-middle files-app-bar-controls"
@@ -3,7 +3,7 @@
<template>
<main :id="applicationId" class="app-wrapper oc-height-1-1" @keydown.esc="closeApp">
<!-- eslint-enable vuejs-accessibility/no-static-element-interactions -->
<h1 class="oc-invisible-sr" v-text="pageTitle" />
<h1 v-if="pageTitle" class="oc-invisible-sr" v-text="pageTitle" />
<app-top-bar
v-if="!loading && !loadingError && resource"
:main-actions="fileActions"
@@ -1,6 +1,7 @@
<template>
<div
<aside
id="web-nav-sidebar"
:aria-label="$gettext('Application navigation')"
:class="{
'oc-app-navigation-collapsed': closed,
'oc-app-navigation-expanded': !closed
@@ -50,7 +51,7 @@
<span v-text="webVersion" />
</div>
</slot>
</div>
</aside>
</template>
<script lang="ts">
@@ -3,8 +3,10 @@
class="oc-login oc-height-viewport"
:style="{ '--oc-login-background-image': 'url(' + backgroundImg + ')' }"
>
<h1 class="oc-invisible-sr" v-text="pageTitle" />
<router-view />
<main>
<h1 v-if="pageTitle" class="oc-invisible-sr" v-text="pageTitle" />
<router-view />
</main>
</div>
</template>
@@ -312,12 +312,9 @@ export const createFileFromTemplate = async ({
if (actionType.startsWith('sidebar')) {
await sidebar.open({ page, resource })
await sidebar.openPanel({ page, name: 'actions' })
// no a11y check after this click: it navigates straight into the external
// editor, unmounting the sidebar before the assertion could run
await page.locator(util.format(sideBarActionButton, menuItem)).click()
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
page,
['appSidebar'],
'sidebar panel'
)
return
} else if (actionType.startsWith('context')) {
await page.locator(util.format(resourceNameSelector, resource)).click({ button: 'right' })
@@ -1896,7 +1893,10 @@ export const searchResourceGlobalSearch = async (
// "open in new tab" keeps working; axe always resolves an anchor's role back to "link"
// regardless of role="presentation"/tabindex="-1", so nested-interactive can't be silenced
// without removing that link, which would be a functional regression
['nested-interactive']
//
// aria-allowed-role: axe 4.11 incorrectly rejects <li role="group"> inside
// <ul role="listbox">, which is valid per ARIA 1.2 for grouping options
['nested-interactive', 'aria-allowed-role']
)
if (pressEnter) {
@@ -45,7 +45,11 @@ export class Application {
// the global search input can transiently keep aria-controls pointing at its
// (already unmounted) options dropdown for one render frame right after a route
// change - see editor.ts close() for the same, more thoroughly investigated case
['aria-valid-attr-value']
//
// 'label' is disabled because on first admin login the OIDC redirect can land on
// Keycloak's own "Configure OTP" required-action page (#totp/#userLabel inputs),
// whose markup is Keycloak's default theme, not oCIS web's
['aria-valid-attr-value', 'label']
)
}