lib/sauce/cucumber.rb in sauce-cucumber-3.3.0 vs lib/sauce/cucumber.rb in sauce-cucumber-3.4.0
- old
+ new
@@ -122,12 +122,14 @@
job = SauceWhisk::Job.new('id' => session_id,
'name' => job_name,
'custom-data' => custom_data)
job.save unless job.nil?
+ scenario.sauce_public_link = SauceWhisk.public_link(session_id)
+
# This allow us to execute steps (n) times
- is_example_row = scenario.instance_of? ::Cucumber::Ast::OutlineTable::ExampleRow
+ is_example_row = scenario.instance_of? ::Cucumber::Ast::OutlineTable::ExampleRow
steps = is_example_row ? scenario.instance_variable_get(:@step_invocations) : scenario.steps
steps.each do |step|
step.instance_variable_set(:@skip_invoke, false)
end
@@ -139,10 +141,12 @@
unless job.nil?
job.passed = !scenario.failed?
job.save
end
+
+ puts "Sauce public job link: #{scenario.sauce_public_link}"
end
end
module_function :around_hook
end
end
@@ -162,6 +166,33 @@
Sauce::Utilities::Connect.close
Sauce::Utilities.warn_if_suspect_misconfiguration(:cucumber)
end
rescue NoMethodError # This makes me sad
+end
+
+
+begin
+ module Cucumber
+ module Ast
+ class Scenario
+ def sauce_public_link
+ @sauce_public_link ||= ""
+ end
+
+ def sauce_public_link=(link)
+ @sauce_public_link = link
+ end
+ end
+
+ class OutlineTable::ExampleRow
+ def sauce_public_link
+ @sauce_public_link ||= ""
+ end
+
+ def sauce_public_link=(link)
+ @sauce_public_link = link
+ end
+ end
+ end
+ end
end