import { Given , Then , When } from 'cypress-cucumber-preprocessor/steps' ; Given ( 'a URL with query parameter {string}' , ( query ) => { cy . visit ( `/?useMockedAdapter=true&q=${ query }` ) ; } ) ; Then ( 'the search request contains the origin {string}' , ( origin ) => { cy . wait ( '@interceptedResults' ) . its ( 'request.body' ) . then ( JSON . parse ) . should ( 'have.property' , 'origin' , origin ) ; } ) ; When ( 'navigating back' , ( ) => { cy . go ( - 1 ) ; } ) ; When ( 'clicking result in position {int}' , ( index ) => { cy . getByDataTest ( 'result-link' ) . eq ( index ) . click ( ) ; } ) ;