Class: TestCenter::Helper::XcodeJunit::TestCase
- Inherits:
-
Object
- Object
- TestCenter::Helper::XcodeJunit::TestCase
- Defined in:
- lib/fastlane/plugin/test_center/helper/junit_helper.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#skipped_test ⇒ Object
readonly
Returns the value of attribute skipped_test.
Instance Method Summary collapse
-
#initialize(xml_element) ⇒ TestCase
constructor
A new instance of TestCase.
- #passed? ⇒ Boolean
Constructor Details
#initialize(xml_element) ⇒ TestCase
Returns a new instance of TestCase.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/fastlane/plugin/test_center/helper/junit_helper.rb', line 75 def initialize(xml_element) @root = xml_element name = xml_element.attribute('name').value failure_element = xml_element.elements['failure'] if failure_element @message = failure_element.attribute('message')&.value || '' @location = failure_element.text || '' end full_testsuite = xml_element.parent.attribute('name').value testsuite = full_testsuite.testsuite is_swift = full_testsuite.testsuite_swift? testable_filename = xml_element.parent.parent.attribute('name').value testable = File.basename(testable_filename, '.xctest') @identifier = "#{testable}/#{testsuite}/#{name}" @skipped_test = Xcodeproj::XCScheme::TestAction::TestableReference::SkippedTest.new @skipped_test.identifier = "#{testsuite}/#{name}#{'()' if is_swift}" @passed = xml_element.get_elements('failure').size.zero? end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
70 71 72 |
# File 'lib/fastlane/plugin/test_center/helper/junit_helper.rb', line 70 def identifier @identifier end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
73 74 75 |
# File 'lib/fastlane/plugin/test_center/helper/junit_helper.rb', line 73 def location @location end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
72 73 74 |
# File 'lib/fastlane/plugin/test_center/helper/junit_helper.rb', line 72 def @message end |
#skipped_test ⇒ Object (readonly)
Returns the value of attribute skipped_test.
71 72 73 |
# File 'lib/fastlane/plugin/test_center/helper/junit_helper.rb', line 71 def skipped_test @skipped_test end |
Instance Method Details
#passed? ⇒ Boolean
95 96 97 |
# File 'lib/fastlane/plugin/test_center/helper/junit_helper.rb', line 95 def passed? @passed end |