diff --git a/lib/fastlane/plugin/test_report/actions/test_report_action.rb b/lib/fastlane/plugin/test_report/actions/test_report_action.rb index 2bc5eb8..92304cb 100644 --- a/lib/fastlane/plugin/test_report/actions/test_report_action.rb +++ b/lib/fastlane/plugin/test_report/actions/test_report_action.rb @@ -1,7 +1,7 @@ require 'fastlane/action' require_relative '../helper/test_report_helper' require "erb" -require "nokogiri" +require "rexml/document" module Fastlane module Actions @@ -9,45 +9,57 @@ class TestReportAction < Action def self.run(params) UI.message("The test_report plugin is working!") - report = File.read(File.expand_path(params[:path])) - doc = Nokogiri::XML(File.open(report)) - test_suite_name = @doc.xpath('//test_suite').attr("name") + include REXML + + File.rename("fastlane/test_output/report.junit", "fastlane/test_output/report.xml") + + file = File.new(File.expand_path(params[:report_path])) + doc = Document.new(file) template = '--- - layout: testReport - --- +layout: testReport +--- + +
<%= test.attributes["name"] %>
+<%= test.attributes["time"] %>
+testTakeScreenshots
-29.457s
-