@@ -1256,25 +1256,25 @@ describe('validateCapsWithA11y', () => {
12561256 . toContain ( 'Accessibility Automation will run only on Desktop browsers.' )
12571257 } )
12581258
1259- it ( 'returns false if browser is not chrome ' , async ( ) => {
1259+ it ( 'returns false if browser is not supported ' , async ( ) => {
12601260 const platformMeta = {
1261- 'browser_name' : 'safari '
1261+ 'browser_name' : 'firefox '
12621262 }
12631263
12641264 expect ( validateCapsWithA11y ( undefined , platformMeta ) ) . toEqual ( false )
12651265 expect ( logInfoMock . mock . calls [ 0 ] [ 0 ] )
1266- . toContain ( 'Accessibility Automation will run only on Chrome browsers. ' )
1266+ . toContain ( 'Accessibility Automation supports Chrome 95+, Chrome for Testing 141+, and Safari 18.4+ ' )
12671267 } )
12681268
1269- it ( 'returns false if browser version is lesser than 94 ' , async ( ) => {
1269+ it ( 'returns false if browser version is lesser than 95 ' , async ( ) => {
12701270 const platformMeta = {
12711271 'browser_name' : 'chrome' ,
12721272 'browser_version' : '90'
12731273 }
12741274
12751275 expect ( validateCapsWithA11y ( undefined , platformMeta ) ) . toEqual ( false )
12761276 expect ( logInfoMock . mock . calls [ 0 ] [ 0 ] )
1277- . toContain ( 'Accessibility Automation will run only on Chrome browser version greater than 94. ' )
1277+ . toContain ( 'Accessibility Automation requires Chrome version 95 or higher ' )
12781278 } )
12791279
12801280 it ( 'returns false if browser version is lesser than 94' , async ( ) => {
@@ -1300,6 +1300,50 @@ describe('validateCapsWithA11y', () => {
13001300
13011301 expect ( validateCapsWithA11y ( undefined , platformMeta , chromeOptions ) ) . toEqual ( true )
13021302 } )
1303+
1304+ it ( 'returns true for Safari 18.4+' , async ( ) => {
1305+ const platformMeta = {
1306+ 'browser_name' : 'safari' ,
1307+ 'browser_version' : '18.4'
1308+ }
1309+ expect ( validateCapsWithA11y ( undefined , platformMeta ) ) . toEqual ( true )
1310+ } )
1311+
1312+ it ( 'returns true for Safari latest' , async ( ) => {
1313+ const platformMeta = {
1314+ 'browser_name' : 'safari' ,
1315+ 'browser_version' : 'latest'
1316+ }
1317+ expect ( validateCapsWithA11y ( undefined , platformMeta ) ) . toEqual ( true )
1318+ } )
1319+
1320+ it ( 'returns false for Safari < 18.4' , async ( ) => {
1321+ const platformMeta = {
1322+ 'browser_name' : 'safari' ,
1323+ 'browser_version' : '16.0'
1324+ }
1325+ expect ( validateCapsWithA11y ( undefined , platformMeta ) ) . toEqual ( false )
1326+ expect ( logInfoMock . mock . calls [ 0 ] [ 0 ] )
1327+ . toContain ( 'Safari version 18.4 or higher' )
1328+ } )
1329+
1330+ it ( 'returns true for ChromeForTesting 141+' , async ( ) => {
1331+ const platformMeta = {
1332+ 'browser_name' : 'ChromeForTesting' ,
1333+ 'browser_version' : '141'
1334+ }
1335+ expect ( validateCapsWithA11y ( undefined , platformMeta ) ) . toEqual ( true )
1336+ } )
1337+
1338+ it ( 'returns false for ChromeForTesting < 141' , async ( ) => {
1339+ const platformMeta = {
1340+ 'browser_name' : 'ChromeForTesting' ,
1341+ 'browser_version' : '140'
1342+ }
1343+ expect ( validateCapsWithA11y ( undefined , platformMeta ) ) . toEqual ( false )
1344+ expect ( logInfoMock . mock . calls [ 0 ] [ 0 ] )
1345+ . toContain ( 'Accessibility Automation requires Chrome for Testing version 141 or higher' )
1346+ } )
13031347} )
13041348
13051349describe ( 'validateCapsWithNonBstackA11y' , ( ) => {
@@ -1308,14 +1352,38 @@ describe('validateCapsWithNonBstackA11y', () => {
13081352 logInfoMock = vi . spyOn ( log , 'warn' )
13091353 } )
13101354
1311- it ( 'returns false if browser is not chrome' , async ( ) => {
1355+ it ( 'returns true for safari 18.4+' , async ( ) => {
1356+ expect ( validateCapsWithNonBstackA11y ( 'safari' , '18.4' ) ) . toEqual ( true )
1357+ } )
1358+
1359+ it ( 'returns true for safari latest' , async ( ) => {
1360+ expect ( validateCapsWithNonBstackA11y ( 'safari' , 'latest' ) ) . toEqual ( true )
1361+ } )
1362+
1363+ it ( 'returns false for safari < 18.4' , async ( ) => {
1364+ expect ( validateCapsWithNonBstackA11y ( 'safari' , '16.0' ) ) . toEqual ( false )
1365+ expect ( logInfoMock . mock . calls [ 0 ] [ 0 ] )
1366+ . toContain ( 'Safari version 18.4+' )
1367+ } )
1368+
1369+ it ( 'returns true for ChromeForTesting 141+' , async ( ) => {
1370+ expect ( validateCapsWithNonBstackA11y ( 'ChromeForTesting' , '141' ) ) . toEqual ( true )
1371+ } )
1372+
1373+ it ( 'returns false for ChromeForTesting < 141' , async ( ) => {
1374+ expect ( validateCapsWithNonBstackA11y ( 'ChromeForTesting' , '140' ) ) . toEqual ( false )
1375+ expect ( logInfoMock . mock . calls [ 0 ] [ 0 ] )
1376+ . toContain ( 'Accessibility Automation requires Chrome for Testing version 141+' )
1377+ } )
1378+
1379+ it ( 'returns false if browser is not supported' , async ( ) => {
13121380
1313- const browserName = 'safari '
1381+ const browserName = 'firefox '
13141382 const browserVersion = 'latest'
13151383
13161384 expect ( validateCapsWithNonBstackA11y ( browserName , browserVersion ) ) . toEqual ( false )
13171385 expect ( logInfoMock . mock . calls [ 0 ] [ 0 ] )
1318- . toContain ( 'Accessibility Automation will run only on Chrome browsers. ' )
1386+ . toContain ( 'Accessibility Automation on non-BrowserStack infrastructure supports Chrome 100+, Chrome for Testing 141+, and Safari 18.4+ ' )
13191387 } )
13201388
13211389 it ( 'returns false if browser version is lesser than 100' , async ( ) => {
@@ -1325,7 +1393,7 @@ describe('validateCapsWithNonBstackA11y', () => {
13251393
13261394 expect ( validateCapsWithNonBstackA11y ( browserName , browserVersion ) ) . toEqual ( false )
13271395 expect ( logInfoMock . mock . calls [ 0 ] [ 0 ] )
1328- . toContain ( 'Accessibility Automation will run only on Chrome browser version greater than 100. ' )
1396+ . toContain ( 'Accessibility Automation requires Chrome version 100+ ' )
13291397 } )
13301398
13311399 it ( 'returns true if validation done' , async ( ) => {
0 commit comments