Sha256: 9e73317257cf79f87025c5b4f0ce27d1f959a33fccf3b3a5eda9852750340922

Contents?: true

Size: 521 Bytes

Versions: 33

Compression:

Stored size: 521 Bytes

Contents

# frozen_string_literal: true

module FrontendHelpers
  # Thanks to:
  # https://medium.com/@coorasse/catch-javascript-errors-in-your-system-tests-89c2fe6773b1
  def expect_no_js_errors
    errors = page.driver.browser.manage.logs.get(:browser)
    return if errors.blank?

    aggregate_failures "javascript errors" do
      errors.each do |error|
        expect(error.level).not_to eq("SEVERE"), error.message
      end
    end
  end
end

RSpec.configure do |config|
  config.include FrontendHelpers, type: :system
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
decidim-dev-0.23.6 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.24.2 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.23.5 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.24.1 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.24.0 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.24.0.rc2 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.23.4 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.24.0.rc1 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.23.3 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.23.2 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.23.1 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.23.1.rc1 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.23.0 lib/decidim/dev/test/rspec_support/frontend.rb