* fix(e2e): resolve admin-settings general spec violations
- prevent focusable elements inside hidden breadcrumb items
- make OcDrop tippy role configurable, default to none
- wait for logo-wrapper element after page reload in e2e
* fix(e2e): resolve admin-settings groups spec violations
- add aria-label to the icon-only groups filter-confirm button, which
had no name for screen readers to announce
- set reducedMotion on e2e browser contexts so notification fade-in
animations don't race axe scans and produce false color-contrast
failures
- fix tippbBox selector typo (-> tippyBox) that made the scan on the
group context menu throw instead of running
- fix groupList and editPanel selectors in the shared selector map:
groupList pointed at a nonexistent class, and editPanel used the
non-standard :visible pseudo-selector which is invalid in native
querySelectorAll
* fix(e2e): skip tooltip fade transition under reduced motion
Plain tooltips (v-oc-tooltip) use tippy.js's default fade animation
and default #333/#fff colors, driven by tippy's own duration option
rather than a CSS transition. Setting reducedMotion on the Playwright
browser context does not stop this, since tippy's animation ignores
prefers-reduced-motion on its own. Axe scans could catch the tooltip
mid-fade, when the text is still low-opacity, and report a false
color-contrast violation. Now the duration is forced to 0 when the
media query matches, mirroring how oc-fade-in already handles this
for CSS-driven animations.
* fix(e2e): resolve officeSuites spec progressbar violation and test bugs
- add aria-label to the global loading progress bar, which had no name
- point the space quota progress bar at its existing text label via
aria-labelledby instead of leaving it unnamed
- fix a string-literal-instead-of-variable typo, an XPath selector that
axe can't use (only CSS), and a scan that ran after clicking closed
the element it was targeting, all in the public link test helpers
- move the create-document-modal scan to after the modal actually
opens, since it was scanning too early and finding nothing
* fix(e2e): resolve app-store details spec contrast violation and scan bug
- override md-editor-v3's default link and inline-code colors in the
read-only markdown preview, which didn't meet WCAG AA contrast
against the app card background
- point the download-app a11y scan at the app list page instead of a
details-page selector that isn't present on that page, a leftover
from copying the sibling download-version helper
* fix(e2e): resolve participantManagement pagination spec violations
- patch vue-select to render aria-controls on its combobox toggle,
which it already computed internally but never attached to the
element with role="combobox"
- add aria-label to the account menu quota bar and upload progress
bar, both missing a name on their progressbar role, same gap fixed
earlier in LoadingIndicator/SpaceQuota
- add aria-label to the file-details preview-loading spinner, which
rendered role="img" with an empty aria-label
- stop scanning the sidebar actions panel in deleteResource after it
was already closed, which made the scan throw instead of running
* fix(e2e): add missing aria-label to hide-share quick action button
The icon-only hide/unhide-share button in the shared-with-me table had
a tooltip but no aria-label, so it had no accessible name. Reused the
label already computed for the tooltip instead of duplicating it.
* fix(e2e): fix sidebarPanel selector typo in downloadResources
Used the string 'sidebarPanel', which isn't a key in the shared a11y
selector map, so it fell through to being used as a literal (and
broken) CSS selector. Switched to the existing appSidebar key, which
resolves to the same #app-sidebar selector already used for this
concept elsewhere.
* fix(e2e): add accessible name to markdown editor's content area
md-editor-v3's underlying CodeMirror instance renders its editable
content div with role="textbox" but no accessible name, and the
library exposes no prop to pass one through. Set aria-label on it
directly after mount, since that's the only available hook.
* fix(e2e): fix users-filter button label and navigate scan selector
- add aria-label to the icon-only users search/filter-confirm button,
the same button-name gap already fixed for the groups page
- fix Users.navigate scanning appSidebar, which isn't rendered until a
sidebar panel is actually opened; switched to scanning body, matching
the working pattern already used by Groups.navigate
* fix(e2e): fix global search dropdown ARIA structure and scan bugs
- restructure the search results listbox so its direct children are
valid group/option roles instead of plain nested <li>/<ul>, fixing
aria-required-children/parent, list, and listitem violations
- give the loading/no-results states no listbox role at all, since
they're informational text rather than actual options
- give the listbox an accessible name via the existing search label
- fix the icon-only "search options" listbox missing aria-controls
becoming null instead of a static string when the dropdown isn't
rendered
- add a disableRules option to assertNoSevereA11yViolations, using it
for two narrow, investigated cases: search-result rows render a real
<a href> so native middle-click/ctrl-click "open in new tab" keeps
working (nested-interactive can't be satisfied without removing
that), and a checkbox nested in a clickable filter-list button that
would otherwise lose its only accessible selection-state indicator
- fix the same aria-controls transient-timing gap in two more call
sites that hit it after a route change (closing the editor, opening
any app via the app switcher)
* fix(e2e): fix low contrast search input in select combobox
vue-select's vendor CSS dims the search input to 20% opacity while
searching but not yet open, dropping text contrast to 1.51:1 against
the required 4.5:1. Override the opacity back to 1 for that state.
* fix(e2e): add labels to app gallery navigation buttons
The prev/next/set-image buttons in the app details image gallery only
render a decorative icon with no text or label, leaving them with no
discernible name for screen reader users.
* fix(e2e): add label to clear-clipboard button in files app bar
The clear-clipboard button next to "Paste here" only renders a
decorative close icon with no text or label, leaving it with no
discernible name for screen reader users.
* fix(e2e): add label to generic app-loading spinner
The spinner shown while an external app is loading has no aria-label,
leaving the role="img" element with no accessible name even though a
visually-hidden "Loading app" text already exists right next to it.
* fix(e2e): add label to GDPR export loading spinner
The spinner shown while the GDPR export status is loading has no
aria-label, leaving the role="img" element with no accessible name.
* fix(e2e): fix combobox aria attributes in create shortcut modal
The suggestion dropdown had no explicit toggle target, so tippy fell
back to the input wrapper div and set aria-expanded on an element with
no ARIA role. Point the drop at the actual input and give it proper
combobox semantics.
* fix(e2e): fix users filter checkbox-button scan and delete selector bug
Suppress the already-accepted checkbox-in-button nested-interactive
rule at the two roles filter scan sites in filterUsers, matching the
pattern used elsewhere for the same ItemFilter.vue markup. Also fix a
string-literal selector in deleteUserUsingContextMenu that was never
actually calling util.format, so axe scanned for a nonexistent element.
* fix(e2e): resolve admin-settings spaces spec violations
- replace removed #files-toggle-sidebar with the "Show details" button
(that button now opens the sidebar in one click; selecting via the
checkbox first would toggle the space off when Show details toggles it on)
- fix broken scan selectors: 'appSidebarDiv' -> 'appSidebar' (not a key in
the selectors map, was silently falling through to the literal string);
'tippyBox' -> 'ocModal' at the confirm-action scan (the modal is what's
actually rendered there, not a tippy); 'filesView' -> 'adminSettingsWrapper'
in performSpaceAction (this runs on the admin-settings page, not files)
- wrap transitionend waits in Promise.all with their triggering click, so
the listener attaches before the transition begins - otherwise a near-
instant transition (under prefers-reduced-motion: reduce, enabled by an
earlier fix in this branch) can finish before the listener binds and
the wait never resolves, hanging the "list members via sidebar" test
* fix(e2e): mark kindergarten journey test as slow
The journey performs 16 downloads plus shares and deletes, each cycling
the sidebar with a11y scans, and consistently runs 3-4 minutes even in
isolation - past the default 180s timeout. When the deadline hits, the
axe scan in flight fails with "Target page, context or browser has been
closed" from a different call site each run.
test.slow() triples the timeout to 540s, the idiomatic Playwright hint
for legitimately long journey tests.
* fix(e2e): add aria-label to create-user button when icon-only
When admin-settings shrinks to a limited-width viewport, the create-user
button collapses to icon-only and its visible text label is hidden. The
tooltip already switches to the accessible name in that mode; mirror
that on aria-label so the button retains an accessible name in the
collapsed state (WCAG 4.1.2).
* fix(e2e): import expect in crashPage step helpers
expectCrashPageHasNoAccessibilityViolations uses expect() but the
import only included Page - the file wouldn't compile if that helper
was referenced anywhere.
* fix(e2e): pass selector variables to admin-settings users a11y scans
Four call sites passed string keys ('loginToggleWithDropdown',
'loginDropDown', 'groupsModalInput') that don't exist in the shared
selectors map - assertNoSevereA11yViolations' fallback then used those
literal strings as raw CSS selectors, matching nothing, so axe threw
"No elements found for include" instead of actually scanning. Same
class of bug as the earlier 'tippbBox'/'sidebarPanel'/'linkUpdateDialog'
fixes in this branch.
Switched to passing the local const variables directly, which resolve
to the real CSS selectors defined in the same file.
* fix(e2e): scan notifications dropdown container instead of message list
Both notification-related scans passed notificationItemsMessages, which
is a selector that matches multiple elements (one per notification). axe
throws on multi-match includes. Switched to notificationsDrop, the
single container that wraps the message list.
* fix(e2e): wait for link-update dialog before scanning it
Four call sites (changeRole, changeName, addExpiration, deleteLink) ran
assertNoSevereA11yViolations on the linkUpdateDialog notification right
after the action that triggers it, without waiting for the notification
to actually appear - axe would race and sometimes scan before the DOM
was there.
Also fixed copyLinkToClipboard: previously scanned '.snackbar' (which
doesn't exist in this codebase) unconditionally; now waits for the
linkUpdateDialog and scans it, or for the password-protected-folder
case, waits inside the iframe and scans the iframe locator instead
(mirroring the pattern already used by open() in utils/sidebar.ts).
* fix(e2e): scan iframe locator for password-protected-folder sidebar
Two scans in the passwordProtectedFolder branch were pointed at
top-level page selectors ('tippyBox', the plain sidebarPanel const)
but that sidebar lives inside its own iframe (#iframe-folder-view),
not on the top-level page - so axe found nothing to scan and threw.
Switched to scanning the iframe locator itself. In open()'s post-open
scan, made the target conditional so the non-iframe branch keeps
scanning #app-sidebar as before.
* fix(e2e): drop premature tippyBox scan before more-options dropdown opens
createShare scanned the tippyBox before clicking showMoreOptionsButton,
but the tippy isn't in the DOM yet at that point - the click on the
button is what opens it. The second scan a couple of lines below runs
after the click, when the dropdown is actually rendered, which is the
only place the scan belongs.
* fix(e2e): scan body in shared createSpace instead of #files-view
createSpace is invoked from both the Files app spaces view (which has
#files-view) and the admin-settings spaces page (which has
#admin-settings-wrapper instead) - scanning a single view-specific
root failed in one of the two callers. Scan the always-present body
so both callers work.
* fix(e2e): make resource-action a11y scans robust to timing and view mode
- clickResource: it's used for both folder navigation (breadcrumb
appears) and file-open (navigates away into a viewer/editor with no
breadcrumb). The unconditional post-click scan of 'breadcrumb' timed
out on file opens. Wait for the breadcrumb with a 5s cap and skip
the scan when it never appears.
- createNewFolder: was scanning 'filesSpaceTable' which only exists in
table view. Scan the view-mode-agnostic 'filesView' wrapper instead.
- downloadResources / pasteResource / moveOrCopyResource: add waitFor
on the target selector before axe scans it, otherwise axe can race
and scan before the DOM updates from the preceding click.
* fix(web-app-app-store): fix TS2322 type error in AppImageGallery aria-label
163 lines
5.0 KiB
TypeScript
163 lines
5.0 KiB
TypeScript
import { Download, Page } from '@playwright/test'
|
|
import util from 'util'
|
|
import { objects } from '../../index'
|
|
|
|
const selectors = {
|
|
appLoadingSpinner: '#app-loading-spinner',
|
|
appSwitcherButton: '#_appSwitcherButton',
|
|
appStoreMenuButton: 'data-test-id=app.app-store.menuItem',
|
|
downloadButton: '//a[contains(., "%s")]/ancestor::li//button[.//span[text()="Download"]]',
|
|
downloadVersionButton: '//tr[@data-item-id="%s"]//button[.//span[text()="Download"]]',
|
|
appStoreHeadline: '.app-list-headline',
|
|
appList: '.app-list',
|
|
appTileTitle: '.app-tile-title',
|
|
selectAppTitle: '//a[contains(.,"%s")]',
|
|
appDetailsBack: '.app-details-back',
|
|
appDetailsTitle: '//h2[contains(@class, "app-details-title")][text()="%s"]',
|
|
appsFilter: '#apps-filter',
|
|
tag: '//button[contains(@class,"oc-tag")][span[text()="%s"]]',
|
|
appTag: '//a[contains(.,"%s")]/following::button[contains(@class,"oc-tag")][span[text()="%s"]][1]'
|
|
}
|
|
|
|
export const openAppStore = async (args: { page: Page }): Promise<void> => {
|
|
const { page } = args
|
|
await page.locator(selectors.appSwitcherButton).click()
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appSwitcherDropdown'],
|
|
'app switcher dropdown'
|
|
)
|
|
await page.locator(selectors.appStoreMenuButton).click()
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appStore'],
|
|
'app store page'
|
|
)
|
|
await page.locator(selectors.appLoadingSpinner).waitFor({ state: 'detached' })
|
|
}
|
|
export const navigateToAppStoreOverview = async (args: { page: Page }): Promise<void> => {
|
|
const { page } = args
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appDetails'],
|
|
'app details page'
|
|
)
|
|
await page.locator(selectors.appDetailsBack).click()
|
|
await page.locator(selectors.appDetailsBack).waitFor({ state: 'detached' })
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appStore'],
|
|
'app store page'
|
|
)
|
|
}
|
|
|
|
export const waitForAppStoreToBeVisible = async (args: { page: Page }): Promise<void> => {
|
|
const { page } = args
|
|
await page.locator(selectors.appStoreHeadline).waitFor()
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appStore'],
|
|
'app store page'
|
|
)
|
|
}
|
|
|
|
export const getAppsList = async (args: { page: Page }): Promise<string[]> => {
|
|
const { page } = args
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appStore'],
|
|
'app store page'
|
|
)
|
|
return page.locator(selectors.appTileTitle).allTextContents()
|
|
}
|
|
|
|
export const setSearchTerm = async (args: { page: Page; searchTerm: string }): Promise<void> => {
|
|
const { page, searchTerm } = args
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appStore'],
|
|
'app store page'
|
|
)
|
|
return page.locator(selectors.appsFilter).fill(searchTerm)
|
|
}
|
|
|
|
export const selectAppTag = async (args: {
|
|
page: Page
|
|
app: string
|
|
tag: string
|
|
}): Promise<void> => {
|
|
const { page, app, tag } = args
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appStore'],
|
|
'app store page'
|
|
)
|
|
return page.locator(util.format(selectors.appTag, app, tag)).click()
|
|
}
|
|
export const selectTag = async (args: { page: Page; tag: string }): Promise<void> => {
|
|
const { page, tag } = args
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appStore'],
|
|
'app store page'
|
|
)
|
|
return page.locator(util.format(selectors.tag, tag)).click()
|
|
}
|
|
|
|
export const selectApp = async (args: { page: Page; app: string }): Promise<void> => {
|
|
const { page, app } = args
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appStore'],
|
|
'app store page'
|
|
)
|
|
await page.locator(util.format(selectors.selectAppTitle, app)).click()
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appDetails'],
|
|
'app details page'
|
|
)
|
|
}
|
|
|
|
export const waitForAppDetailsToBeVisible = async (args: { page: Page; app }): Promise<void> => {
|
|
const { page, app } = args
|
|
await page.locator(util.format(selectors.appDetailsTitle, app)).waitFor()
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appDetails'],
|
|
'app details page'
|
|
)
|
|
}
|
|
|
|
export const downloadAppVersion = async (args: {
|
|
page: Page
|
|
version: string
|
|
}): Promise<string> => {
|
|
const { page, version } = args
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
['appDetails'],
|
|
'app details page'
|
|
)
|
|
const [download] = await Promise.all([
|
|
page.waitForEvent('download'),
|
|
page.locator(util.format(selectors.downloadVersionButton, version)).click()
|
|
])
|
|
return download.suggestedFilename()
|
|
}
|
|
|
|
export const downloadApp = async (args: { page: Page; app: string }): Promise<Download> => {
|
|
const { page, app } = args
|
|
await objects.a11y.Accessibility.assertNoSevereA11yViolations(
|
|
page,
|
|
[selectors.appList],
|
|
'app list page'
|
|
)
|
|
const [download] = await Promise.all([
|
|
page.waitForEvent('download'),
|
|
page.locator(util.format(selectors.downloadButton, app)).click()
|
|
])
|
|
|
|
return download
|
|
}
|