Class: Ace::Test::EndToEndRunner::Molecules::SimpleDisplayManager
- Inherits:
-
Object
- Object
- Ace::Test::EndToEndRunner::Molecules::SimpleDisplayManager
- Defined in:
- lib/ace/test/end_to_end_runner/molecules/simple_display_manager.rb
Overview
Line-by-line display manager for E2E test output (default mode). Optimized for piping, log capture, and agent consumption. No ANSI cursor control — each event appends a new line.
Instance Method Summary collapse
-
#initialize(scenarios, output:, parallel:) ⇒ SimpleDisplayManager
constructor
A new instance of SimpleDisplayManager.
-
#initialize_display ⇒ Object
Print header showing test count and parallelism.
-
#refresh ⇒ Object
No-op — simple mode doesn’t need refresh.
-
#show_single_result(result) ⇒ Object
Print a single-test result line (for run-single-test mode).
-
#show_summary(results, report_path) ⇒ Object
Print structured summary block.
-
#test_completed(scenario, result, completed, total) ⇒ Object
Print line when a test completes.
-
#test_started(scenario) ⇒ Object
Print line when a test begins.
Constructor Details
#initialize(scenarios, output:, parallel:) ⇒ SimpleDisplayManager
Returns a new instance of SimpleDisplayManager.
14 15 16 17 18 19 20 |
# File 'lib/ace/test/end_to_end_runner/molecules/simple_display_manager.rb', line 14 def initialize(scenarios, output:, parallel:) @scenarios = scenarios @output = output @parallel = parallel @use_color = output.respond_to?(:tty?) && output.tty? @start_time = Time.now end |
Instance Method Details
#initialize_display ⇒ Object
Print header showing test count and parallelism
23 24 25 26 27 |
# File 'lib/ace/test/end_to_end_runner/molecules/simple_display_manager.rb', line 23 def initialize_display package = @scenarios.first&.package || "unknown" @output.puts "Discovered #{@scenarios.size} E2E tests in #{package}" @output.puts "Running with parallelism: #{@parallel}" if @parallel > 1 end |
#refresh ⇒ Object
No-op — simple mode doesn’t need refresh
56 57 |
# File 'lib/ace/test/end_to_end_runner/molecules/simple_display_manager.rb', line 56 def refresh end |
#show_single_result(result) ⇒ Object
Print a single-test result line (for run-single-test mode)
51 52 53 |
# File 'lib/ace/test/end_to_end_runner/molecules/simple_display_manager.rb', line 51 def show_single_result(result) @output.puts Atoms::DisplayHelpers.format_single_result(result, use_color: @use_color) end |
#show_summary(results, report_path) ⇒ Object
Print structured summary block
62 63 64 65 66 67 |
# File 'lib/ace/test/end_to_end_runner/molecules/simple_display_manager.rb', line 62 def show_summary(results, report_path) lines = Atoms::DisplayHelpers.format_summary_lines( results, Time.now - @start_time, report_path, use_color: @use_color ) lines.each { |line| @output.puts line } end |
#test_completed(scenario, result, completed, total) ⇒ Object
Print line when a test completes
40 41 42 43 44 45 46 47 |
# File 'lib/ace/test/end_to_end_runner/molecules/simple_display_manager.rb', line 40 def test_completed(scenario, result, completed, total) h = Atoms::DisplayHelpers icon = h.color(h.status_icon(result.success?), result.success? ? :green : :red, use_color: @use_color) elapsed = h.format_elapsed(result.duration) tc = h.tc_count_display(result) @output.puts "[#{completed}/#{total}] #{icon} #{elapsed} #{scenario.test_id} #{result.status.upcase}#{tc}" end |
#test_started(scenario) ⇒ Object
Print line when a test begins
31 32 33 |
# File 'lib/ace/test/end_to_end_runner/molecules/simple_display_manager.rb', line 31 def test_started(scenario) @output.puts "[started] #{scenario.test_id}: #{scenario.title}" end |