implemented statemachine bdd tests