I'd like my step definition to have conditional behavior based on cuke's run-time options. For example, I don't want my step to print terminal color codes if cucumber
was executed with --no-color
.
Is there any way that I can programmatically see the cucumber run-time options from within the step definition?
I'm not sure how to access all the run-time options, but you can access the current coloring option via Cucumber::Term::ANSIColor.coloring?
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.