Sha256: 6b143c5cea27463451fd734985ca8e4a0b5105885264d0f826a19fdf045a6f7b

Contents?: true

Size: 707 Bytes

Versions: 21

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

module OrderFeatureHelper
  def add_line_item(product_name, quantity: 1)
    find(".js-add-line-item:not([disabled]), .line-item [name=quantity]").click

    targetted_select2_search product_name, from: ".select-variant"
    fill_in "quantity", with: quantity
    click_icon 'ok'
  end

  def complete_split_to(destination, quantity: nil)
    if destination.is_a?(Spree::Shipment)
      destination = destination.number
    elsif destination.is_a?(Spree::StockLocation)
      destination = destination.name
    end

    select2_no_label(destination, from: 'Choose Location')

    if quantity
      fill_in 'item_quantity', with: quantity
    end

    click_icon :ok
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
solidus_backend-2.10.5 spec/support/feature/order_feature_helper.rb
solidus_backend-2.10.3 spec/support/feature/order_feature_helper.rb
solidus_backend-2.10.2 spec/support/feature/order_feature_helper.rb
solidus_backend-2.9.6 spec/support/feature/order_feature_helper.rb
solidus_backend-2.8.6 spec/support/feature/order_feature_helper.rb
solidus_backend-2.10.1 spec/support/feature/order_feature_helper.rb
solidus_backend-2.9.5 spec/support/feature/order_feature_helper.rb
solidus_backend-2.10.0 spec/support/feature/order_feature_helper.rb
solidus_backend-2.9.4 spec/support/feature/order_feature_helper.rb
solidus_backend-2.8.5 spec/support/feature/order_feature_helper.rb
solidus_backend-2.9.3 spec/support/feature/order_feature_helper.rb
solidus_backend-2.9.2 spec/support/feature/order_feature_helper.rb
solidus_backend-2.10.0.beta1 spec/support/feature/order_feature_helper.rb
solidus_backend-2.9.1 spec/support/feature/order_feature_helper.rb
solidus_backend-2.9.0 spec/support/feature/order_feature_helper.rb
solidus_backend-2.9.0.rc.1 spec/support/feature/order_feature_helper.rb
solidus_backend-2.8.4 spec/support/feature/order_feature_helper.rb
solidus_backend-2.8.3 spec/support/feature/order_feature_helper.rb
solidus_backend-2.8.2 spec/support/feature/order_feature_helper.rb
solidus_backend-2.8.1 spec/support/feature/order_feature_helper.rb