import { Given , Then , When } from "cypress-cucumber-preprocessor/steps" ; let selectedFruit ; Given ( /I choose (Apple|Banana)/ , ( selection ) => { selectedFruit = selection ; } ) ; Given ( "{word} is chosen" , ( selection ) => { expect ( selectedFruit ) . to . equal ( selection ) ; } ) ;