1616 */
1717
1818import { test as it , expect } from './config/pageTest' ;
19- import { chromiumVersionLessThan } from './config/utils' ;
2019
21- it ( 'should work' , async ( { page, isFirefox, isChromium, browserVersion } ) => {
20+ it ( 'should work' , async ( { page, isFirefox, isChromium } ) => {
2221 await page . setContent ( `
2322 <head>
2423 <title>Accessibility Test</title>
@@ -51,9 +50,8 @@ it('should work', async ({ page, isFirefox, isChromium, browserVersion }) => {
5150 { role : 'textbox' , name : '' , value : 'and a value' , description : 'This is a description!' } , // and here
5251 ]
5352 } : isChromium ? {
54- role : chromiumVersionLessThan ( browserVersion , '92.0.4484.0' ) ? ' WebArea' : 'RootWebArea ',
53+ role : ' WebArea',
5554 name : 'Accessibility Test' ,
56- focused : chromiumVersionLessThan ( browserVersion , '92.0.4484.0' ) ? undefined : true ,
5755 children : [
5856 { role : 'heading' , name : 'Inputs' , level : 1 } ,
5957 { role : 'textbox' , name : 'Empty input' , focused : true } ,
@@ -81,11 +79,11 @@ it('should work', async ({ page, isFirefox, isChromium, browserVersion }) => {
8179 expect ( await page . accessibility . snapshot ( ) ) . toEqual ( golden ) ;
8280} ) ;
8381
84- it ( 'should work with regular text' , async ( { page, isFirefox, isChromium , browserVersion } ) => {
82+ it ( 'should work with regular text' , async ( { page, isFirefox} ) => {
8583 await page . setContent ( `<div>Hello World</div>` ) ;
8684 const snapshot = await page . accessibility . snapshot ( ) ;
8785 expect ( snapshot . children [ 0 ] ) . toEqual ( {
88- role : isFirefox ? 'text leaf' : ( ! isChromium || chromiumVersionLessThan ( browserVersion , '92.0.4484.0' ) ) ? ' text' : 'StaticText ',
86+ role : isFirefox ? 'text leaf' : ' text',
8987 name : 'Hello World' ,
9088 } ) ;
9189} ) ;
@@ -120,16 +118,15 @@ it('keyshortcuts', async ({page}) => {
120118 expect ( snapshot . children [ 0 ] . keyshortcuts ) . toEqual ( 'foo' ) ;
121119} ) ;
122120
123- it ( 'should not report text nodes inside controls' , async function ( { page, isFirefox, isChromium , browserVersion } ) {
121+ it ( 'should not report text nodes inside controls' , async function ( { page, isFirefox} ) {
124122 await page . setContent ( `
125123 <div role="tablist">
126124 <div role="tab" aria-selected="true"><b>Tab1</b></div>
127125 <div role="tab">Tab2</div>
128126 </div>` ) ;
129127 const golden = {
130- role : isFirefox ? 'document' : ( ! isChromium || chromiumVersionLessThan ( browserVersion , '92.0.4484.0' ) ) ? ' WebArea' : 'RootWebArea ',
128+ role : isFirefox ? 'document' : ' WebArea',
131129 name : '' ,
132- focused : ( isChromium && ! chromiumVersionLessThan ( browserVersion , '92.0.4484.0' ) ) ? true : undefined ,
133130 children : [ {
134131 role : 'tab' ,
135132 name : 'Tab1' ,
@@ -142,7 +139,7 @@ it('should not report text nodes inside controls', async function({page, isFiref
142139 expect ( await page . accessibility . snapshot ( ) ) . toEqual ( golden ) ;
143140} ) ;
144141
145- it ( 'rich text editable fields should have children' , async function ( { page, isFirefox, browserName, isChromium , browserVersion } ) {
142+ it ( 'rich text editable fields should have children' , async function ( { page, isFirefox, browserName} ) {
146143 it . skip ( browserName === 'webkit' , 'WebKit rich text accessibility is iffy' ) ;
147144
148145 await page . setContent ( `
@@ -164,7 +161,7 @@ it('rich text editable fields should have children', async function({page, isFir
164161 name : '' ,
165162 value : 'Edit this image: ' ,
166163 children : [ {
167- role : ( isChromium && ! chromiumVersionLessThan ( browserVersion , '92.0.4484.0' ) ) ? 'StaticText' : 'text' ,
164+ role : 'text' ,
168165 name : 'Edit this image:'
169166 } , {
170167 role : 'img' ,
@@ -175,7 +172,7 @@ it('rich text editable fields should have children', async function({page, isFir
175172 expect ( snapshot . children [ 0 ] ) . toEqual ( golden ) ;
176173} ) ;
177174
178- it ( 'rich text editable fields with role should have children' , async function ( { page, isFirefox, browserName, isChromium , browserVersion } ) {
175+ it ( 'rich text editable fields with role should have children' , async function ( { page, isFirefox, browserName} ) {
179176 it . skip ( browserName === 'webkit' , 'WebKit rich text accessibility is iffy' ) ;
180177
181178 await page . setContent ( `
@@ -195,7 +192,7 @@ it('rich text editable fields with role should have children', async function({p
195192 name : '' ,
196193 value : 'Edit this image: ' ,
197194 children : [ {
198- role : ( isChromium && ! chromiumVersionLessThan ( browserVersion , '92.0.4484.0' ) ) ? 'StaticText' : 'text' ,
195+ role : 'text' ,
199196 name : 'Edit this image:'
200197 } , {
201198 role : 'img' ,
@@ -370,15 +367,12 @@ it('should show uninteresting nodes', async ({page}) => {
370367 expect ( ! ! snapshot . children ) . toBe ( true ) ;
371368} ) ;
372369
373- it ( 'should work when there is a title ' , async ( { page, isChromium , browserVersion } ) => {
370+ it ( 'should work when there is a title ' , async ( { page} ) => {
374371 await page . setContent ( `
375372 <title>This is the title</title>
376373 <div>This is the content</div>
377374 ` ) ;
378375 const snapshot = await page . accessibility . snapshot ( ) ;
379376 expect ( snapshot . name ) . toBe ( 'This is the title' ) ;
380- if ( isChromium && ! chromiumVersionLessThan ( browserVersion , '92.0.4484.0' ) )
381- expect ( snapshot . children ) . toBe ( undefined ) ;
382- else
383- expect ( snapshot . children [ 0 ] . name ) . toBe ( 'This is the content' ) ;
377+ expect ( snapshot . children [ 0 ] . name ) . toBe ( 'This is the content' ) ;
384378} ) ;
0 commit comments