Sha256: 030a562cd6cb82ed2706c8eb2b915c1440d3de31fda6f6c4efda40f663e8843d

Contents?: true

Size: 1.18 KB

Versions: 21

Compression:

Stored size: 1.18 KB

Contents

module OpsManagerUiDrivers
  module Version17
    module BoshProductSections
      class BoshProductFormSection
        attr_reader :field_prefix

        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

        def select_all_az_references_on_page
          @browser.all(:field, "#{@field_prefix}[availability_zone_references][]").each do |node|
            node.set(true)
          end
        end

        private

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

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-1.28.1 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.28.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.27.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.26.1 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.26.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.25.1 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.25.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.24.4 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.24.3 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.24.2 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.24.1 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.24.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.23.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.22.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.21.1 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.21.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.20.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.19.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.18.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb
ops_manager_ui_drivers-1.17.0 lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb