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 of first recorded test run.
-
#initialize(current_summary:, current_failure_data:) ⇒ CurrentStatusPresenter
constructor
A new instance of CurrentStatusPresenter.
-
#last_updated ⇒ String
Date 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(current_summary:, current_failure_data:) ⇒ CurrentStatusPresenter
7 8 9 10 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 7 def initialize(current_summary:, current_failure_data:) @current_summary = current_summary @current_failure_data = current_failure_data end |
Instance Method Details
#authorities_count ⇒ Integer
23 24 25 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 23 def @current_summary. end |
#authorities_count_style ⇒ String
33 34 35 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 33 def failures? ? 'status-bad' : 'status-good' end |
#failing_authorities_count ⇒ Integer
28 29 30 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 28 def @current_failure_data.map { |f| f[:authority_name] }.uniq.count end |
#failing_tests_count ⇒ Integer
48 49 50 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 48 def failing_tests_count @current_summary.failing_scenario_count end |
#failing_tests_style ⇒ String
53 54 55 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 53 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.
67 68 69 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 67 def failures @current_failure_data end |
#failures? ⇒ Boolean
72 73 74 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 72 def failures? failing_tests_count.positive? end |
#first_updated ⇒ String
18 19 20 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 18 def first_updated QaServer::ScenarioRunRegistry.first.dt_stamp.in_time_zone("Eastern Time (US & Canada)").strftime("%m/%d/%y - %I:%M %p") end |
#last_updated ⇒ String
13 14 15 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 13 def last_updated @current_summary.run_dt_stamp.in_time_zone("Eastern Time (US & Canada)").strftime("%m/%d/%y - %I:%M %p") end |
#passing_tests_count ⇒ Integer
43 44 45 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 43 def passing_tests_count @current_summary.passing_scenario_count end |
#tests_count ⇒ Integer
38 39 40 |
# File 'app/presenters/qa_server/monitor_status/current_status_presenter.rb', line 38 def tests_count @current_summary.total_scenario_count end |