Sha256: c4d4f1c5faa23198368cd57261eff74a1aee5731c6a9bc66cc6f19e5c15659b7

Contents?: true

Size: 966 Bytes

Versions: 27

Compression:

Stored size: 966 Bytes

Contents

module OpsManagerUiDrivers
  module Version16
    module BoshProductSections
      class BoshProductFormSection
        def initialize(browser, field_prefix)
          @browser      = browser
          @field_prefix = field_prefix
        end

        def open_form(form_name)
          @browser.visit '/'
          @browser.click_on 'show-p-bosh-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

27 entries across 27 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-2.6.2 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.6.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.6.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.5.2 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.5.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.5.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.4.2 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.4.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.4.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.3.2 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.3.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.3.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.2.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.2.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.1.8 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.1.7 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.1.6 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.1.5 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.1.4 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-2.1.3 lib/ops_manager_ui_drivers/version16/bosh_product_sections/bosh_product_form_section.rb