Persisting variable values between scenarios in capybara -


i have code below

if "#{w}" != emailofuser globalvariableforsecemail("#{w}") end def globalvariableforsecemail(useremail) $secuseremail = useremail + "rms.com" end

the problem have first time scenario run , succeeds, second time run scenario $secuseremail value not input onto text box. want use variable across scenarios in feature file , run feature multiple times, how can achieve this?

it's best avoid global variables across scenarios.

if want it, put global variable in background/before block in feature spec


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -