@@ -89,7 +89,6 @@ describe('Testing the feature selection', () => {
8989 if ( featureInfoPosition ) {
9090 queryParams . featureInfo = featureInfoPosition
9191 }
92- console . log ( 'goToMapViewWithFeatureSelection queryParams' , queryParams )
9392 cy . goToMapView ( { queryParams } )
9493 }
9594
@@ -371,8 +370,9 @@ describe('Testing the feature selection', () => {
371370 }
372371 it ( 'can select an area to identify features inside it' , ( ) => {
373372 const fileName = 'external-kml-file.kml'
373+ const fileNameWithKMLExtension = `KML|${ fileName } `
374374 const localKmlFile = `import-tool/${ fileName } `
375- cy . goToMapView ( { queryParams : { layers : 'test.wms.layer' } } )
375+ cy . goToMapView ( { queryParams : { layers : 'test.wms.layer' , bgLayer : 'test.background.layer2' } } )
376376 cy . wait ( [ '@routeChange' , '@layerConfig' , '@topics' , '@topic-ech' ] )
377377
378378 const featureCountWithKml = DEFAULT_FEATURE_COUNT_RECTANGLE_SELECTION + 1
@@ -404,7 +404,7 @@ describe('Testing the feature selection', () => {
404404 cy . checkOlLayer ( [
405405 'test.background.layer2' ,
406406 { id : 'test.wms.layer' , opacity : 0.75 } ,
407- fileName ,
407+ fileNameWithKMLExtension ,
408408 ] )
409409
410410 cy . get ( '[data-cy="ol-map"]' ) . as ( 'olMap' ) . should ( 'be.visible' )
@@ -515,7 +515,7 @@ describe('Testing the feature selection', () => {
515515 cy . wait ( '@emptyIdentify' )
516516 cy . get ( '@highlightedFeatures' ) . should ( 'not.exist' )
517517
518- cy . get ( '@routeChange.all' ) . should ( 'have.length' , 6 )
518+ cy . get ( '@routeChange.all' ) . should ( 'have.length' , 10 )
519519 cy . get ( '@layerConfig.all' ) . should ( 'have.length' , 1 )
520520 cy . get ( '@topics.all' ) . should ( 'have.length' , 1 )
521521 cy . get ( '@topic-ech.all' ) . should ( 'have.length' , 1 )
@@ -527,6 +527,7 @@ describe('Testing the feature selection', () => {
527527 } )
528528 it ( 'can select feature by click, add more feature, and deselect feature' , ( ) => {
529529 const fileName = '4-points.kml'
530+ const fileNameWithKMLExtension = `KML|${ fileName } `
530531 const localKmlFile = `import-tool/${ fileName } `
531532 cy . goToMapView ( )
532533 cy . wait ( [ '@routeChange' , '@layerConfig' , '@topics' , '@topic-ech' ] )
@@ -556,7 +557,7 @@ describe('Testing the feature selection', () => {
556557
557558 cy . closeMenuIfMobile ( )
558559
559- cy . checkOlLayer ( [ 'test.background.layer2' , fileName ] )
560+ cy . checkOlLayer ( [ 'test.background.layer2' , fileNameWithKMLExtension ] )
560561
561562 cy . get ( '[data-cy="ol-map"]' ) . as ( 'olMap' ) . should ( 'be.visible' )
562563 cy . getPinia ( ) . then ( ( pinia ) => {
@@ -580,16 +581,21 @@ describe('Testing the feature selection', () => {
580581 )
581582
582583 clickOnMap ( pixel3 , false )
584+ cy . wait ( '@routeChange' )
585+ cy . wait ( '@routeChange' )
583586 cy . getPinia ( ) . then ( ( pinia ) => {
584587 const featuresStore3 = useFeaturesStore ( pinia )
585588 expect ( featuresStore3 . selectedFeatures . length ) . to . eq ( 1 )
586589 } )
587590 clickOnMap ( pixel1 , true )
591+ cy . wait ( '@routeChange' )
592+ cy . wait ( '@routeChange' )
588593 cy . getPinia ( ) . then ( ( pinia ) => {
589594 const featuresStore4 = useFeaturesStore ( pinia )
590595 expect ( featuresStore4 . selectedFeatures . length ) . to . eq ( 2 )
591596 } )
592597 clickOnMap ( pixel1 , true )
598+ cy . wait ( '@routeChange' )
593599 cy . getPinia ( ) . then ( ( pinia ) => {
594600 const featuresStore5 = useFeaturesStore ( pinia )
595601 expect ( featuresStore5 . selectedFeatures . length ) . to . eq ( 1 )
@@ -598,8 +604,9 @@ describe('Testing the feature selection', () => {
598604 } )
599605 it ( 'can print feature information' , ( ) => {
600606 const fileName = 'external-kml-file.kml'
607+ const fileNameWithKMLExtension = `KML|${ fileName } `
601608 const localKmlFile = `import-tool/${ fileName } `
602- cy . goToMapView ( { queryParams : { layers : 'test.wms.layer' } } )
609+ cy . goToMapView ( { queryParams : { layers : 'test.wms.layer' , bgLayer : 'test.background.layer2' } } )
603610 cy . wait ( [ '@routeChange' , '@layerConfig' , '@topics' , '@topic-ech' ] )
604611
605612 cy . openMenuIfMobile ( )
@@ -630,7 +637,7 @@ describe('Testing the feature selection', () => {
630637 cy . checkOlLayer ( [
631638 'test.background.layer2' ,
632639 { id : 'test.wms.layer' , opacity : 0.75 } ,
633- fileName ,
640+ fileNameWithKMLExtension ,
634641 ] )
635642
636643 cy . get ( '[data-cy="ol-map"]' ) . as ( 'olMap' ) . should ( 'be.visible' )
0 commit comments