@@ -21,6 +21,7 @@ import {
21
21
22
22
import { createMdReport , createTestCafeReport } from '../utils/axe-reporter/reporter' ;
23
23
import knownWarnings from './known-warnings.json' ;
24
+ import skipJsErrorsComponents from './skip-js-errors-components.json' ;
24
25
25
26
const execCode = ClientFunction ( ( code ) => {
26
27
// eslint-disable-next-line no-eval
@@ -52,6 +53,9 @@ const getTestSpecificSkipRules = (testName) => {
52
53
return [ 'empty-table-header' ] ;
53
54
case 'Localization-UsingGlobalize' :
54
55
return [ 'label' ] ;
56
+ case 'Map-Markers' :
57
+ case 'Map-Routes' :
58
+ return [ 'aria-hidden-focus' , 'image-alt' , 'image-redundant-alt' ] ;
55
59
default :
56
60
return [ ] ;
57
61
}
@@ -66,6 +70,11 @@ const SKIPPED_TESTS = {
66
70
{ demo : 'TaskTemplate' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
67
71
{ demo : 'Validation' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
68
72
] ,
73
+ Map : [
74
+ { demo : 'ProvidersAndTypes' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
75
+ { demo : 'Markers' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
76
+ { demo : 'Routes' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
77
+ ] ,
69
78
} ,
70
79
Angular : {
71
80
DataGrid : [
@@ -93,6 +102,11 @@ const SKIPPED_TESTS = {
93
102
{ demo : 'DiscreteAxisZoomingAndScrolling' , themes : [ THEME . material ] } ,
94
103
{ demo : 'APISelectAPoint' , themes : [ THEME . material ] } ,
95
104
] ,
105
+ Map : [
106
+ { demo : 'ProvidersAndTypes' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
107
+ { demo : 'Markers' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
108
+ { demo : 'Routes' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
109
+ ] ,
96
110
Scheduler : [
97
111
{ demo : 'Overview' , themes : [ THEME . fluent , THEME . material ] } ,
98
112
] ,
@@ -161,6 +175,11 @@ const SKIPPED_TESTS = {
161
175
{ demo : 'ListWithSearchBar' , themes : [ THEME . material ] } ,
162
176
{ demo : 'ItemDragging' , themes : [ THEME . fluent , THEME . material ] } ,
163
177
] ,
178
+ Map : [
179
+ { demo : 'ProvidersAndTypes' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
180
+ { demo : 'Markers' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
181
+ { demo : 'Routes' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
182
+ ] ,
164
183
VectorMap : [
165
184
{ demo : 'Overview' , themes : [ THEME . material ] } ,
166
185
{ demo : 'PieMarkers' , themes : [ THEME . material ] } ,
@@ -239,6 +258,11 @@ const SKIPPED_TESTS = {
239
258
List : [
240
259
{ demo : 'ListWithSearchBar' , themes : [ THEME . material ] } ,
241
260
] ,
261
+ Map : [
262
+ { demo : 'ProvidersAndTypes' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
263
+ { demo : 'Markers' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
264
+ { demo : 'Routes' , themes : [ THEME . generic , THEME . material , THEME . fluent ] } ,
265
+ ] ,
242
266
Gauges : [
243
267
{ demo : 'Overview' , themes : [ THEME . material ] } ,
244
268
{ demo : 'VariableNumberOfSubvalueIndicators' , themes : [ THEME . material ] } ,
@@ -310,9 +334,6 @@ const SKIPPED_TESTS = {
310
334
'Scheduler' ,
311
335
'PivotGrid' ,
312
336
] ;
313
- const BROKEN_THIRD_PARTY_SCRIPTS_COMPONENT = [
314
- 'Map' ,
315
- ] ;
316
337
317
338
getDemoPaths ( approach ) . forEach ( ( demoPath , index ) => {
318
339
if ( ! shouldRunTestAtIndex ( index + 1 ) || ! existsSync ( demoPath ) ) { return ; }
@@ -341,9 +362,6 @@ const SKIPPED_TESTS = {
341
362
if ( process . env . STRATEGY === 'accessibility' && ACCESSIBILITY_UNSUPPORTED_COMPONENTS . indexOf ( widgetName ) > - 1 ) {
342
363
return ;
343
364
}
344
- if ( BROKEN_THIRD_PARTY_SCRIPTS_COMPONENT . indexOf ( widgetName ) > - 1 ) {
345
- return ;
346
- }
347
365
if ( process . env . CI_ENV && process . env . DISABLE_DEMO_TEST_SETTINGS !== 'ignore' ) {
348
366
if ( mergedTestSettings . ignore ) { return ; }
349
367
}
@@ -354,60 +372,63 @@ const SKIPPED_TESTS = {
354
372
355
373
changeTheme ( __dirname , `../${ demoPath } /index.html` , process . env . THEME ) ;
356
374
357
- runTestAtPage ( test , `http://127.0.0.1:808${ getPortByIndex ( index ) } /apps/demos/Demos/${ widgetName } /${ demoName } /${ approach } /` )
358
- . clientScripts ( clientScriptSource ) ( testName , async ( t ) => {
359
- if ( visualTestStyles ) {
360
- await execCode ( visualTestStyles ) ;
361
- }
375
+ runTestAtPage (
376
+ test ,
377
+ `http://127.0.0.1:808${ getPortByIndex ( index ) } /apps/demos/Demos/${ widgetName } /${ demoName } /${ approach } /` ,
378
+ skipJsErrorsComponents . includes ( widgetName ) ,
379
+ ) . clientScripts ( clientScriptSource ) ( testName , async ( t ) => {
380
+ if ( visualTestStyles ) {
381
+ await execCode ( visualTestStyles ) ;
382
+ }
362
383
363
- if ( approach === 'Angular' ) {
364
- await waitForAngularLoading ( ) ;
365
- }
384
+ if ( approach === 'Angular' ) {
385
+ await waitForAngularLoading ( ) ;
386
+ }
366
387
367
- if ( testCodeSource ) {
368
- await execCode ( testCodeSource ) ;
369
- }
388
+ if ( testCodeSource ) {
389
+ await execCode ( testCodeSource ) ;
390
+ }
370
391
371
- if ( testCafeCodeSource ) {
372
- await execTestCafeCode ( t , testCafeCodeSource ) ;
373
- }
392
+ if ( testCafeCodeSource ) {
393
+ await execTestCafeCode ( t , testCafeCodeSource ) ;
394
+ }
374
395
375
- if ( process . env . STRATEGY === 'accessibility' ) {
376
- const specificSkipRules = getTestSpecificSkipRules ( testName ) ;
377
- const options = { rules : { } } ;
396
+ if ( process . env . STRATEGY === 'accessibility' ) {
397
+ const specificSkipRules = getTestSpecificSkipRules ( testName ) ;
398
+ const options = { rules : { } } ;
378
399
379
- [ ...COMMON_SKIP_RULES , ...specificSkipRules ] . forEach ( ( ruleName ) => {
380
- options . rules [ ruleName ] = { enabled : false } ;
381
- } ) ;
400
+ [ ...COMMON_SKIP_RULES , ...specificSkipRules ] . forEach ( ( ruleName ) => {
401
+ options . rules [ ruleName ] = { enabled : false } ;
402
+ } ) ;
382
403
383
- const axeResult = await axeCheck ( t , '.demo-container' , options ) ;
384
- const { error, results } = axeResult ;
404
+ const axeResult = await axeCheck ( t , '.demo-container' , options ) ;
405
+ const { error, results } = axeResult ;
385
406
386
- if ( results . violations . length > 0 ) {
387
- createMdReport ( { testName, results } ) ;
388
- await t . report ( createTestCafeReport ( results . violations ) ) ;
389
- }
407
+ if ( results . violations . length > 0 ) {
408
+ createMdReport ( { testName, results } ) ;
409
+ await t . report ( createTestCafeReport ( results . violations ) ) ;
410
+ }
390
411
391
- await t . expect ( error ) . notOk ( ) ;
392
- await t . expect ( results . violations . length === 0 ) . ok ( createReport ( results . violations ) ) ;
393
- } else {
394
- const testTheme = process . env . THEME ;
412
+ await t . expect ( error ) . notOk ( ) ;
413
+ await t . expect ( results . violations . length === 0 ) . ok ( createReport ( results . violations ) ) ;
414
+ } else {
415
+ const testTheme = process . env . THEME ;
395
416
396
- if ( shouldSkipDemo ( approach , widgetName , demoName , SKIPPED_TESTS ) ) {
397
- return ;
398
- }
417
+ if ( shouldSkipDemo ( approach , widgetName , demoName , SKIPPED_TESTS ) ) {
418
+ return ;
419
+ }
399
420
400
- const comparisonResult = await compareScreenshot ( t , `${ testName } ${ getThemePostfix ( testTheme ) } .png` , undefined , comparisonOptions ) ;
421
+ const comparisonResult = await compareScreenshot ( t , `${ testName } ${ getThemePostfix ( testTheme ) } .png` , undefined , comparisonOptions ) ;
401
422
402
- const consoleMessages = await t . getBrowserConsoleMessages ( ) ;
423
+ const consoleMessages = await t . getBrowserConsoleMessages ( ) ;
403
424
404
- const errors = [ ...consoleMessages . error , ...consoleMessages . warn ]
405
- . filter ( ( e ) => ! knownWarnings . some ( ( kw ) => e . startsWith ( kw ) ) ) ;
425
+ const errors = [ ...consoleMessages . error , ...consoleMessages . warn ]
426
+ . filter ( ( e ) => ! knownWarnings . some ( ( kw ) => e . startsWith ( kw ) ) ) ;
406
427
407
- await t . expect ( errors ) . eql ( [ ] ) ;
428
+ await t . expect ( errors ) . eql ( [ ] ) ;
408
429
409
- await t . expect ( comparisonResult ) . ok ( 'INVALID_SCREENSHOT' ) ;
410
- }
411
- } ) ;
430
+ await t . expect ( comparisonResult ) . ok ( 'INVALID_SCREENSHOT' ) ;
431
+ }
432
+ } ) ;
412
433
} ) ;
413
434
} ) ;
0 commit comments