Sha256: d59e0928a3e49a67f46e1957b71f88823317499986fa0fa5db0f1cef1d8e3d73

Contents?: true

Size: 736 Bytes

Versions: 6

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

module Capybara
  module DatepickerTimeFill
    # fill datepicker field correctly

    def fill_in_timepicker(locator = nil, with:, currently_with: nil, fill_options: {}, **find_options)
      find_options[:with] = currently_with if currently_with
      find_options[:allow_self] = true if locator.nil?
      with.chars.each do |character|
        if character == ":"
          find(:fillable_field, locator, **find_options).send_keys([:alt, ":"], **fill_options)
        else
          find(:fillable_field, locator, **find_options).send_keys(character, **fill_options)
        end
      end
    end
  end
end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-dev-0.29.1 lib/decidim/dev/test/rspec_support/datepicker_time_fill.rb
decidim-dev-0.29.0 lib/decidim/dev/test/rspec_support/datepicker_time_fill.rb
decidim-dev-0.29.0.rc4 lib/decidim/dev/test/rspec_support/datepicker_time_fill.rb
decidim-dev-0.29.0.rc3 lib/decidim/dev/test/rspec_support/datepicker_time_fill.rb
decidim-dev-0.29.0.rc2 lib/decidim/dev/test/rspec_support/datepicker_time_fill.rb
decidim-dev-0.29.0.rc1 lib/decidim/dev/test/rspec_support/datepicker_time_fill.rb