Sha256: a8447d0196b247964782b157e239c1358160f5a067a85cf2657403a39c7993f2

Contents?: true

Size: 960 Bytes

Versions: 6

Compression:

Stored size: 960 Bytes

Contents

module OpsManagerUiDrivers
  module Version16
    module MicroboshSections
      class MicroboshFormSection
        def initialize(browser, field_prefix)
          @browser = browser
          @field_prefix = field_prefix
        end

        def open_form(form_name)
          @browser.visit '/'
          @browser.click_on 'show-microbosh-configure-action'
          @browser.click_on "show-#{form_name}-action"
        end

        def save_form
          @browser.click_on 'Save'
          @browser.expect(@browser.page).to @browser.have_css('.flash-message.success')
        end

        def set_fields(fields)
          fields.each do |field, value|
            set_field(field, value)
          end
        end

        private

        def set_field(field, value)
          last_field(field).set(value)
        end

        def last_field(field)
          @browser.all(:field, "#{@field_prefix}[#{field}]").last
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-1.5.1 lib/ops_manager_ui_drivers/version16/microbosh_sections/microbosh_form_section.rb
ops_manager_ui_drivers-1.5.0 lib/ops_manager_ui_drivers/version16/microbosh_sections/microbosh_form_section.rb
ops_manager_ui_drivers-1.4.0 lib/ops_manager_ui_drivers/version16/microbosh_sections/microbosh_form_section.rb
ops_manager_ui_drivers-1.3.1 lib/ops_manager_ui_drivers/version16/microbosh_sections/microbosh_form_section.rb
ops_manager_ui_drivers-1.3.0 lib/ops_manager_ui_drivers/version16/microbosh_sections/microbosh_form_section.rb
ops_manager_ui_drivers-1.2.1 lib/ops_manager_ui_drivers/version16/microbosh_sections/microbosh_form_section.rb