Class: Ace::Test::EndToEndRunner::Models::TestScenario
- Inherits:
-
Object
- Object
- Ace::Test::EndToEndRunner::Models::TestScenario
- Defined in:
- lib/ace/test/end_to_end_runner/models/test_scenario.rb
Overview
Data model representing a parsed E2E test scenario (TS-*/scenario.yml directory)
Contains all information extracted from a test scenario including scenario.yml metadata, test cases, and setup steps.
Instance Attribute Summary collapse
-
#area ⇒ Object
readonly
Returns the value of attribute area.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#dir_path ⇒ Object
readonly
Returns the value of attribute dir_path.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#fixture_path ⇒ Object
readonly
Returns the value of attribute fixture_path.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#requires ⇒ Object
readonly
Returns the value of attribute requires.
-
#sandbox_layout ⇒ Object
readonly
Returns the value of attribute sandbox_layout.
-
#sandbox_profile ⇒ Object
readonly
Returns the value of attribute sandbox_profile.
-
#setup_steps ⇒ Object
readonly
Returns the value of attribute setup_steps.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#test_cases ⇒ Object
readonly
Returns the value of attribute test_cases.
-
#test_id ⇒ Object
readonly
Returns the value of attribute test_id.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#tool_under_test ⇒ Object
readonly
Returns the value of attribute tool_under_test.
Instance Method Summary collapse
-
#dir_name(timestamp) ⇒ String
Build a directory name for sandbox/reports.
-
#initialize(test_id:, title:, area:, package:, file_path:, content:, priority: "medium", duration: "~5min", requires: {}, setup_steps: [], dir_path: nil, fixture_path: nil, test_cases: [], timeout: nil, tags: [], tool_under_test: nil, sandbox_layout: {}, sandbox_profile: "ace-default") ⇒ TestScenario
constructor
A new instance of TestScenario.
-
#short_id ⇒ String
Generate short test ID for directory naming.
-
#short_package ⇒ String
Generate short package name (without ace- prefix).
-
#test_case_ids ⇒ Array<String>
Extract test case IDs from the test_cases array.
Constructor Details
#initialize(test_id:, title:, area:, package:, file_path:, content:, priority: "medium", duration: "~5min", requires: {}, setup_steps: [], dir_path: nil, fixture_path: nil, test_cases: [], timeout: nil, tags: [], tool_under_test: nil, sandbox_layout: {}, sandbox_profile: "ace-default") ⇒ TestScenario
Returns a new instance of TestScenario.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 35 def initialize(test_id:, title:, area:, package:, file_path:, content:, priority: "medium", duration: "~5min", requires: {}, setup_steps: [], dir_path: nil, fixture_path: nil, test_cases: [], timeout: nil, tags: [], tool_under_test: nil, sandbox_layout: {}, sandbox_profile: "ace-default") @test_id = test_id @title = title @area = area @package = package @priority = priority @duration = duration @requires = requires @file_path = file_path @content = content @timeout = timeout @setup_steps = setup_steps @dir_path = dir_path @fixture_path = fixture_path @test_cases = test_cases @tags = @tool_under_test = tool_under_test @sandbox_layout = sandbox_layout @sandbox_profile = sandbox_profile end |
Instance Attribute Details
#area ⇒ Object (readonly)
Returns the value of attribute area.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def area @area end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def content @content end |
#dir_path ⇒ Object (readonly)
Returns the value of attribute dir_path.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def dir_path @dir_path end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def duration @duration end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def file_path @file_path end |
#fixture_path ⇒ Object (readonly)
Returns the value of attribute fixture_path.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def fixture_path @fixture_path end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def package @package end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def priority @priority end |
#requires ⇒ Object (readonly)
Returns the value of attribute requires.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def requires @requires end |
#sandbox_layout ⇒ Object (readonly)
Returns the value of attribute sandbox_layout.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def sandbox_layout @sandbox_layout end |
#sandbox_profile ⇒ Object (readonly)
Returns the value of attribute sandbox_profile.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def sandbox_profile @sandbox_profile end |
#setup_steps ⇒ Object (readonly)
Returns the value of attribute setup_steps.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def setup_steps @setup_steps end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def @tags end |
#test_cases ⇒ Object (readonly)
Returns the value of attribute test_cases.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def test_cases @test_cases end |
#test_id ⇒ Object (readonly)
Returns the value of attribute test_id.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def test_id @test_id end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def timeout @timeout end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def title @title end |
#tool_under_test ⇒ Object (readonly)
Returns the value of attribute tool_under_test.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 12 def tool_under_test @tool_under_test end |
Instance Method Details
#dir_name(timestamp) ⇒ String
Build a directory name for sandbox/reports
85 86 87 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 85 def dir_name() "#{}-#{short_package}-#{short_id}" end |
#short_id ⇒ String
Generate short test ID for directory naming
68 69 70 71 72 73 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 68 def short_id match = test_id.match(/TS-[A-Z0-9]+-(\d+[a-z]*)/) return "ts#{match[1]}" if match test_id.downcase.gsub(/[^a-z0-9]/, "") end |
#short_package ⇒ String
Generate short package name (without ace- prefix)
62 63 64 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 62 def short_package package.sub(/\Aace-/, "") end |
#test_case_ids ⇒ Array<String>
Extract test case IDs from the test_cases array
78 79 80 |
# File 'lib/ace/test/end_to_end_runner/models/test_scenario.rb', line 78 def test_case_ids @test_case_ids ||= test_cases.map(&:tc_id) end |