Class: TestCenter::Helper::XcodeJunit::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/test_center/helper/junit_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_element) ⇒ TestCase

Returns a new instance of TestCase.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/fastlane/plugin/test_center/helper/junit_helper.rb', line 73

def initialize(xml_element)
  @root = xml_element
  name = xml_element.attributes['name']
  full_testsuite = xml_element.parent.attributes['name']
  testsuite = full_testsuite.testsuite
  is_swift = full_testsuite.testsuite_swift?

  testable_filename = xml_element.parent.parent.attributes['name']
  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

#identifierObject (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

#skipped_testObject (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

Returns:

  • (Boolean)


88
89
90
# File 'lib/fastlane/plugin/test_center/helper/junit_helper.rb', line 88

def passed?
  @passed
end