import { And , Given } from 'cypress-cucumber-preprocessor/steps' ; import { InstallXOptions } from '../../../../src/x-installer/x-installer/types' ; Given ( 'following config: max items to store is {int}' , ( maxItemsToRequest ) => { const config = { recommendations : { config : { maxItemsToRequest } } } ; cy . visit ( '/?useMockedAdapter=true' , { qs : { xModules : JSON . stringify ( config ) } } ) ; } ) ; And ( 'number of displayed recommendations are equal or less than {int}' , ( maxItemsToRequest ) => { cy . getByDataTest ( 'recommendation-item' ) . should ( 'be.visible' ) . should ( 'have.length.at.least' , 1 ) . and ( 'have.length.at.most' , maxItemsToRequest ) ; } ) ; And ( 'each recommendation has an associated hyperlink containing image and text' , ( ) => { cy . getByDataTest ( 'result-link' ) . getByDataTest ( 'recommendation-image' ) . should ( 'exist' ) ; cy . getByDataTest ( 'result-link' ) . getByDataTest ( 'recommendation-text' ) . should ( 'exist' ) ; } ) ;