cabbage icon indicating copy to clipboard operation
cabbage copied to clipboard

How to log steps ala Cucumber

Open hisapy opened this issue 5 years ago • 2 comments

THIS IS NOT AN ISSUE.

Hey devs ... If you want to log your feature step by step similar to how Cucumber logs in Ruby, then you can use FlexLogger and configure it in your test config file.

# file config/test.exs
config :logger,
  backends: [{FlexLogger, :test_logger}, {FlexLogger, :default_logger}]

config :logger, :test_logger,
  logger: :console,
  default_level: :off,
 # the tests that use Cabbage start with FeatureTest. i.e.: FeatureTest.CreatePost
  level_config: [module: FeatureTest, level: :info],
  format: " $levelpad$message\n"

config :logger, :default_logger,
  logger: :console,
  default_level: :warn,
  format: "\n$time $metadata[$level] $levelpad$message\n"

This info might fit quite well into the README and then close this ticket ...

hisapy avatar Nov 07 '18 15:11 hisapy

This could be placed into the Wiki versus opening a whole issue.

jalcine avatar Jan 14 '19 06:01 jalcine

Yes, completely agree, I'm currently are in progress to push this repository to 1.0. Updating documentation is one of the steps. This also will be integrated ;) This also could change, due to code changes in general.

revati avatar Jan 14 '19 08:01 revati