diff options
Diffstat (limited to 'qa/spec/spec_helper.rb')
-rw-r--r-- | qa/spec/spec_helper.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb index e25892a008f..640f2de0ca2 100644 --- a/qa/spec/spec_helper.rb +++ b/qa/spec/spec_helper.rb @@ -27,8 +27,12 @@ RSpec.configure do |config| config.add_formatter QA::Support::Formatters::QuarantineFormatter config.add_formatter QA::Support::Formatters::TestStatsFormatter if QA::Runtime::Env.export_metrics? - config.before do |example| + config.prepend_before do |example| QA::Runtime::Logger.debug("\nStarting test: #{example.full_description}\n") + + # Reset fabrication counters tracked in resource base + Thread.current[:api_fabrication] = 0 + Thread.current[:browser_ui_fabrication] = 0 end config.after do @@ -36,6 +40,12 @@ RSpec.configure do |config| QA::Git::Repository.new.delete_netrc end + # Add fabrication time to spec metadata + config.append_after do |example| + example.metadata[:api_fabrication] = Thread.current[:api_fabrication] + example.metadata[:browser_ui_fabrication] = Thread.current[:browser_ui_fabrication] + end + config.after(:context) do if !QA::Runtime::Browser.blank_page? && QA::Page::Main::Menu.perform(&:signed_in?) QA::Page::Main::Menu.perform(&:sign_out) |