Sha256: 8793b0602a0269764abb141ce58b975927215e986b40425ec565b44d1ecab876

Contents?: true

Size: 1.54 KB

Versions: 9

Compression:

Stored size: 1.54 KB

Contents

Before do
  window = Capybara.current_session.current_window
  window.resize_to(1366, 768)
  window.maximize

  @page = ->(klass) { klass.new }
end

After do |scenario|
  take_screenshot(scenario)

  exception_message(scenario)
end

def exception_message(scenario)
  scene = scenario.failed?
  return unless scene == true

  print_reason(scenario)
end

def print_reason(scenario)
  log("\n-------------")
  log("\nINCONSISTENCY")
  log("\n-------------")
  log("\nšŸ”„šŸ”„šŸ”„ #{scenario.exception.message.split('(')[0]}")
end

AfterConfiguration do |config|
  config.on_event(:test_case_finished) do |event|
    puts "\n--------------------------------------------------------------------------------------------------"
    puts 'Results:'
    puts " - Scenario: #{event.test_case.name}"
    puts " - Result..: [ #{event.result.passed? ? 'āœ… ]' : 'āŒ ]'}"
    puts "--------------------------------------------------------------------------------------------------\n"
  end
end

at_exit do
  @infos = {
    'Browser' => Capybara.default_driver.to_s.capitalize,
    'Environment' => ENV['ENV_TYPE'],
    'Data do Teste' => Time.now.strftime('%d/%B/%Y'),
    'Hora do Teste' => Time.now.strftime('%H:%M:%S')
  }

  ReportBuilder.configure do |config|
    config.input_path = 'report/report.json'
    config.report_path = 'report/report'
    config.report_types = [:html]
    config.report_title = '[SaudeId] - My Title'
    config.additional_info = @infos
    config.color = 'indigo'
  end
  ReportBuilder.build_report
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
SaudeiD-0.2.5 lib/SkeletonWeb/features/support/hooks.rb
SaudeiD-0.2.4 lib/SkeletonWeb/features/support/hooks.rb
SaudeiD-0.2.2 lib/SkeletonWeb/features/support/hooks.rb
SaudeiD-0.2.0 lib/SkeletonWeb/features/support/hooks.rb
GeneSaudeId-0.1.4 lib/SkeletonWeb/features/support/hooks.rb
GeneSaudeId-0.1.3 lib/SkeletonWeb/features/support/hooks.rb
GeneSaudeId-0.1.2 lib/SkeletonWeb/features/support/hooks.rb
GeneSaudeId-0.1.1 lib/SkeletonWeb/features/support/hooks.rb
GeneSaudeId-0.1.0 lib/SkeletonWeb/features/support/hooks.rb