@@ -350,6 +350,14 @@ export const createPasswordProtectedFolder = async ({
350350 password : string
351351} ) : Promise < void > => {
352352 password = substitute ( password )
353+ const a11yObject = new objects . a11y . Accessibility ( { page } )
354+ const violations = await a11yObject . getSevereAccessibilityViolations (
355+ a11yObject . getSelectors ( ) . ocModal
356+ )
357+ expect (
358+ violations ,
359+ `Found ${ violations . length } severe accessibility violations in create new folder modal`
360+ ) . toHaveLength ( 0 )
353361 await page . locator ( passwordProtectedFolderButton ) . click ( )
354362 await page . locator ( passwordProtectedFolderNameInput ) . fill ( resource )
355363 await page . locator ( passwordProtectedFolderPasswordInput ) . fill ( password )
@@ -379,6 +387,14 @@ export const createPasswordProtectedFolder = async ({
379387export const createNewFileOrFolder = async ( args : createResourceArgs ) : Promise < void > => {
380388 const { page, name, type, content, password } = args
381389 await page . locator ( addNewResourceButton ) . click ( )
390+ const a11yObject = new objects . a11y . Accessibility ( { page } )
391+ const violations = await a11yObject . getSevereAccessibilityViolations (
392+ a11yObject . getSelectors ( ) . tippyBox
393+ )
394+ expect (
395+ violations ,
396+ `Found ${ violations . length } severe accessibility violations in create new tippy box`
397+ ) . toHaveLength ( 0 )
382398 switch ( type ) {
383399 case 'folder' : {
384400 await createNewFolder ( { page, resource : name } )
@@ -440,6 +456,14 @@ const createDocumentFile = async (
440456 `The document of type ${ type } did not appear in the webUI for ${ editorToOpen } . Possible reason could be the app provider service for ${ editorToOpen } was not ready yet.`
441457 )
442458 }
459+ const a11yObject = new objects . a11y . Accessibility ( { page } )
460+ const violations = await a11yObject . getSevereAccessibilityViolations (
461+ a11yObject . getSelectors ( ) . ocModal
462+ )
463+ expect (
464+ violations ,
465+ `Found ${ violations . length } severe accessibility violations in create new folder modal`
466+ ) . toHaveLength ( 0 )
443467 await page . locator ( util . format ( createNewOfficeDocumentFileButton , type ) ) . click ( )
444468 await page . locator ( resourceNameInput ) . clear ( )
445469 await page . locator ( resourceNameInput ) . fill ( name )
@@ -569,6 +593,19 @@ export const editTextDocument = async ({
569593 const inputLocator =
570594 isMarkdownMode === 'true' ? textEditorMarkdownInput : textEditorPlainTextInput
571595
596+ const a11yObject = new objects . a11y . Accessibility ( { page } )
597+ let violations = await a11yObject . getSevereAccessibilityViolations (
598+ a11yObject . getSelectors ( ) . textEditor
599+ )
600+ violations = [
601+ ...violations ,
602+ ...( await a11yObject . getSevereAccessibilityViolations ( a11yObject . getSelectors ( ) . topBar ) )
603+ ]
604+ expect (
605+ violations ,
606+ `Found ${ violations . length } severe accessibility violations in create new folder modal`
607+ ) . toHaveLength ( 0 )
608+
572609 await page . locator ( inputLocator ) . fill ( content )
573610 await Promise . all ( [
574611 page . waitForResponse ( ( resp ) => resp . status ( ) === 204 && resp . request ( ) . method ( ) === 'PUT' ) ,
@@ -1656,11 +1693,21 @@ export interface switchViewModeArgs {
16561693
16571694export const clickViewModeToggle = async ( args : switchViewModeArgs ) : Promise < void > => {
16581695 const { page, target } = args
1696+ const a11yObject = new objects . a11y . Accessibility ( { page } )
1697+ const a11yViolations = await a11yObject . getSevereAccessibilityViolations (
1698+ a11yObject . getSelectors ( ) . displayOptions
1699+ )
1700+ expect ( a11yViolations ) . toMatchObject ( [ ] )
16591701 await page . locator ( `.viewmode-switch-buttons .${ target } ` ) . click ( )
16601702}
16611703
16621704export const expectThatResourcesAreTiles = async ( args : { page : Page } ) : Promise < void > => {
16631705 const { page } = args
1706+ const a11yObject = new objects . a11y . Accessibility ( { page } )
1707+ const a11yViolations = await a11yObject . getSevereAccessibilityViolations (
1708+ a11yObject . getSelectors ( ) . tilesView
1709+ )
1710+ expect ( a11yViolations ) . toMatchObject ( [ ] )
16641711 const tiles = page . locator ( resourcesAsTiles )
16651712 await expect ( tiles ) . toBeVisible ( )
16661713}
0 commit comments