Sha256: 5657a3507b6aed96e477287cf7fb0d23ab31811bf19deba3db0816187fb267c3

Contents?: true

Size: 1.84 KB

Versions: 39

Compression:

Stored size: 1.84 KB

Contents

module OpsManagerUiDrivers
  module Version16
    module BoshProductSections
      class Networks
        def initialize(browser:)
          @browser                   = browser
          @bosh_product_form_section = BoshProductFormSection.new(browser, 'network[networks][]')
        end

        def add_single_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:)
          @bosh_product_form_section.open_form('network')

          @bosh_product_form_section.set_fields(
            'name'                    => name,
            'iaas_network_identifier' => iaas_network_identifier,
            'subnet'                  => subnet,
            'dns'                     => dns,
            'gateway'                 => gateway,
            'reserved_ip_ranges'      => reserved_ip_ranges,
          )
          browser.click_on 'Save'
          flash_errors = browser.all('.flash-message.error ul.message li').to_a
          flash_errors.reject! { |node| node.text =~ /cannot reach gateway/i }

          if (flash_errors.length > 0)
            fail flash_errors.collect(&:text).inspect
          end
        end

        def add_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:)
          @bosh_product_form_section.open_form('network')

          browser.click_on 'Add'
          @bosh_product_form_section.set_fields(
            'name'                    => name,
            'iaas_network_identifier' => iaas_network_identifier,
            'subnet'                  => subnet,
            'dns'                     => dns,
            'gateway'                 => gateway,
            'reserved_ip_ranges'      => reserved_ip_ranges,
          )
          @bosh_product_form_section.save_form([/Cannot reach gateway/])
        end

        private

        attr_reader :browser
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-2.42.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.41.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.40.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.40.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.39.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.38.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.37.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.36.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.35.2 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.35.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.35.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.34.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.34.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.33.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.33.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.32.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.32.0 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.31.3 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.31.2 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb
ops_manager_ui_drivers-2.31.1 lib/ops_manager_ui_drivers/version16/bosh_product_sections/networks.rb