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.26.10 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.9 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.8 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.7 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.5 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.4 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.3 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.2 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.1 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.0 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.0.rc2 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.26.0.rc1 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.25.2 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.25.1 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.25.0 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.25.0.rc4 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.25.0.rc3 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.25.0.rc2 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.25.0.rc1 lib/decidim/dev/test/rspec_support/frontend.rb
decidim-dev-0.24.3 lib/decidim/dev/test/rspec_support/frontend.rb