Sha256: b9fc80695be6dad4ac8d88337c5541aa94b3b84c34b6be990595cda056e98920

Contents?: true

Size: 905 Bytes

Versions: 6

Compression:

Stored size: 905 Bytes

Contents

# frozen_string_literal: true

# Helpers that get automatically included in feature specs.
module Decidim::FeatureTestHelpers
  def click_submenu_link(text)
    within ".secondary-nav--subnav" do
      click_link text
    end
  end

  def within_user_menu
    within ".topbar__user__logged" do
      find("a", text: user.name).hover
      yield
    end
  end

  def within_language_menu
    within ".topbar__dropmenu.language-choose" do
      find("ul.dropdown.menu").hover
      yield
    end
  end

  def stripped(text)
    Nokogiri::HTML(text).text
  end

  def within_flash_messages
    within ".flash" do
      yield
    end
  end

  def expect_user_logged
    expect(page).to have_css(".topbar__user__logged")
  end

  def have_admin_callout(text)
    have_selector(".callout--full", text: text)
  end
end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-dev-0.10.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.10.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.9.3 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.9.2 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.9.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.9.0 lib/decidim/dev/test/rspec_support/helpers.rb