Sha256: 2de69bd9cc542a861ecf61cd9db120c676e25312171cec0aa4ae7ba75a20aed1

Contents?: true

Size: 533 Bytes

Versions: 1

Compression:

Stored size: 533 Bytes

Contents

# frozen_string_literal: true

#
# This collects the Selenium browser's console logs and raise the
# `DriverJSError` exception so that they are visible on a failure.
#
class DriverJSError < StandardError; end

RSpec.configure do |config|
  config.after(:all) do
    errors = page.driver.browser.manage.logs.get(:browser)
                 .select { |log| log.level == 'SEVERE' && log.message.present? }
                 .map(&:message)
                 .to_a

    raise DriverJSError, errors.join("\n\n") if errors.present?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_record_migration_ui-0.1.2 spec/support/browser_log.rb