2019-10-08 05:06:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class TestSuiteEntity < Grape::Entity
|
|
|
|
expose :name
|
|
|
|
expose :total_time
|
|
|
|
expose :total_count
|
|
|
|
|
|
|
|
expose :success_count
|
|
|
|
expose :failed_count
|
|
|
|
expose :skipped_count
|
|
|
|
expose :error_count
|
|
|
|
|
2020-06-19 14:08:39 -04:00
|
|
|
with_options if: -> (_, opts) { opts[:details] } do |test_suite|
|
|
|
|
expose :suite_error
|
|
|
|
expose :test_cases, using: TestCaseEntity do |test_suite|
|
|
|
|
test_suite.suite_error ? [] : test_suite.test_cases.values.flat_map(&:values)
|
|
|
|
end
|
2019-10-08 05:06:09 -04:00
|
|
|
end
|
|
|
|
end
|