Class: QaServer::MonitorStatus::CurrentStatusPresenter
- Inherits:
-
Object
- Object
- QaServer::MonitorStatus::CurrentStatusPresenter
- Defined in:
- app/presenters/qa_server/monitor_status/current_status_presenter.rb
Instance Method Summary collapse
-
#authorities_count ⇒ Integer
Number of loaded authorities.
-
#authorities_count_style ⇒ String
Css style class representing whether all tests passed or any failed.
-
#failing_authorities_count ⇒ Integer
Number of authorities with failing tests in the latest test run.
-
#failing_tests_count ⇒ Integer
Number of failing tests in the latest test run.
-
#failing_tests_style ⇒ String
Css style class representing whether all tests passed or any failed.
-
#failures ⇒ Array<Hash>
A list of failures data in the latest test run, if any.
-
#failures? ⇒ Boolean
True if failure data exists for the latest test run; otherwise false.
-
#first_updated ⇒ String
Date with time of first recorded test run.
-
#first_updated_dt ⇒ ActiveSupport::TimeWithZone
Date time stamp of first recorded test run.
-
#initialize(parent:, current_summary:, current_failure_data:) ⇒ CurrentStatusPresenter
constructor
A new instance of CurrentStatusPresenter.
-
#last_updated ⇒ String
Date with time of last test run.
-
#last_updated_dt ⇒ ActiveSupport::TimeWithZone
Date time stamp of last test run.
-
#passing_tests_count ⇒ Integer
Number of passing tests in the latest test run.
-
#tests_count ⇒ Integer
Number of tests in the latest test run.
Constructor Details
#initialize(parent:, current_summary:, current_failure_data:) ⇒ CurrentStatusPresenter
Returns a new instance of CurrentStatusPresenter.
8 9 10 11 12 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 8 def initialize(parent:, current_summary:, current_failure_data:) @parent = parent @current_summary = current_summary @current_failure_data = current_failure_data end |
Instance Method Details
#authorities_count ⇒ Integer
Returns number of loaded authorities.
35 36 37 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 35 def @current_summary. end |
#authorities_count_style ⇒ String
Returns css style class representing whether all tests passed or any failed.
45 46 47 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 45 def failures? ? 'status-bad' : 'status-good' end |
#failing_authorities_count ⇒ Integer
Returns number of authorities with failing tests in the latest test run.
40 41 42 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 40 def @current_failure_data.map { |f| f[:authority_name] }.uniq.count end |
#failing_tests_count ⇒ Integer
Returns number of failing tests in the latest test run.
60 61 62 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 60 def failing_tests_count @current_summary.failing_scenario_count end |
#failing_tests_style ⇒ String
Returns css style class representing whether all tests passed or any failed.
65 66 67 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 65 def failing_tests_style failures? ? 'summary-status-bad' : 'status-good' end |
#failures ⇒ Array<Hash>
Returns A list of failures data in the latest test run, if any.
79 80 81 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 79 def failures @current_failure_data end |
#failures? ⇒ Boolean
Returns true if failure data exists for the latest test run; otherwise false.
84 85 86 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 84 def failures? failing_tests_count.positive? && !failures.nil? end |
#first_updated ⇒ String
Returns date with time of first recorded test run.
30 31 32 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 30 def first_updated QaServer::TimeService.pretty_time(first_updated_dt) end |
#first_updated_dt ⇒ ActiveSupport::TimeWithZone
Returns date time stamp of first recorded test run.
25 26 27 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 25 def first_updated_dt QaServer::ScenarioRunRegistry.first_run_dt end |
#last_updated ⇒ String
Returns date with time of last test run.
20 21 22 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 20 def last_updated QaServer::TimeService.pretty_time(last_updated_dt) end |
#last_updated_dt ⇒ ActiveSupport::TimeWithZone
Returns date time stamp of last test run.
15 16 17 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 15 def last_updated_dt @current_summary.run_dt_stamp end |
#passing_tests_count ⇒ Integer
Returns number of passing tests in the latest test run.
55 56 57 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 55 def passing_tests_count @current_summary.passing_scenario_count end |
#tests_count ⇒ Integer
Returns number of tests in the latest test run.
50 51 52 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 50 def tests_count @current_summary.total_scenario_count end |