Sha256: 48839d838ea5cf2de4c6421999486a3342752b39284c4854e9497b3cfdb96a54

Contents?: true

Size: 554 Bytes

Versions: 5

Compression:

Stored size: 554 Bytes

Contents

# frozen_string_literal: true

module BaseFeatureHelper
  def click_nav(nav_text, subnav_text = nil)
    primary_nav = find(".admin-nav-menu>ul>li>a", text: /#{nav_text}/i)
    if subnav_text
      unless Capybara.current_driver == :rack_test
        # we need to make the navigation visible with Selenium driver,
        # and RackTest implementation of `hover`raises NotImplementedError
        primary_nav.hover
      end
      primary_nav.sibling("ul").find("li > a", text: /#{subnav_text}/i).click
    else
      primary_nav.click
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_backend-2.10.5 spec/support/feature/base_feature_helper.rb
solidus_backend-2.10.3 spec/support/feature/base_feature_helper.rb
solidus_backend-2.10.2 spec/support/feature/base_feature_helper.rb
solidus_backend-2.10.1 spec/support/feature/base_feature_helper.rb
solidus_backend-2.10.0 spec/support/feature/base_feature_helper.rb